Cholla 3.0.1-dev
Cholla - Massively parallel hydro on GPUs
Loading...
Searching...
No Matches
Public Member Functions | List of all members
cuda_utilities::AutomaticLaunchParams< T > Struct Template Reference

Struct to determine the optimal number of blocks and threads per block to use when launching a kernel. The member variables are threadsPerBlock and numBlocks which are chosen with the occupancy API. More...

#include <cuda_utilities.h>

Public Member Functions

 AutomaticLaunchParams (T &kernel, size_t numElements=0)
 Construct a new AutomaticLaunchParams object. By default it generates values of numBlocks and threadsPerBlock suitable for a kernel with a grid-stride loop. For a kernel with one thread per element set the optional numElements argument to the number of elements.
 
 ~AutomaticLaunchParams ()=default
 Defaulted Destructor.
 
int get_threadsPerBlock () const
 Getter for threadsPerBlock.
 
int get_numBlocks () const
 Getter for numBlocks.
 

Detailed Description

template<typename T>
struct cuda_utilities::AutomaticLaunchParams< T >

Struct to determine the optimal number of blocks and threads per block to use when launching a kernel. The member variables are threadsPerBlock and numBlocks which are chosen with the occupancy API.

Constructor & Destructor Documentation

◆ AutomaticLaunchParams()

template<typename T >
cuda_utilities::AutomaticLaunchParams< T >::AutomaticLaunchParams ( T &  kernel,
size_t  numElements = 0 
)
inline

Construct a new AutomaticLaunchParams object. By default it generates values of numBlocks and threadsPerBlock suitable for a kernel with a grid-stride loop. For a kernel with one thread per element set the optional numElements argument to the number of elements.

Parameters
[in]kernelThe kernel to determine the launch parameters for
[in]numElementsThe number of elements in the array that the kernel operates on

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