1 #ifndef CL_USE_DEPRECATED_OPENCL_1_1_APIS
2 #define CL_USE_DEPRECATED_OPENCL_1_1_APIS
5 #ifndef CL_USE_DEPRECATED_OPENCL_1_2_APIS
6 #define CL_USE_DEPRECATED_OPENCL_1_2_APIS
10 #include "param_struct.h"
11 #include <platform/icd_test_log.h>
13 extern cl_kernel kernel;
14 extern cl_event event;
15 extern cl_context context;
16 extern cl_command_queue command_queue;
17 extern cl_device_id devices;
19 extern void CL_CALLBACK setevent_callback(cl_event _a, cl_int _b, void* _c);
20 extern void CL_CALLBACK setprintf_callback(cl_context _a, cl_uint _b, char* _c, void* _d );
22 struct clRetainKernel_st clRetainKernelData[NUM_ITEMS_clRetainKernel] =
27 int test_clRetainKernel(const struct clRetainKernel_st* data)
29 test_icd_app_log("clRetainKernel(%p)\n", kernel);
31 ret_val=clRetainKernel(kernel);
33 test_icd_app_log("Value returned: %d\n", ret_val);
38 struct clSetKernelArg_st clSetKernelArgData[NUM_ITEMS_clSetKernelArg] =
43 int test_clSetKernelArg(const struct clSetKernelArg_st* data)
45 test_icd_app_log("clSetKernelArg(%p, %u, %u, %p)\n",
51 ret_val=clSetKernelArg(kernel,
56 test_icd_app_log("Value returned: %d\n", ret_val);
61 struct clGetKernelInfo_st clGetKernelInfoData[NUM_ITEMS_clGetKernelInfo] =
63 {NULL, 0, 0, NULL, NULL}
66 int test_clGetKernelInfo(const struct clGetKernelInfo_st* data)
68 test_icd_app_log("clGetKernelInfo(%p, %u, %u, %p, %p)\n",
71 data->param_value_size,
73 data->param_value_size_ret);
75 ret_val=clGetKernelInfo(kernel,
77 data->param_value_size,
79 data->param_value_size_ret);
81 test_icd_app_log("Value returned: %d\n", ret_val);
86 struct clGetKernelArgInfo_st clGetKernelArgInfoData[NUM_ITEMS_clGetKernelArgInfo] =
88 {NULL, 0, 0, 0, NULL, NULL}
91 int test_clGetKernelArgInfo(const struct clGetKernelArgInfo_st* data)
93 test_icd_app_log("clGetKernelArgInfo(%p, %u, %u, %u, %p, %p)\n",
97 data->param_value_size,
99 data->param_value_size_ret);
101 ret_val=clGetKernelArgInfo(kernel,
104 data->param_value_size,
106 data->param_value_size_ret);
108 test_icd_app_log("Value returned: %d\n", ret_val);
113 struct clGetKernelWorkGroupInfo_st clGetKernelWorkGroupInfoData[NUM_ITEMS_clGetKernelWorkGroupInfo] =
115 {NULL, NULL, 0, 0, NULL, NULL}
118 int test_clGetKernelWorkGroupInfo(const struct clGetKernelWorkGroupInfo_st* data)
120 test_icd_app_log("clGetKernelWorkGroupInfo(%p, %p, %u, %u, %p, %p)\n",
124 data->param_value_size,
126 data->param_value_size_ret);
128 ret_val=clGetKernelWorkGroupInfo(kernel,
131 data->param_value_size,
133 data->param_value_size_ret);
135 test_icd_app_log("Value returned: %d\n", ret_val);
140 struct clEnqueueMigrateMemObjects_st clEnqueueMigrateMemObjectsData[NUM_ITEMS_clEnqueueMigrateMemObjects] =
142 {NULL, 0, NULL, 0x0, 0, NULL, NULL}
145 int test_clEnqueueMigrateMemObjects(const struct clEnqueueMigrateMemObjects_st* data)
147 test_icd_app_log("clEnqueueMigrateMemObjects(%p, %u, %p, %x, %u, %p, %p)\n",
149 data->num_mem_objects,
152 data->num_events_in_wait_list,
153 data->event_wait_list,
156 ret_val=clEnqueueMigrateMemObjects(command_queue,
157 (cl_uint)data->num_mem_objects,
160 data->num_events_in_wait_list,
161 data->event_wait_list,
164 test_icd_app_log("Value returned: %d\n", ret_val);
169 struct clEnqueueNDRangeKernel_st clEnqueueNDRangeKernelData[NUM_ITEMS_clEnqueueNDRangeKernel] =
171 {NULL, NULL, 0, NULL, NULL, NULL, 0, NULL}
174 int test_clEnqueueNDRangeKernel(const struct clEnqueueNDRangeKernel_st* data)
176 test_icd_app_log("clEnqueueNDRangeKernel(%p, %p, %u, %p, %p, %p, %u, %p, %p)\n",
180 data->global_work_offset,
181 data->global_work_size,
182 data->local_work_size,
183 data->num_events_in_wait_list,
184 data->event_wait_list,
187 ret_val=clEnqueueNDRangeKernel(command_queue,
190 data->global_work_offset,
191 data->global_work_size,
192 data->local_work_size,
193 data->num_events_in_wait_list,
194 data->event_wait_list,
197 test_icd_app_log("Value returned: %d\n", ret_val);
202 struct clEnqueueTask_st clEnqueueTaskData[NUM_ITEMS_clEnqueueTask] =
204 {NULL, NULL, 0, NULL, NULL}
207 int test_clEnqueueTask(const struct clEnqueueTask_st* data)
209 test_icd_app_log("clEnqueueTask(%p, %p, %u, %p, %p)\n",
212 data->num_events_in_wait_list,
213 data->event_wait_list,
216 ret_val=clEnqueueTask(command_queue,
218 data->num_events_in_wait_list,
219 data->event_wait_list,
222 test_icd_app_log("Value returned: %d\n", ret_val);
226 struct clEnqueueNativeKernel_st clEnqueueNativeKernelData[NUM_ITEMS_clEnqueueNativeKernel] =
228 {NULL, NULL, NULL, 0, 0, NULL, NULL, 0, NULL, NULL}
231 int test_clEnqueueNativeKernel(const struct clEnqueueNativeKernel_st* data) {
232 test_icd_app_log("clEnqueueNativeKernel(%p, %p, %p, %u, %u, %p, %p, %u, %p, %p)\n",
237 data->num_mem_objects,
240 data->num_events_in_wait_list,
241 data->event_wait_list,
244 ret_val=clEnqueueNativeKernel(command_queue,
248 data->num_mem_objects,
251 data->num_events_in_wait_list,
252 data->event_wait_list,
255 test_icd_app_log("Value returned: %d\n", ret_val);
259 struct clSetUserEventStatus_st clSetUserEventStatusData[NUM_ITEMS_clSetUserEventStatus] =
264 int test_clSetUserEventStatus(const struct clSetUserEventStatus_st* data)
266 test_icd_app_log("clSetUserEventStatus(%p, %d)\n",
268 data->execution_status);
270 ret_val=clSetUserEventStatus(event,
271 data->execution_status);
273 test_icd_app_log("Value returned: %d\n", ret_val);
277 struct clWaitForEvents_st clWaitForEventsData[NUM_ITEMS_clWaitForEvents] =
282 int test_clWaitForEvents(const struct clWaitForEvents_st* data)
284 test_icd_app_log("clWaitForEvents(%u, %p)\n",
288 ret_val=clWaitForEvents(data->num_events,
291 test_icd_app_log("Value returned: %d\n", ret_val);
295 struct clGetEventInfo_st clGetEventInfoData[NUM_ITEMS_clGetEventInfo] =
297 {NULL, 0, 0, NULL, NULL}
300 int test_clGetEventInfo(const struct clGetEventInfo_st* data){
301 test_icd_app_log("clGetEventInfo(%p, %u, %u, %p, %p)\n",
304 data->param_value_size,
306 data->param_value_size_ret);
308 ret_val=clGetEventInfo(event,
310 data->param_value_size,
312 data->param_value_size_ret);
314 test_icd_app_log("Value returned: %d\n", ret_val);
319 struct clSetEventCallback_st clSetEventCallbackData[NUM_ITEMS_clSetEventCallback] =
321 {NULL, 0, setevent_callback, NULL}
324 int test_clSetEventCallback(const struct clSetEventCallback_st* data)
326 test_icd_app_log("clSetEventCallback(%p, %d, %p, %p)\n",
328 data->command_exec_callback_type,
329 data->pfn_event_notify,
332 ret_val=clSetEventCallback(event,
333 data->command_exec_callback_type,
334 data->pfn_event_notify,
337 test_icd_app_log("Value returned: %d\n", ret_val);
341 struct clRetainEvent_st clRetainEventData[NUM_ITEMS_clRetainEvent] =
346 int test_clRetainEvent(const struct clRetainEvent_st* data)
348 test_icd_app_log("clRetainEvent(%p)\n", event);
350 ret_val=clRetainEvent(event);
352 test_icd_app_log("Value returned: %d\n", ret_val);
357 struct clEnqueueMarker_st clEnqueueMarkerData[NUM_ITEMS_clEnqueueMarker] =
362 int test_clEnqueueMarker(const struct clEnqueueMarker_st* data)
364 test_icd_app_log("clEnqueueMarker(%p, %p)\n", command_queue, &event);
366 ret_val = clEnqueueMarker(command_queue, &event);
368 test_icd_app_log("Value returned: %d\n", ret_val);
373 struct clEnqueueMarkerWithWaitList_st clEnqueueMarkerWithWaitListData[NUM_ITEMS_clEnqueueMarkerWithWaitList] =
375 {NULL, 0, NULL, NULL}
378 int test_clEnqueueMarkerWithWaitList(const struct clEnqueueMarkerWithWaitList_st* data)
380 test_icd_app_log("clEnqueueMarkerWithWaitList(%p, %u, %p, %p)\n",
382 data->num_events_in_wait_list,
383 data->event_wait_list,
386 ret_val=clEnqueueMarkerWithWaitList(command_queue,
387 data->num_events_in_wait_list,
388 data->event_wait_list,
391 test_icd_app_log("Value returned: %d\n", ret_val);
396 struct clEnqueueBarrierWithWaitList_st clEnqueueBarrierWithWaitListData[NUM_ITEMS_clEnqueueBarrierWithWaitList] =
398 {NULL, 0, NULL, NULL}
400 int test_clEnqueueBarrierWithWaitList(const struct clEnqueueBarrierWithWaitList_st* data)
402 test_icd_app_log("clEnqueueBarrierWithWaitList(%p, %u, %p, %p)\n",
404 data->num_events_in_wait_list,
405 data->event_wait_list,
408 ret_val=clEnqueueBarrierWithWaitList(command_queue,
409 data->num_events_in_wait_list,
410 data->event_wait_list,
413 test_icd_app_log("Value returned: %d\n", ret_val);
418 struct clEnqueueWaitForEvents_st clEnqueueWaitForEventsData[NUM_ITEMS_clEnqueueWaitForEvents] =
423 int test_clEnqueueWaitForEvents(const struct clEnqueueWaitForEvents_st* data)
425 test_icd_app_log("clEnqueueWaitForEvents(%p, %u, %p)\n",
430 ret_val = clEnqueueWaitForEvents(command_queue,
434 test_icd_app_log("Value returned: %d\n", ret_val);
439 struct clEnqueueBarrier_st clEnqueueBarrierData[NUM_ITEMS_clEnqueueBarrier] =
444 int test_clEnqueueBarrier(const struct clEnqueueBarrier_st* data)
446 test_icd_app_log("clEnqueueBarrier(%p)\n", command_queue);
448 ret_val = clEnqueueBarrier(command_queue);
450 test_icd_app_log("Value returned: %d\n", ret_val);
454 struct clGetEventProfilingInfo_st clGetEventProfilingInfoData[NUM_ITEMS_clGetEventProfilingInfo] =
456 {NULL, 0, 0, NULL, NULL}
459 int test_clGetEventProfilingInfo(const struct clGetEventProfilingInfo_st* data)
461 test_icd_app_log("clGetEventProfilingInfo(%p, %u, %u, %p, %p)\n",
464 data->param_value_size,
466 data->param_value_size_ret);
468 ret_val=clGetEventProfilingInfo(event,
470 data->param_value_size,
472 data->param_value_size_ret);
474 test_icd_app_log("Value returned: %d\n", ret_val);
479 struct clFlush_st clFlushData[NUM_ITEMS_clFlush] =
484 int test_clFlush(const struct clFlush_st* data)
486 test_icd_app_log("clFlush(%p)\n", command_queue);
488 ret_val=clFlush(command_queue);
490 test_icd_app_log("Value returned: %d\n", ret_val);
495 struct clFinish_st clFinishData[NUM_ITEMS_clFinish] =
500 int test_clFinish(const struct clFinish_st* data)
502 test_icd_app_log("clFinish(%p)\n", command_queue);
504 ret_val=clFinish(command_queue);
506 test_icd_app_log("Value returned: %d\n", ret_val);
515 for (i=0; i<NUM_ITEMS_clRetainKernel; i++) {
516 test_clRetainKernel(&clRetainKernelData[i]);
519 for (i=0; i<NUM_ITEMS_clSetKernelArg; i++) {
520 test_clSetKernelArg(&clSetKernelArgData[i]);
523 for (i=0; i<NUM_ITEMS_clGetKernelInfo; i++) {
524 test_clGetKernelInfo(&clGetKernelInfoData[i]);
527 for (i=0; i<NUM_ITEMS_clGetKernelArgInfo; i++) {
528 test_clGetKernelArgInfo(&clGetKernelArgInfoData[i]);
531 for (i=0; i<NUM_ITEMS_clGetKernelWorkGroupInfo; i++) {
532 test_clGetKernelWorkGroupInfo(&clGetKernelWorkGroupInfoData[i]);
535 for (i=0; i<NUM_ITEMS_clEnqueueMigrateMemObjects; i++) {
536 test_clEnqueueMigrateMemObjects(&clEnqueueMigrateMemObjectsData[i]);
539 for (i=0; i<NUM_ITEMS_clEnqueueNDRangeKernel; i++) {
540 test_clEnqueueNDRangeKernel(&clEnqueueNDRangeKernelData[i]);
543 for (i=0; i<NUM_ITEMS_clEnqueueTask; i++) {
544 test_clEnqueueTask(&clEnqueueTaskData[i]);
547 for (i=0; i<NUM_ITEMS_clEnqueueNativeKernel; i++) {
548 test_clEnqueueNativeKernel(&clEnqueueNativeKernelData[i]);
551 for (i=0; i<NUM_ITEMS_clSetUserEventStatus; i++) {
552 test_clSetUserEventStatus(&clSetUserEventStatusData[i]);
555 for (i=0; i<NUM_ITEMS_clWaitForEvents; i++) {
556 test_clWaitForEvents(&clWaitForEventsData[i]);
559 for (i=0; i<NUM_ITEMS_clGetEventInfo; i++) {
560 test_clGetEventInfo(&clGetEventInfoData[i]);
563 for (i=0; i<NUM_ITEMS_clSetEventCallback; i++) {
564 test_clSetEventCallback(&clSetEventCallbackData[i]);
567 for (i=0; i<NUM_ITEMS_clRetainEvent; i++) {
568 test_clRetainEvent(&clRetainEventData[i]);
571 for (i=0; i<NUM_ITEMS_clEnqueueMarker; i++) {
572 test_clEnqueueMarker(&clEnqueueMarkerData[i]);
575 for (i=0; i<NUM_ITEMS_clEnqueueBarrier; i++) {
576 test_clEnqueueBarrier(&clEnqueueBarrierData[i]);
579 for (i=0; i<NUM_ITEMS_clEnqueueMarkerWithWaitList; i++) {
580 test_clEnqueueMarkerWithWaitList(&clEnqueueMarkerWithWaitListData[i]);
583 for (i=0; i<NUM_ITEMS_clEnqueueBarrierWithWaitList; i++) {
584 test_clEnqueueBarrierWithWaitList(&clEnqueueBarrierWithWaitListData[i]);
587 for (i=0; i<NUM_ITEMS_clGetEventProfilingInfo; i++) {
588 test_clGetEventProfilingInfo(&clGetEventProfilingInfoData[i]);
591 for (i=0; i<NUM_ITEMS_clFlush; i++) {
592 test_clFlush(&clFlushData[i]);
595 for (i=0; i<NUM_ITEMS_clFinish; i++) {
596 test_clFinish(&clFinishData[i]);