template<unsigned NT, unsigned VT>
tf::cudaExecutionPolicy class

class to define execution policy for CUDA standard algorithms

Template parameters
NT number of threads per block
VT number of work units per thread

Execution policy configures the kernel execution parameters in CUDA algorithms. The first template argument, NT, the number of threads per block should always be a power-of-two number. The second template argument, VT, the number of work units per thread is recommended to be an odd number to avoid bank conflict.

Details can be referred to Execution Policy.

Public static variables

static const unsigned nt
static constant for getting the number of threads per block
static const unsigned vt
static constant for getting the number of work units per thread
static const unsigned nv
static constant for getting the number of elements to process per block

Constructors, destructors, conversion operators

cudaExecutionPolicy() defaulted
constructs an execution policy object with default stream
cudaExecutionPolicy(cudaStream_t s) explicit
constructs an execution policy object with the given stream

Public functions

auto stream() -> cudaStream_t noexcept
queries the associated stream
void stream(cudaStream_t stream) noexcept
assigns a stream