54b0c5a3db8a37c19219aa53c9be4c8e554dc52a
4 /*----------------------------------------------------------------------*\
6 \*---------------------------------------------------------------------*/
8 /*--------------------------------------*\
10 \*-------------------------------------*/
15 /*--------------------------------------*\
17 \*-------------------------------------*/
21 /*--------------------------------------*\
23 \*-------------------------------------*/
27 /*------------------*\
34 return (threadIdx
.x
+ (blockDim
.x
* blockIdx
.x
)) + ((threadIdx
.y
+ (blockDim
.y
* blockIdx
.y
)) * (gridDim
.x
* blockDim
.x
));
38 * output in [0,nbThreadBlock()[
39 * return threadIdx.x+blockDim.x*threadIdx.y;
42 static int tidLocalBlock()
44 return threadIdx
.x
+ blockDim
.x
* threadIdx
.y
;
53 return threadIdx
.x
+ blockDim
.x
* threadIdx
.y
;
62 return threadIdx
.x
+ blockDim
.x
* threadIdx
.y
;
65 /*------------------*\
67 \*-------------------*/
72 return (gridDim
.x
* gridDim
.y
) * (blockDim
.x
* blockDim
.y
);
76 static int nbThreadX()
78 return gridDim
.x
* blockDim
.x
;
82 static int nbThreadY()
84 return gridDim
.y
* blockDim
.y
;
88 static int nbThreadBlock()
90 return blockDim
.x
* blockDim
.y
;
95 /*--------------------------------------*\
97 \*-------------------------------------*/
105 /*----------------------------------------------------------------------*\
107 \*---------------------------------------------------------------------*/