Oclgrind icon indicating copy to clipboard operation
Oclgrind copied to clipboard

clCreateBuffer thread safety

Open kukrimate opened this issue 2 years ago • 0 comments

By the OpenCL documentation:

All OpenCL API calls are thread-safe except clSetKernelArg. clSetKernelArg is safe to call from any host thread, and is safe to call re-entrantly so long as concurrent calls operate on different cl_kernel objects. However, the behavior of the cl_kernel object is undefined if clSetKernelArg is called from multiple host threads on the same cl_kernel object at the same time. Please note that there are additional limitations as to which OpenCL APIs may be called from OpenCL callback functions -- please see section 5.9.

oclgrind's clCreateBuffer isn't thread safe, calling it from multiple threads in an application results in heap corruption.

kukrimate avatar Mar 03 '22 11:03 kukrimate