X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FBilatTools_Cuda%2Fsrc%2Fcore%2Fcudatools%2Fheader%2Fdevice%2FIndiceTools_GPU.h;fp=WCudaMSE%2FBilatTools_Cuda%2Fsrc%2Fcore%2Fcudatools%2Fheader%2Fdevice%2FIndiceTools_GPU.h;h=d230aef4f854ea10818b47b2bc41c8115a2e6f63;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/BilatTools_Cuda/src/core/cudatools/header/device/IndiceTools_GPU.h b/WCudaMSE/BilatTools_Cuda/src/core/cudatools/header/device/IndiceTools_GPU.h new file mode 100755 index 0000000..d230aef --- /dev/null +++ b/WCudaMSE/BilatTools_Cuda/src/core/cudatools/header/device/IndiceTools_GPU.h @@ -0,0 +1,67 @@ +#ifndef INDICES_TOOLS_GPU_H_ +#define INDICES_TOOLS_GPU_H_ + +#include "both_define.h" + +/*----------------------------------------------------------------------*\ + |* Declaration *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +namespace gpu + { + class IndiceTools + { + + /*--------------------------------------*\ + |* Constructor *| + \*--------------------------------------*/ + + public: + + /*--------------------------------------*\ + |* Methodes *| + \*--------------------------------------*/ + + public: + + /** + * s[0,W*H[ --> i[0,H[ j[0,W[ + * w = largeur + * h = hauteur + */ + __BOTH__ + static void toIJ( int s, int w, int* ptrI, int* ptrJ) + { + *ptrI = s / w; + *ptrJ = s - w * (*ptrI); + } + + /** + * i[0,H[ j[0,W[ --> s[0,W*H[ + * w = largeur + * h = hauteur + */ + __BOTH__ + static int toS(int w, int i, int j) + { + return (i * w) + j; + } + + /*-------------------------------------*\ + |* Attributs *| + \*-------------------------------------*/ + + private: + + }; + } + +#endif + +/*----------------------------------------------------------------------*\ + |* End *| + \*---------------------------------------------------------------------*/