summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2012-03-13 11:09:22 -0400
committerTom Stellard <thomas.stellard@amd.com>2012-03-13 11:09:53 -0400
commitd290aedf15294fc815746fe9c2931fe153c708b1 (patch)
tree08f6c1b0a5d87724dd3a2deb40bb228a26192f00 /util.c
parent8cc71da413c5966ff94f016f718110057129d503 (diff)
Add cluCreateCommandQueue()
Diffstat (limited to 'util.c')
-rw-r--r--util.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/util.c b/util.c
index 3c0339d..e85bda1 100644
--- a/util.c
+++ b/util.c
@@ -106,6 +106,23 @@ unsigned cluCreateContext(cl_context * context, cl_device_id device_id)
return 1;
}
+unsigned cluCreateCommandQueue(cl_command_queue * command_queue,
+ cl_context context, cl_device_id device_id)
+{
+ cl_int error;
+ *command_queue = clCreateCommandQueue(context,
+ device_id,
+ 0, /* Command queue properties */
+ &error); /* Error code */
+
+ if (error != CL_SUCCESS) {
+ fprintf(stderr, "clCreateCommandQueue() failed: %s\n",
+ cluErrorString(error));
+ return 0;
+ }
+ return 1;
+}
+
#define CODE_CHUNK 64
unsigned cluCreateKernel(cl_context context, cl_device_id device_id,