cuda-api-wrappers
Thin C++-flavored wrappers for the CUDA Runtime API
cuda::launch_configuration_t Struct Reference

The full set of possible configuration parameters for launching a kernel on a GPU. More...

#include <launch_configuration.hpp>

Collaboration diagram for cuda::launch_configuration_t:

Public Member Functions

bool has_nondefault_attributes () const
 Determine whether the configuration includes launch attributes different than the default values. More...
 
constexpr launch_configuration_t (const launch_configuration_t &)=default
 
constexpr launch_configuration_t (launch_configuration_t &&)=default
 
CPP14_CONSTEXPR launch_configuration_toperator= (const launch_configuration_t &other)=default
 
CPP14_CONSTEXPR launch_configuration_toperator= (launch_configuration_t &&)=default
 
constexpr launch_configuration_t (grid::composite_dimensions_t grid_and_block_dimensions, memory::shared::size_t dynamic_shared_mem=0u)
 Constructors corresponding to the CUDA runtime API's triple-chevron launch syntax: More...
 
constexpr launch_configuration_t (grid::dimensions_t grid_dims, grid::dimensions_t block_dims, memory::shared::size_t dynamic_shared_mem=0u)
 
constexpr launch_configuration_t (int grid_dims, int block_dims, memory::shared::size_t dynamic_shared_mem=0u)
 

Public Attributes

grid::composite_dimensions_t dimensions { grid::dimensions_t{ 0u, 0u, 0u }, grid::block_dimensions_t{ 0u, 0u, 0u } }
 Dimensions of the launch grid in blocks, and of the individual blocks in the grid.
 
memory::shared::size_t dynamic_shared_memory_size { 0u }
 The number of bytes each grid block may use, in addition to the statically-allocated shared memory data inherent in the compiled kernel.
 
bool block_cooperation { false }
 When true, CUDA's "cooperative launch" mechanism will be used, enabling more flexible device-wide synchronization capabilities; see CUDA Programming Guide section C.7, Grid Synchronization. More...
 

Detailed Description

The full set of possible configuration parameters for launching a kernel on a GPU.

Note
Consider using a launch_configuration_builder_t to incrementally construct these structs.
this structure must be constructed with at least the grid and block dimensions.

Constructor & Destructor Documentation

◆ launch_configuration_t()

constexpr cuda::launch_configuration_t::launch_configuration_t ( grid::composite_dimensions_t  grid_and_block_dimensions,
memory::shared::size_t  dynamic_shared_mem = 0u 
)
inline

Constructors corresponding to the CUDA runtime API's triple-chevron launch syntax:

my_kernel <<< grid_Dims, block_dims, dynamic_shmem_size, my_stream >>> ( arg1, arg2, arg3, etc);

... where the specified aspects of the launch configuration are the dimensions and the dynamic shared memory size.

Note
The choices of stream and kernel function are not part of the launch configuration.

Member Function Documentation

◆ has_nondefault_attributes()

bool cuda::launch_configuration_t::has_nondefault_attributes ( ) const
inline

Determine whether the configuration includes launch attributes different than the default values.

Note
The grid dimensions, block dimensions, and dynamic shared memory size are not considered launch attributes, and their settings does not affect the result of this method.

Member Data Documentation

◆ block_cooperation

bool cuda::launch_configuration_t::block_cooperation { false }

When true, CUDA's "cooperative launch" mechanism will be used, enabling more flexible device-wide synchronization capabilities; see CUDA Programming Guide section C.7, Grid Synchronization.

(The section talks about "cooperative groups", but you should ignore those, as they are simply C++ library constructs and do not in the compiled code).


The documentation for this struct was generated from the following file: