summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuiling Song <ruiling.song@intel.com>2013-06-13 09:40:16 +0800
committerZhigang Gong <zhigang.gong@linux.intel.com>2013-06-14 17:00:50 +0800
commitba0dce30aee509d76f3e4e7793516ae61329abca (patch)
treed2bd5511388ad13f2eac781c04fe08f76b32307c /src
parent018c62908da4cea499477d166f302da28d4fb31d (diff)
downloadbeignet-ba0dce30aee509d76f3e4e7793516ae61329abca.tar.gz
Refine error check in clCreateCommandQueue()
Signed-off-by: Ruiling Song <ruiling.song@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/cl_api.c9
-rw-r--r--src/cl_context.c5
2 files changed, 10 insertions, 4 deletions
diff --git a/src/cl_api.c b/src/cl_api.c
index a813c65a..fd707e5c 100644
--- a/src/cl_api.c
+++ b/src/cl_api.c
@@ -287,6 +287,15 @@ clCreateCommandQueue(cl_context context,
cl_command_queue queue = NULL;
cl_int err = CL_SUCCESS;
CHECK_CONTEXT (context);
+
+ INVALID_DEVICE_IF (device != context->device);
+ INVALID_VALUE_IF (properties & ~(CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_PROFILING_ENABLE));
+
+ if(properties) {
+ err = CL_INVALID_QUEUE_PROPERTIES;
+ goto error;
+ }
+
queue = cl_context_create_queue(context, device, properties, &err);
error:
if (errcode_ret)
diff --git a/src/cl_context.c b/src/cl_context.c
index 6cde9884..fa4c7e04 100644
--- a/src/cl_context.c
+++ b/src/cl_context.c
@@ -192,10 +192,7 @@ cl_context_create_queue(cl_context ctx,
cl_command_queue queue = NULL;
cl_int err = CL_SUCCESS;
- if (UNLIKELY(device != ctx->device)) {
- err = CL_INVALID_DEVICE;
- goto error;
- }
+
/* We create the command queue and store it in the context list of queues */
TRY_ALLOC (queue, cl_command_queue_new(ctx));