5. The OpenCL Runtime OpenCL objects: memory objects, program objects, kernel objects, command-queues, others? 5.1 Command Queues use context to create memory, program, kernel objects, and operations on these objects are performed using a
5. The OpenCL Runtime
OpenCL objects: memory objects, program objects, kernel objects, command-queues, others?
5.1 Command Queues
use context to create memory, program, kernel objects, and operations on these objects are performed using a *command-queue*.
One application can have multiple command-queues to queue indepedent commands without requiring synchronization, but if objects are shared, i.e., across multiple command-queues, the application needs synchronization.
clCreateCommandQueue
注意:参数cl_command_queue_properties:
(1) cl_queue_out_of_order_exec_mode_enable:queue中的command顺序执行还是乱序执行,顺序执行在command queue中隐式加入同步命令
(2) cl_queue_profiling_enable: profiling of commands
clRetainCommandQueue: increments the command_queue reference count
clReleaseCommandQueue: decrements the command_queue reference count
clGetCommandQueueInfo: query info about a command_queue
clSetCommandQueueProperty: change command_queue properties,很明显在属性变化时有一个Flush的动作,expensive
这一节最后提到Device Lost的情况,操作系统会通知驱动,Spec说可以通过创建Context时注册的回调函数来记录。