Function cuOccupancyAvailableDynamicSMemPerBlock

Source
pub unsafe extern "C" fn cuOccupancyAvailableDynamicSMemPerBlock(
    dynamicSmemSize: *mut usize,
    func: CUfunction,
    numBlocks: c_int,
    blockSize: c_int,
) -> CUresult
Expand description

\brief Returns dynamic shared memory available per block when launching \p numBlocks blocks on SM

Returns in \p *dynamicSmemSize the maximum size of dynamic shared memory to allow \p numBlocks blocks per SM.

Note that the API can also be used with context-less kernel ::CUkernel by querying the handle using ::cuLibraryGetKernel() and then passing it to the API by casting to ::CUfunction. Here, the context to use for calculations will be the current context.

\param dynamicSmemSize - Returned maximum dynamic shared memory \param func - Kernel function for which occupancy is calculated \param numBlocks - Number of blocks to fit on SM \param blockSize - Size of the blocks

\return ::CUDA_SUCCESS, ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_UNKNOWN \notefnerr