From fc5f430cb7b7a8f694d86acbb038bd5b38ec389c Mon Sep 17 00:00:00 2001 From: "Rebecca N. Palmer" Date: Sat, 21 Jul 2018 20:25:38 +0100 Subject: Allow creating out-of-order queues with clCreateCommandQueue clCreateCommandQueueWithProperties can already create them, but that's a 2.0 function. Signed-off-by: Rebecca N. Palmer Reviewed-by: Yang Rong --- src/cl_api_command_queue.c | 34 +++++----------------------------- 1 file 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. */ -- cgit v1.2.1