Results 1 to 4 of 4

Thread: run kernel in one NDRange space

Hybrid View

  1. #1

    run kernel in one NDRange space

    Hi forum,

    I have the local work size defined and i want to run the kernel in one NDRange index space only .

    I am confused within the execution command :

    Code :
    size_t localWorkSize[2] = {64, 64};
     
    // HOW should define the global work size if i need only one NDRange / (Grid, CUDA equivalent)
    errNum = clEnqueueNDRangeKernel();


    Any idea ?


    Thanks

  2. #2
    Senior Member
    Join Date
    Oct 2012
    Posts
    111
    The dimension of the global work size and the local work size must be the same so you should write something like:

    Code :
    size_t globalWorkSize[1] = { n };
    size_t localWorkSize[1] = { 64 };
     
    clEnqueueNDRangeKernel(cmdQueue, kernel, 1, globalWorkSize, localWorkSize, ...)

  3. #3
    Hi

    Ok let me refresh again. I want to execute kernel in one work-group and it is 2 dimensional. As a result, i did not understand your last post. You suggested something 1D instead, isnt it?


    Like in CUDA , we write kernel<<<1, thid>>>, where dim3 thid(64,64,1); It means that we are executing one block(Work-group) with 64*64 threads(work-items).

    Any more thoughts?


    Thanks

  4. #4
    Senior Member
    Join Date
    Oct 2012
    Posts
    111
    Then you just have to define the same values for the global size and the local size:

    Code :
    size_t globalWorkSize[2] = { 64, 64 };
    size_t localWorkSize[2] = { 64, 64 };
     
    clEnqueueNDRangeKernel(cmdQueue, kernel, 2, globalWorkSize, localWorkSize, ...)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •