Core NPP_Plus Functions
Basic functions for library management, in particular library version and device property query functions.
Functions
-
const NppLibraryVersion *nppGetLibVersion(void)
Get the NPP library version.
- Returns
A struct containing separate values for major and minor revision and build number.
-
int nppGetGpuNumSMs(void)
Get the number of Streaming Multiprocessors (SM) on the active CUDA device.
- Returns
Number of SMs of the default CUDA device.
-
int nppGetMaxThreadsPerBlock(void)
Get the maximum number of threads per block on the active CUDA device.
- Returns
Maximum number of threads per block on the active CUDA device.
-
int nppGetMaxThreadsPerSM(void)
Get the maximum number of threads per SM for the active GPU.
- Returns
Maximum number of threads per SM for the active GPU
-
int nppGetGpuDeviceProperties(int *pMaxThreadsPerSM, int *pMaxThreadsPerBlock, int *pNumberOfSMs)
Get the maximum number of threads per SM, maximum threads per block, and number of SMs for the active GPU.
- Returns
cudaSuccess for success, -1 for failure
-
const char *nppGetGpuName(void)
Get the name of the active CUDA device.
- Returns
Name string of the active graphics-card/compute device in a system.
-
cudaStream_t nppGetStream(void)
Get the NPP CUDA stream.
NPP enables concurrent device tasks via a global stream state varible. The NPP stream by default is set to stream 0, i.e. non-concurrent mode. A user can set the NPP stream to any valid CUDA stream. All CUDA commands issued by NPP (e.g. kernels launched by the NPP library) are then issed to that NPP stream.
-
NppStatus nppGetStreamContext(NppStreamContext *pNppStreamContext)
Get the current NPP managed CUDA stream context as set by calls to nppSetStream().
NPP enables concurrent device tasks via an NPP maintained global stream state context. The NPP stream by default is set to stream 0, i.e. non-concurrent mode. A user can set the NPP stream to any valid CUDA stream which will update the current NPP managed stream state context or supply application initialized stream contexts to NPP calls. All CUDA commands issued by NPP (e.g. kernels launched by the NPP library) are then issed to the current NPP managed stream or to application supplied stream contexts depending on whether the stream context is passed to the NPP function or not. NPP managed stream context calls (those without stream context parameters) can be intermixed with application managed stream context calls but any NPP managed stream context calls will always use the most recent stream set by nppSetStream() or the NULL stream if nppSetStream() has never been called.
-
unsigned int nppGetStreamNumSMs(void)
Get the number of SMs on the device associated with the current NPP CUDA stream.
NPP enables concurrent device tasks via a global stream state varible. The NPP stream by default is set to stream 0, i.e. non-concurrent mode. A user can set the NPP stream to any valid CUDA stream. All CUDA commands issued by NPP (e.g. kernels launched by the NPP library) are then issed to that NPP stream. This call avoids a cudaGetDeviceProperties() call.
-
unsigned int nppGetStreamMaxThreadsPerSM(void)
Get the maximum number of threads per SM on the device associated with the current NPP CUDA stream.
NPP enables concurrent device tasks via a global stream state varible. The NPP stream by default is set to stream 0, i.e. non-concurrent mode. A user can set the NPP stream to any valid CUDA stream. All CUDA commands issued by NPP (e.g. kernels launched by the NPP library) are then issed to that NPP stream. This call avoids a cudaGetDeviceProperties() call.
-
NppStatus nppSetStream(cudaStream_t hStream)
Set the NPP CUDA stream.
This function now returns an error if a problem occurs with Cuda stream management. This function should only be called if a call to nppGetStream() returns a stream number which is different from the desired stream since unnecessarily flushing the current stream can significantly affect performance.
See also