Classes | Defines | Functions
cudautils.h File Reference
#include <cstdio>
#include <iostream>
Include dependency graph for cudautils.h:

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.

Detailed Description

CUDA utility functions

Definition in file cudautils.h.


Define Documentation

#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.


Function Documentation

void __checkMsg ( const char *  errorMessage,
const char *  file,
const int  line 
) [inline]

Check whether GPU threw an error.

Check whether GPU threw an error

Parameters:
errorMessageSpace for CUDA error string
fileName of source code file
lineIndex 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

Parameters:
errCUDA Runtime API error
fileName of source code file
lineIndex 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

Parameters:
fileName of source code file
lineIndex 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.



active_realtime_segmentation
Author(s): Mårten Björkman. Maintained by Jeannette Bohg
autogenerated on Fri Jan 3 2014 12:02:50