diff options
author | Rebecca N. Palmer <rebecca_palmer@zoho.com> | 2018-07-21 20:25:38 +0100 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2018-08-20 15:32:19 +0800 |
commit | fc5f430cb7b7a8f694d86acbb038bd5b38ec389c (patch) | |
tree | 37185a47d29dd8d76f720b580a71817b73e715a5 | |
parent | ab45f14f1e552a5d8b300b2bf5b7bdbed525110c (diff) |
clCreateCommandQueueWithProperties can already create them, but
that's a 2.0 function.
Signed-off-by: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
-rw-r--r-- | src/cl_api_command_queue.c | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/src/cl_api_command_queue.c b/src/cl_api_command_queue.c index b1aee128..3fdfbc6e 100644 --- a/src/cl_api_command_queue.c +++ b/src/cl_api_command_queue.c @@ -27,35 +27,11 @@ clCreateCommandQueue(cl_context context, cl_command_queue_properties properties, cl_int *errcode_ret) { - cl_command_queue queue = NULL; - cl_int err = CL_SUCCESS; - - do { - if (!CL_OBJECT_IS_CONTEXT(context)) { - err = CL_INVALID_CONTEXT; - break; - } - - err = cl_devices_list_include_check(context->device_num, context->devices, 1, &device); - if (err) - break; - - if (properties & ~(CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_PROFILING_ENABLE)) { - err = CL_INVALID_VALUE; - break; - } - - if (properties & CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE) { /*not supported now.*/ - err = CL_INVALID_QUEUE_PROPERTIES; - break; - } - - queue = cl_create_command_queue(context, device, properties, 0, &err); - } while (0); - - if (errcode_ret) - *errcode_ret = err; - return queue; + cl_queue_properties props[3]; + props[0] = CL_QUEUE_PROPERTIES; + props[1] = properties; + props[2] = 0; + return clCreateCommandQueueWithProperties(context, device, props, errcode_ret); } /* 2.0 new API for create command queue. */ |