Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef __cudaMacro_h
00015 #define __cudaMacro_h
00016
00017
00018 namespace cuda
00019 {
00020
00021 #define DBG_FUNC(NAME, PARAMETERS_DECLR, PARAMETERS_CALL) \
00022 inline cudaError_t NAME PARAMETERS_DECLR { \
00023 cudaError_t err = ::NAME PARAMETERS_CALL; \
00024 cudaCheckMsg(#NAME" failed!"); \
00025 return err; \
00026 }
00027
00028 #define cudaGetConstMacro(name,type) \
00029 virtual type Get##name () const { \
00030 return this->m_##name; \
00031 }
00032
00033 #define cudaSetMacro(name,type) \
00034 virtual void Set##name (const type _arg) { \
00035 if (this->m_##name != _arg) this->m_##name = _arg; \
00036 }
00037
00038 #define cudaGetMacro(name,type) \
00039 virtual type Get##name () { \
00040 return this->m_##name; \
00041 }
00042
00043 #define cudaBooleanMacro(name) \
00044 virtual void name##On() { \
00045 this->Set##name(true); \
00046 } \
00047 virtual void name##Off() { \
00048 this->Set##name(false); \
00049 }
00050
00051 };
00052
00053 #endif // end #ifndef __cudaMacro_h
00054