0

This is my NVIDIA Graphics Processor: Quadro K5200. Total number of CUDA core is 2304. What is the optimal number of blocks & threads for my machine? That is for some function kernel<<>> (), what is the optimal x & y. I am very new in CUDA code. Please help me.

user5020
  • 47
  • 1
  • 6

1 Answers1

0

To find out the maximum blocks and threads available I use this piece of code.

cudaDeviceProp prop;
cudaGetDeviceProperties(&prop, 0);
printf("Max Thread Dimensions: %i x %i x %i\n", prop.maxThreadsDim[0], prop.maxThreadsDim[1], prop.maxThreadsDim[2]);
printf("Max Block Dimensions: %i x %i x %i\n", prop.maxGridSize[0], prop.maxGridSize[1], prop.maxGridSize[2]);  
Jack
  • 102
  • 1
  • 14
  • also held within CUDAToolkit\tools there is an exel spreadsheet which can help you calculate the optimal use of threads and blocks as sometimes using the maximum is not the most efficient option. – Jack Oct 27 '16 at 10:26