colored image to greyscale image using CUDA parallel processing

前端 未结 12 1233
失恋的感觉
失恋的感觉 2021-02-04 19:10

I am trying to solve a problem in which i am supposed to change a colour image to a greyscale image. For this purpose i am using CUDA parallel approach.

The kerne code i

12条回答
  •  借酒劲吻你
    2021-02-04 20:06

    Now, since I posted this question I have been continuously working on this problem
    there are a couple of improvements that should be done in order to get this problem correct now I realize my initial solution was wrong .
    Changes to be done:-

     1. absolute_position_x =(blockIdx.x * blockDim.x) + threadIdx.x;
     2. absolute_position_y = (blockIdx.y * blockDim.y) + threadIdx.y;
    

    Secondly,

     1. const dim3 blockSize(24, 24, 1);
     2. const dim3 gridSize((numCols/16), (numRows/16) , 1);
    

    In the solution we are using a grid of numCols/16 * numCols/16
    and blocksize of 24 * 24

    code executed in 0.040576 ms

    @datenwolf : thanks for answering above!!!

提交回复
热议问题