Skip to content
This repository was archived by the owner on Feb 16, 2019. It is now read-only.

Commit 0b959a7

Browse files
committed
fixed VX_CONTEXT_CL_QUEUE_PROPERTIES
1 parent dd9ff5e commit 0b959a7

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

openvx/ago/ago_drama_alloc.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@ static int agoOptimizeDramaAllocGpuResources(AgoGraph * graph)
281281
cl_int err = -1;
282282
graph->opencl_device = context->opencl_device_list[0];
283283
#if defined(CL_VERSION_2_0)
284-
graph->opencl_cmdq = clCreateCommandQueueWithProperties(context->opencl_context, graph->opencl_device, &context->opencl_cmdq_properties, &err);
284+
cl_queue_properties properties[] = { CL_QUEUE_PROPERTIES, context->opencl_cmdq_properties, 0 };
285+
graph->opencl_cmdq = clCreateCommandQueueWithProperties(context->opencl_context, graph->opencl_device, properties, &err);
285286
#else
286287
graph->opencl_cmdq = clCreateCommandQueue(context->opencl_context, graph->opencl_device, context->opencl_cmdq_properties, &err);
287288
#endif

openvx/ago/ago_internal.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,10 +688,8 @@ struct AgoContext {
688688
char opencl_extensions[1024];
689689
#if defined(CL_VERSION_2_0)
690690
cl_device_svm_capabilities opencl_svmcaps;
691-
cl_queue_properties opencl_cmdq_properties;
692-
#else
693-
cl_command_queue_properties opencl_cmdq_properties;
694691
#endif
692+
cl_command_queue_properties opencl_cmdq_properties;
695693
cl_uint opencl_num_devices;
696694
cl_device_id opencl_device_list[16];
697695
char opencl_build_options[256];

openvx/ago/ago_util_opencl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,8 @@ int agoGpuOclCreateContext(AgoContext * context, cl_context opencl_context)
317317
#endif
318318
// create command queue for buffer sync
319319
#if defined(CL_VERSION_2_0)
320-
context->opencl_cmdq = clCreateCommandQueueWithProperties(context->opencl_context, context->opencl_device_list[device_id], &context->opencl_cmdq_properties, &status);
320+
cl_queue_properties properties[] = { CL_QUEUE_PROPERTIES, context->opencl_cmdq_properties, 0 };
321+
context->opencl_cmdq = clCreateCommandQueueWithProperties(context->opencl_context, context->opencl_device_list[device_id], properties, &status);
321322
#else
322323
context->opencl_cmdq = clCreateCommandQueue(context->opencl_context, context->opencl_device_list[device_id], context->opencl_cmdq_properties, &status);
323324
#endif

openvx/api/vx_api.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ VX_API_ENTRY vx_status VX_API_CALL vxQueryContext(vx_context context, vx_enum at
262262
}
263263
break;
264264
case VX_CONTEXT_CL_QUEUE_PROPERTIES:
265-
if (size == sizeof(vx_uint32)) {
266-
*(vx_uint32 *)ptr = context->opencl_cmdq_properties;
265+
if (size == sizeof(cl_command_queue_properties)) {
266+
*(cl_command_queue_properties *)ptr = context->opencl_cmdq_properties;
267267
status = VX_SUCCESS;
268268
}
269269
break;
@@ -364,8 +364,8 @@ VX_API_ENTRY vx_status VX_API_CALL vxSetContextAttribute(vx_context context, vx_
364364
}
365365
break;
366366
case VX_CONTEXT_CL_QUEUE_PROPERTIES:
367-
if (size == sizeof(vx_uint32)) {
368-
context->opencl_cmdq_properties = *(vx_uint32 *)ptr;
367+
if (size == sizeof(cl_command_queue_properties)) {
368+
context->opencl_cmdq_properties = *(cl_command_queue_properties *)ptr;
369369
status = VX_SUCCESS;
370370
}
371371
break;

openvx/include/vx_ext_amd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ enum vx_context_attribute_amd_e {
9797
VX_CONTEXT_ATTRIBUTE_AMD_SET_MERGE_RULE = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_CONTEXT) + 0x04,
9898
/*! \brief tensor Data max num of dimensions supported by HW. */
9999
VX_CONTEXT_MAX_TENSOR_DIMENSIONS = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_CONTEXT) + 0x05,
100-
/*! \brief CL_QUEUE_PROPERTIES to be used for creating OpenCL command queue. Use a <tt>\ref vx_uint32</tt> parameter. */
100+
/*! \brief CL_QUEUE_PROPERTIES to be used for creating OpenCL command queue. Use a <tt>\ref cl_command_queue_properties</tt> parameter. */
101101
VX_CONTEXT_CL_QUEUE_PROPERTIES = VX_ATTRIBUTE_BASE(VX_ID_AMD, VX_TYPE_CONTEXT) + 0x06,
102102
};
103103

0 commit comments

Comments
 (0)