#include <cstdio>
#include <iostream>
Go to the source code of this file.
Classes | |
class | TimerGPU |
GPU timer class. More... | |
Defines | |
#define | checkMsg(msg) __checkMsg(msg, __FILE__, __LINE__) |
#define | safeCall(err) __safeCall(err, __FILE__, __LINE__) |
#define | safeThreadSync() __safeThreadSync(__FILE__, __LINE__) |
Functions | |
void | __checkMsg (const char *errorMessage, const char *file, const int line) |
Check whether GPU threw an error. | |
void | __safeCall (cudaError err, const char *file, const int line) |
Safe call of CUDA function. | |
void | __safeThreadSync (const char *file, const int line) |
Safe CUDA thread synchronisation. | |
bool | deviceInit (int dev) |
Initialise GPU. |
CUDA utility functions
Definition in file cudautils.h.
#define checkMsg | ( | msg | ) | __checkMsg(msg, __FILE__, __LINE__) |
Definition at line 42 of file cudautils.h.
#define safeCall | ( | err | ) | __safeCall(err, __FILE__, __LINE__) |
Definition at line 40 of file cudautils.h.
#define safeThreadSync | ( | ) | __safeThreadSync(__FILE__, __LINE__) |
Definition at line 41 of file cudautils.h.
void __checkMsg | ( | const char * | errorMessage, |
const char * | file, | ||
const int | line | ||
) | [inline] |
Check whether GPU threw an error.
Check whether GPU threw an error
errorMessage | Space for CUDA error string |
file | Name of source code file |
line | Index of line in source code |
Definition at line 78 of file cudautils.h.
void __safeCall | ( | cudaError | err, |
const char * | file, | ||
const int | line | ||
) | [inline] |
Safe call of CUDA function.
Allows safe call of CUDA function by catching thrown errors
err | CUDA Runtime API error |
file | Name of source code file |
line | Index of line in source code |
Definition at line 50 of file cudautils.h.
void __safeThreadSync | ( | const char * | file, |
const int | line | ||
) | [inline] |
Safe CUDA thread synchronisation.
Allows safe call of cudaThreadSynchronize() to catch threadSynchronize() Driver API error
file | Name of source code file |
line | Index of line in source code |
Definition at line 63 of file cudautils.h.
bool deviceInit | ( | int | dev | ) | [inline] |
Initialise GPU.
Definition at line 88 of file cudautils.h.