Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef __cmtkCUDA_h_included_
00032 #define __cmtkCUDA_h_included_
00033
00034 #include <cmtkconfig.h>
00035
00036 #include <cuda_runtime_api.h>
00037
00038 #include <stdio.h>
00039 #include <stdlib.h>
00040
00041 #include "System/cmtkStackBacktrace.h"
00042
00043 #define cmtkCheckCallCUDA(cmd) \
00044 { const cudaError_t cudaError = cmd; if ( cudaError != cudaSuccess ) { fprintf( stderr, "CUDA command failed with error '%s' at %s:%d\n", cudaGetErrorString( cudaError ), __FILE__, __LINE__ ); cmtk::StackBacktrace::PrintBacktrace(); exit(1); } }
00045
00046 #define cmtkCheckLastErrorCUDA \
00047 { const cudaError_t cudaError = cudaGetLastError(); if ( cudaError != cudaSuccess ) { fprintf( stderr, "CUDA error '%s' at %s:%d\n", cudaGetErrorString( cudaError ), __FILE__, __LINE__ ); cmtk::StackBacktrace::PrintBacktrace(); exit( 1 ); } }
00048
00049
00050 #endif // #ifndef __cmtkCUDA_h_included_