colored image to greyscale image using CUDA parallel processing

前端 未结 12 1230
失恋的感觉
失恋的感觉 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 19:55

    You are running following number of block and grids:

      const dim3 blockSize(numCols/32, numCols/32 , 1);  //TODO
      const dim3 gridSize(numRows/12, numRows/12 , 1);  //TODO
    

    yet you are not using any threads in your kernel code!

     int absolute_image_position_x = blockIdx.x;  
     int absolute_image_position_y = blockIdx.y;
    

    think this way, the width of an image can be divide into absolute_image_position_x parts of column and the height of an image can be divide into absolute_image_position_y parts of row. Now the box each of the cross section it creates you need to change/redraw all the pixels in terms of greyImage, parallely. Enough spoiler for an assignment :)

提交回复
热议问题