diff options
Diffstat (limited to 'src/gallium/state_trackers/clover/api/queue.cpp')
-rw-r--r-- | src/gallium/state_trackers/clover/api/queue.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/clover/api/queue.cpp b/src/gallium/state_trackers/clover/api/queue.cpp index 8e500fa03ed..ba459250f94 100644 --- a/src/gallium/state_trackers/clover/api/queue.cpp +++ b/src/gallium/state_trackers/clover/api/queue.cpp @@ -26,15 +26,13 @@ using namespace clover; PUBLIC cl_command_queue -clCreateCommandQueue(cl_context ctx, cl_device_id d_dev, +clCreateCommandQueue(cl_context d_ctx, cl_device_id d_dev, cl_command_queue_properties props, cl_int *errcode_ret) try { + auto &ctx = obj(d_ctx); auto &dev = obj(d_dev); - if (!ctx) - throw error(CL_INVALID_CONTEXT); - - if (!ctx->has_device(&dev)) + if (!ctx.has_device(dev)) throw error(CL_INVALID_DEVICE); if (props & ~(CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | @@ -42,7 +40,7 @@ clCreateCommandQueue(cl_context ctx, cl_device_id d_dev, throw error(CL_INVALID_VALUE); ret_error(errcode_ret, CL_SUCCESS); - return new command_queue(*ctx, dev, props); + return new command_queue(ctx, dev, props); } catch (error &e) { ret_error(errcode_ret, e); |