OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.

Usage of "cl_cache" for multiple instance/thread

Hyun-Kyu_L_Intel
Employee
903 Views

Hi team,

I'm using "cl_cache" method to reduce model loading time for GPU backend case, and wonder whether we can get benefit of using "cl_cache" for following case, too.

Case #1: Single thread operation and creating multiple instances: Can 2nd/3rd/.. instances use cl_cache created by 1st instances to reduce model loading time?

Case #2: Multiple thread operation: Can 2nd/3rd./.. thread use cl_cache created by 1st thread?

Thank you.

0 Kudos
2 Replies
Hyun-Kyu_L_Intel
Employee
903 Views

Dear team,

Can anyone help me here?

0 Kudos
Michal_M_Intel
Employee
903 Views

Hello,

Here is faq explaining current limitations:

https://github.com/intel/compute-runtime/blob/master/opencl/doc/FAQ.md

In general cl_cache is not thread safe.

If you synchronize your application properly , you may use cl_cache populated from thread #1 in other threads.

Generally cl_cache has thread safety issues while it is being populated, if you do one threaded run of your application that populates the whole cl_cache, then for subsequent runs you should be able to read it from multiple threads without locks.

 

0 Kudos
Reply