Home > other >  When doing the GPU programming, to write a KERNEL according to their characteristics, how to make se
When doing the GPU programming, to write a KERNEL according to their characteristics, how to make se

Time:09-19

HI, could you tell me when do the GPU programming, to write a KERNEL according to their characteristics, how to understand the data partition or is close to the optimal task parallel of performance?


Example:

 
Const int ARRAY_SIZE=1000;
Size_t globalWorkSize [1]={ARRAY_SIZE};
Size_t localWorkSize [1]={1};

//the Queue the kernel up for execution across indicates the array
ErrNum=clEnqueueNDRangeKernel (commandQueue, the kernel, 1, NULL,
GlobalWorkSize localWorkSize,
0, NULL, NULL);
If (errNum!=CL_SUCCESS)
{
STD: : cerr & lt; <"Error queuing kernel for execution." & lt; Cleanup (context, commandQueue, program, kernel, memObjects);
return 1;
}

Size_t globalWorkSize [1]={ARRAY_SIZE};
Size_t localWorkSize [1]={1};

How to set up in order to achieve optimal?


  • Related