|
| static void | gpuAssert (cudaError_t code, const char *file, int line, bool abort=true) |
| static void | ptrAssert (const void *ptr, const char *msg, const char *file, int line, bool abort=true) |
| bool | memoryPoolsSupported (int device) |
| | Returns true if device supports stream-ordered memory pools, i.e. cudaMallocAsync/cudaFreeAsync. Queried once per process for all devices and cached; out-of-range device ids return false.
|
| cudaError_t | mallocAsync (void **d_ptr, size_t size, cudaStream_t) |
| | Wrapper forced to synchronous cudaMalloc; see the mode comment above. The trailing stream argument is accepted for signature compatibility and ignored.
|
| cudaError_t | freeAsync (void *d_ptr, cudaStream_t) |
| | Wrapper forced to synchronous cudaFree; see the mode comment above. The trailing stream argument is accepted for signature compatibility and ignored.
|
| int | ptrToDevice (void *ptr) |
| | Returns the device ID associated with the specified pointer.
|
| int | currentDevice () |
| | Returns the ID of the current device.
|
| int | deviceCount () |
| | Returns the number of devices with compute capability greater or equal to 1.0 that are available for execution.
|
| void | printDevInfo (int device, const char *preMsg=nullptr, std::FILE *file=stderr) |
| | Print information about a specific device.
|
| size_t | blocksPerGrid (size_t numItems, size_t threadsPerBlock) |
| | Computes the number of blocks per grid given the problem size and number of threads per block.
|
| cudaError_t | memAdvise (const void *devPtr, size_t count, cudaMemoryAdvise advice, int device) |
| | Compatbility wrapper for cudaMemAdvise/cudaMemAdvise.
|
| cudaError_t | memPrefetchAsync (const void *devPtr, size_t count, int dstDevice, cudaStream_t stream) |
| | Compatbility wrapper for cudaMemPrefetchAsync/cudaMemPrefetchAsync.
|
Cuda specific utility functions.
- Author
- Ken Museth
- Date
- December 20, 2023