go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
cudaMacro.h
Go to the documentation of this file.
00001 /*======================================================================
00002 
00003   This file is part of the elastix software.
00004 
00005   Copyright (c) University Medical Center Utrecht. All rights reserved.
00006   See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
00007   details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE. See the above copyright notices for more information.
00012 
00013 ======================================================================*/
00014 #ifndef __cudaMacro_h
00015 #define __cudaMacro_h
00016 
00017 /* cuda version of some of the itk macros */
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 }; /* namespace cuda */
00052 
00053 #endif // end #ifndef __cudaMacro_h
00054 


Generated on 11-05-2012 for elastix by doxygen 1.7.6.1 elastix logo