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:
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

Parameters:
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

Parameters:
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.

 All Classes Files Functions Variables Typedefs Friends Defines


active_realtime_segmentation
Author(s): Marten Bjorkman. Maintained by Jeannette Bohg
autogenerated on Fri Jan 11 09:51:12 2013