【发布时间】:2017-08-19 04:46:40
【问题描述】:
在英特尔 opencl 2.0 教程资源Sierpiński Carpet 中,他们使用了在 opencl 2.0 中添加的设备端入队属性。在源码中,有这样一段:
// You need to create device side queue for enqueue_kernel to work
// We set the device side queue to 16MB, since we are going to have a large
// number of enqueues
cl_queue_properties qprop[] = {CL_QUEUE_SIZE, 16*1024*1024,
CL_QUEUE_PROPERTIES,
(cl_command_queue_properties)CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE |
CL_QUEUE_ON_DEVICE | CL_QUEUE_ON_DEVICE_DEFAULT, 0};
cl_command_queue my_device_q =
clCreateCommandQueueWithProperties(CLU_CONTEXT,
cluGetDevice(CL_DEVICE_TYPE_GPU), qprop, &status);
现在想用pyopencl重写python中的代码来学习动态并行的方法。但是我找不到任何指令来设置队列大小,如代码所示。 CommandQueue API 有 properties 选项,但在文档中这些选项/值不包括 size。
有什么建议吗?
【问题讨论】: