Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
31 Views

Bug report: clCreateKernelsInProgram is not thread-safe

When invoking clCreateKernelsInProgram to the same cl_program from many different threads. The Intel OpenCL runtime will randomly raise a CL_INVALID_VALUE error.

0 Kudos
2 Replies
Highlighted
Beginner
31 Views

It should be thread safe according to OpenCL specification appendix A.2 ("Multiple Host Threads")

 

All OpenCL API calls are thread-safe except clSetKernelArg.

0 Kudos
Highlighted
31 Views

Hi YangB,

Thanks for your sighting.

  • Which OCL runtime are you using and for which platform? Can you identify the version and/or install package you used?
  • If you're using a runtime that leverages ocl spec >= 2.0 it's slightly different, if read extremely strictly the spec's section A.2 suggests any function that modifies the state of cl_kernel objects is not thread safe.
  • ​Can you give a minimal reproducer to demonstrate the issue? (While staying away from unsharable code of course?)

Thanks,

-MichaelC

0 Kudos