Ask Your Question

Revision history [back]

OpenCV 3.0 - T-API (transparant OpenCL acceleration) CPU-thread-safe ??

In OpenCV 3.0 (http://opencv.org/opencv-3-0.html), there is the so-called T-API introducted, where functions are accelerated, transparently for the user, on the GPU with OpenCL.

I just wonder whether that is safe, when i have several CPU threads, each calling a OpenCV function which under the hood is accelerated with OpenCL ?

So, in short, are the 'accelerated' OpenCV functions STILL CPU-THREAD-SAFE ? Are the OpenCV functions tested in a test suite with respect to CPU-thread-safety ?

I have my doubts, because e.g. for NVIDIA NPP functions i conservatively assume that they are NOT CPU-thread safe, because i cannot know whether they internall use stuff like constant memory, texture references which per se are not cpu-trhead-safe. Regarding NPP and thread-safety, see e.g. https://devtalk.nvidia.com/default/topic/534966/can-npp-be-safely-used-in-multi-threaded-code-/

Maybe someone can provide more information, or a better guess.

As in our application stability goes over performance, if there are any doubts we would have to disable the T-API when building OpenCV 3.0 for us.