multithreading - Can one OpenCL device host multiple users on different threads? -


we're using intel opencl 1.2 inside large commercial program, running on single intel haswell cpu/gpu. conceivably, number of threads may want use gpu different functions @ different times.

so questions:

  1. is idea @ allow multiple users single device? complications may face?

  2. i considering setting common context against device , platform users. set own programs, kernels , queues. i'm nervous device behaviour: can create non interacting silos of buffer, programs, queues, kernels , kernel args on 1 context? @ least, see clsetkernelarg not thread safe.

from personal experience, can there no problems multiple threads, using same device context, shared between threads. there ideas on it:

create multiple kernels single programm - each kernel each thread. quote khronos:

clsetkernelarg safe call host thread, , safe call re-entrantly long concurrent calls operate on different cl_kernel objects

though, creating separate command queue each thread may not reasonable - driver thread have hard time, handling many queues. may hit application performance hard.

if need marshall access shared gpu data between threads, may dice big shared opencl memory object multiple (possibly overlapped) sub-objects.

hope helps you.


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -