5 Replies Latest reply on Jul 17, 2014 1:56 AM by dipak

    Bug in clEnqueueTask?

    jasonwhite

      I was using CodeXL to do some profiling and it kept saying:

       

      Opencl Memory leak detected [Ref =1] Object created by clEnqueueNDRangeKernel

       

      Eventually it was narrowed down to this line:

       

      status = clEnqueueTask( myQueue, myKernel, 0, NULL, NULL) ;

       

      After changing it to:

       

      status = clEnqueueTask( myQueue, myKernel, 0, NULL, &clEvent ) ;

          clReleaseEvent ( clEvent ) ;

       

      The memory leak went away.

       

      As per the specs, when passing in NULL no event object should be created, but it clearly was in this case.

       

      I tried it on a 6950 and 280x, both using the 13.12 catalyst driver and they both have this issue.

       

      Edit:

       

      clEnqueueNDRangeKernel( myQueue, myKernel, workDims, global_work_offset,(const size_t *)global_work_size, local_work_size, 0, NULL, NULL) ;

       

      If I use this instead of clEnqueueTask it also runs into the same problem with a memory leak, which can be solved the same way.