![]() |
MaCh3 2.2.1
Reference Guide
|
#include "Manager/gpuUtils.cuh"
Go to the source code of this file.
Functions | |
void | __cudaSafeCall (cudaError err, const char *file, const int line) |
Check for a safe call on GPU. | |
void | __cudaCheckError (const char *file, const int line) |
Check if there's been an error. | |
void | checkGpuMem () |
KS: Get some fancy info about VRAM usage. | |
void | PrintNdevices () |
KS: Get some fancy info about GPU. | |
void | ResetDevice () |
KS: Completely clean GPU, this is time consuming and may lead to unexpected behaviour. | |
void | SetDevice (const int deviceId) |
Only useful if using multiple GPU. | |
int | GetNumGPUThreads (const int Device) |
KS: Get number of GPU threads for currently used GPU. | |
size_t | GetL2CacheSize (const int device) |
KS: Get L2 cache size (in bytes) for the specified GPU device. | |
size_t | GetMaxTexture1DSize (const int device) |
KS: Get the maximum size for 1D textures on the specified GPU device. | |
size_t | GetSharedMemoryPerBlock (const int device) |
KS: Returns the maximum shared memory per block for a given GPU device. | |
void __cudaCheckError | ( | const char * | file, |
const int | line | ||
) |
Check if there's been an error.
This function checks if there has been any CUDA runtime API error and reports it.
file | The file name where the error occurred. |
line | The line number where the error occurred. |
Definition at line 18 of file gpuUtils.cu.
void __cudaSafeCall | ( | cudaError | err, |
const char * | file, | ||
const int | line | ||
) |
Check for a safe call on GPU.
KS: There is plenty of useful stuff here https://github.com/NVIDIA/cuda-samples/blob/master/Samples/1_Utilities/deviceQuery/deviceQuery.cpp
KS: We might want to port some of these utilities, for example having bool if there is unified memory etc.
This function checks the error status returned by CUDA runtime API functions and reports any errors.
err | The CUDA error code. |
file | The file name where the error occurred. |
line | The line number where the error occurred. |
Definition at line 6 of file gpuUtils.cu.
void checkGpuMem | ( | ) |
KS: Get some fancy info about VRAM usage.
Definition at line 43 of file gpuUtils.cu.
size_t GetL2CacheSize | ( | const int | device = 0 | ) |
KS: Get L2 cache size (in bytes) for the specified GPU device.
device | The ID of the device. Defaults to 0. |
Definition at line 122 of file gpuUtils.cu.
size_t GetMaxTexture1DSize | ( | const int | device = 0 | ) |
KS: Get the maximum size for 1D textures on the specified GPU device.
device | The ID of the device. Defaults to 0. |
Definition at line 134 of file gpuUtils.cu.
int GetNumGPUThreads | ( | const int | Device = 0 | ) |
KS: Get number of GPU threads for currently used GPU.
Device | The ID of the device. Defaults to 0. |
Definition at line 102 of file gpuUtils.cu.
size_t GetSharedMemoryPerBlock | ( | const int | device = 0 | ) |
KS: Returns the maximum shared memory per block for a given GPU device.
device | CUDA device ID (default = 0) |
Definition at line 146 of file gpuUtils.cu.
void PrintNdevices | ( | ) |
KS: Get some fancy info about GPU.
Definition at line 60 of file gpuUtils.cu.
void ResetDevice | ( | ) |
KS: Completely clean GPU, this is time consuming and may lead to unexpected behaviour.
Definition at line 77 of file gpuUtils.cu.
void SetDevice | ( | const int | deviceId | ) |
Only useful if using multiple GPU.
KS: Only useful if using multiple GPU.
Definition at line 85 of file gpuUtils.cu.