X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FBilatTools_Cuda%2Fsrc%2Fcore%2Fcudatools%2Fheader%2Fboth%2Fboth_define.h;fp=WCudaMSE%2FBilatTools_Cuda%2Fsrc%2Fcore%2Fcudatools%2Fheader%2Fboth%2Fboth_define.h;h=63229d0de79d269f48f24dbf5e04995dbf53db4a;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/BilatTools_Cuda/src/core/cudatools/header/both/both_define.h b/WCudaMSE/BilatTools_Cuda/src/core/cudatools/header/both/both_define.h new file mode 100755 index 0000000..63229d0 --- /dev/null +++ b/WCudaMSE/BilatTools_Cuda/src/core/cudatools/header/both/both_define.h @@ -0,0 +1,67 @@ +#ifndef BOTH_SMART_CBI_H_ +#define BOTH_SMART_CBI_H_ + + +/*----------------------------------------------------------------------*\ + |* Pre-defined Compiler Macros *| + \*---------------------------------------------------------------------*/ + +// http://sourceforge.net/p/predef/wiki/Compilers/ + +// http://msdn.microsoft.com/en-us/library/b0084kay.aspx +// https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html +// http://sourceforge.net/p/predef/wiki/Home/ + +// #ifdef __GNUC__ +// #if defined(_MSC_VER) +// #ifdef __CBI_CUDA__ + +/*----------------------------------------------------------------------*\ + |* Declaration *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +// Note +// Value of +// +// __CUDACC__ +// +// is +// +// true for code in a .cu file, ie code compil with nvcc (host or device side) +// false for code in a .cpp file, meme si nvcc est le compilateur used +// + +// But: +// Autoriser l'utilisation de code +// __device__ __host__ +// sur le host, meme dans un fichier cpp + +#ifdef __CUDACC__ + +#define __BOTH__ __device__ __host__ +#define __HOST__ __host__ + +#else + +// vide +#define __BOTH__ +#define __HOST__ + +//# warning __BOTH__ --> empty +//# warning __HOST__ --> empty + +#endif + +// A tester +//#include "cuda_runtime.h" +//#include "code utilisant __host__.h" + +#endif + +/*----------------------------------------------------------------------*\ + |* End *| + \*---------------------------------------------------------------------*/