1 Reply Latest reply on Mar 12, 2018 5:38 PM by Intel Corporation

    opencl runtime not executing clEventCallback

    jpsollie

      Hello everyone,

       

      I am developing a program using openCL 1.2 on linux on a i5-7600 on linux-4.14

      The program is built using event-based programming:

      this part executes it callback:

       

      err = clEnqueueNDRangeKernel(in_devs[i].command_queue, in_devs[i].kernels[in_devs[i].hosting_iterator->current_char % 4], 3, NULL, globalworkids, localworkids, 0, NULL, in_devs[i].event);

              if(err != CL_SUCCESS) {

                  printf("clEnqueueNDRangeKernel for device %d failed. skipping item  %d \r\n", i, err);

                  pass->mapping[i] = -1;

              }

              err = clSetEventCallback(*(in_devs[i].event), CL_COMPLETE, nextevent, pass);

              if(err != CL_SUCCESS) {

                  printf("clSetEventCallback for device %d failed. skipping item  %d \r\n", i, err);

                  pass->mapping[i] = -1;

                  continue;

              }

              clFlush(in_devs[i].command_queue);

       

      This part does not:

       

      void CL_CALLBACK nextevent(cl_event event, cl_int event_command_exec_status, void* user_data) {

          jp_event_passthrough* process = (jp_event_passthrough*) user_data;

          cl_uint err;

          printf("launching next event on %d \r\n", process->deviceid);

          err = clEnqueueReadBuffer(process->devlist[process->deviceid].command_queue, process->devlist[process->deviceid].args[3], CL_FALSE, 0, process->devlist[process->deviceid].hosting_iterator->current_char + 4, process->resp, 1, process->devlist[process->deviceid].event, &(process->multiple_use));

          err |= clSetEventCallback(process->multiple_use, CL_COMPLETE, nextReadevent, process);

          if(err != CL_SUCCESS) {

              printf("Problem while read result from device %d %d \r\n", process->deviceid, err);

              process->mapping[process->deviceid] = -1;

              return;

          }

          clFlush(process->devlist[process->deviceid].command_queue);

      //    clReleaseEvent(event);

      }

       

      the problem does not occur on the nvidia opencl runtime (installed on the same pc), and does not occur on windows on a Xeon E5-2643 cpu.

      What am I doing wrong?

       

      any suggestions are welcome