3 Replies Latest reply on Nov 7, 2015 5:02 PM by nibal



      Hello everyone, I have a question

      In this simple example of KERNEL:



      __kernel void blank(__global int4 *x) {
           for(int i=0; i<25; i++) {
           x[i] *= 2;


      I initialized a vector, and put in a buffer and send as parameter to KERNEL:


            // Initialize data
            for(i=0; i<100; i++) {
               data[i] = i;


      If I am correct, the vector of 100 positions will be divided into 4 parts, within the variable '__global int4'. And how is the execution? will be created 4 work-items in the same workgroup and executed in a single processing unit. Or will be created four work-groups and each running on a different processing unit.

      I did not understand how it will be executed in relation to work-item and work-group.


      To send the KERNEL to run, I'm not using the "enqueueNDRangeKernel" function, just "queue.enqueueTask (kernel);"


      Thank you

        • Re: Question

          You pass all these parameters in the global and local arrays of NDRangeKernel. I can't find enqueueTask in ocl 2.0 or 1.2 Where did you find it?

          You can also specify workgroups as kernel attriutes:

          __kernel __attribute__((reqd_work_group_size(64, 1, 1))) void blank()