Celeritas  0.5.0-86+4a8eea4
Classes | Functions
KernelAttributes.hh File Reference
#include <cstddef>
#include <type_traits>
#include "corecel/Config.hh"
#include "corecel/Assert.hh"
#include "corecel/Macros.hh"
#include "Device.hh"
This graph shows which files directly or indirectly include this file:

Classes

struct  celeritas::KernelAttributes
 Immutable attributes of a kernel function. More...
 

Functions

template<class F >
KernelAttributes celeritas::make_kernel_attributes (F *func, unsigned int threads_per_block=0)
 Build kernel attributes from a global kernel function. More...
 

Function Documentation

◆ make_kernel_attributes()

template<class F >
KernelAttributes celeritas::make_kernel_attributes ( F *  func,
unsigned int  threads_per_block = 0 
)

Build kernel attributes from a global kernel function.

This can only be called from CUDA/HIP code. It assumes that the block size is constant across the execution of the program and that the kernel is only called by the device that's active at this time.

The special value of zero threads per block causes the kernel attributes to default to the compile-time maximum number of threads per block as specified by launch bounds.