Research Article
True 4D Image Denoising on the GPU
// Code that is executed before the kernel is launched | int threadsInX = 32; | int threadsInY = 16; | int threadsIn = 1; | int blocksInX = (DATA_W+threadsInX-1)/threadsInX; | int blocksInY = (DATA_H+threadsInY-1)/threadsInY; | int blocksInZ = (DATA_D+threadsInZ-1)/threadsInZ; | dim3 dimGrid = dim3(blocksInX, blocksInY*blocksInZ); | dim3 dimBlock = dim3(threadsInX, threadsInY, threadsInZ); | // Code that is executed inside the kernel | int blockIdxz = __float2uint_rd(blockIdx.y * invBlocksInY); | int blockIdxy = blockIdx.y − blockIdxz * blocksInY; | int x = blockIdx.x * blockDim.x + threadIdx.x; | int y = blockIdxy * blockDim.y + threadIdx.y; | int z = blockIdxz * blockDim.z + threadIdx.z; |
|