1 #ifndef INDICES_TOOLS_GPU_H_
2 #define INDICES_TOOLS_GPU_H_
4 #include "both_define.h"
5 #include "cudaType_CPU.h"
7 /*----------------------------------------------------------------------*\
9 \*---------------------------------------------------------------------*/
11 /*--------------------------------------*\
13 \*-------------------------------------*/
20 /*--------------------------------------*\
22 \*--------------------------------------*/
26 /*--------------------------------------*\
28 \*--------------------------------------*/
33 * s[0,W*H[ --> i[0,H[ j[0,W[
38 static void toIJ( int s
, int w
, int* ptrI
, int* ptrJ
)
41 *ptrJ
= s
- w
* (*ptrI
);
45 * s[0,W*H[ --> x[0,W[ y[0,H[
48 static float2
toPixelFloat(int s
, int w
)
51 const int x
= s
- w
* y
;
52 const float2 pixel
= { (float)x
, (float)y
};
57 * i[0,H[ j[0,W[ --> s[0,W*H[
62 static int toS(int w
, int i
, int j
)
67 /*-------------------------------------*\
69 \*-------------------------------------*/
78 /*----------------------------------------------------------------------*\
80 \*---------------------------------------------------------------------*/