@@ -159,6 +159,20 @@ static inline cl_platform_id _get_platform(cl_mem memobj)
159
159
return _get_platform (context);
160
160
}
161
161
162
+ static inline cl_platform_id _get_platform (cl_event event)
163
+ {
164
+ if (event == nullptr ) return nullptr ;
165
+
166
+ cl_context context = nullptr ;
167
+ clGetEventInfo (
168
+ event,
169
+ CL_EVENT_CONTEXT,
170
+ sizeof (context),
171
+ &context,
172
+ nullptr );
173
+ return _get_platform (context);
174
+ }
175
+
162
176
/* **************************************************************
163
177
* Function Pointer Typedefs
164
178
***************************************************************/
@@ -311,6 +325,29 @@ typedef cl_int (CL_API_CALL* clGetCommandBufferInfoKHR_clextfn)(
311
325
void * param_value,
312
326
size_t * param_value_size_ret);
313
327
328
+ typedef cl_int (CL_API_CALL* clCommandSVMMemcpyKHR_clextfn)(
329
+ cl_command_buffer_khr command_buffer,
330
+ cl_command_queue command_queue,
331
+ void * dst_ptr,
332
+ const void * src_ptr,
333
+ size_t size,
334
+ cl_uint num_sync_points_in_wait_list,
335
+ const cl_sync_point_khr* sync_point_wait_list,
336
+ cl_sync_point_khr* sync_point,
337
+ cl_mutable_command_khr* mutable_handle);
338
+
339
+ typedef cl_int (CL_API_CALL* clCommandSVMMemFillKHR_clextfn)(
340
+ cl_command_buffer_khr command_buffer,
341
+ cl_command_queue command_queue,
342
+ void * svm_ptr,
343
+ const void * pattern,
344
+ size_t pattern_size,
345
+ size_t size,
346
+ cl_uint num_sync_points_in_wait_list,
347
+ const cl_sync_point_khr* sync_point_wait_list,
348
+ cl_sync_point_khr* sync_point,
349
+ cl_mutable_command_khr* mutable_handle);
350
+
314
351
#else
315
352
#pragma message("Define for cl_khr_command_buffer was not found! Please update your headers.")
316
353
#endif // defined(cl_khr_command_buffer)
@@ -590,6 +627,17 @@ typedef cl_int (CL_API_CALL* clGetSemaphoreHandleForTypeKHR_clextfn)(
590
627
#pragma message("Define for cl_khr_external_semaphore was not found! Please update your headers.")
591
628
#endif // defined(cl_khr_external_semaphore)
592
629
630
+ #if defined(cl_khr_external_semaphore_sync_fd)
631
+
632
+ typedef cl_int (CL_API_CALL* clReImportSemaphoreSyncFdKHR_clextfn)(
633
+ cl_semaphore_khr sema_object,
634
+ cl_semaphore_reimport_properties_khr* reimport_props,
635
+ int fd);
636
+
637
+ #else
638
+ #pragma message("Define for cl_khr_external_semaphore_sync_fd was not found! Please update your headers.")
639
+ #endif // defined(cl_khr_external_semaphore_sync_fd)
640
+
593
641
#if defined(CLEXT_INCLUDE_GL)
594
642
#if defined(cl_khr_gl_event)
595
643
@@ -835,6 +883,16 @@ typedef cl_int (CL_API_CALL* clSetKernelExecInfoARM_clextfn)(
835
883
#pragma message("Define for cl_arm_shared_virtual_memory was not found! Please update your headers.")
836
884
#endif // defined(cl_arm_shared_virtual_memory)
837
885
886
+ #if defined(cl_img_cancel_command)
887
+
888
+ typedef cl_int (CL_API_CALL* clCancelCommandsIMG_clextfn)(
889
+ const cl_event* event_list,
890
+ size_t num_events_in_list);
891
+
892
+ #else
893
+ #pragma message("Define for cl_img_cancel_command was not found! Please update your headers.")
894
+ #endif // defined(cl_img_cancel_command)
895
+
838
896
#if defined(cl_img_generate_mipmap)
839
897
840
898
typedef cl_int (CL_API_CALL* clEnqueueGenerateMipmapIMG_clextfn)(
@@ -1269,6 +1327,8 @@ struct openclext_dispatch_table {
1269
1327
clCommandFillImageKHR_clextfn clCommandFillImageKHR;
1270
1328
clCommandNDRangeKernelKHR_clextfn clCommandNDRangeKernelKHR;
1271
1329
clGetCommandBufferInfoKHR_clextfn clGetCommandBufferInfoKHR;
1330
+ clCommandSVMMemcpyKHR_clextfn clCommandSVMMemcpyKHR;
1331
+ clCommandSVMMemFillKHR_clextfn clCommandSVMMemFillKHR;
1272
1332
#endif // defined(cl_khr_command_buffer)
1273
1333
1274
1334
#if defined(cl_khr_command_buffer_multi_device)
@@ -1338,6 +1398,10 @@ struct openclext_dispatch_table {
1338
1398
clGetSemaphoreHandleForTypeKHR_clextfn clGetSemaphoreHandleForTypeKHR;
1339
1399
#endif // defined(cl_khr_external_semaphore)
1340
1400
1401
+ #if defined(cl_khr_external_semaphore_sync_fd)
1402
+ clReImportSemaphoreSyncFdKHR_clextfn clReImportSemaphoreSyncFdKHR;
1403
+ #endif // defined(cl_khr_external_semaphore_sync_fd)
1404
+
1341
1405
#if defined(CLEXT_INCLUDE_GL)
1342
1406
#if defined(cl_khr_gl_event)
1343
1407
clCreateEventFromGLsyncKHR_clextfn clCreateEventFromGLsyncKHR;
@@ -1399,6 +1463,10 @@ struct openclext_dispatch_table {
1399
1463
clSetKernelExecInfoARM_clextfn clSetKernelExecInfoARM;
1400
1464
#endif // defined(cl_arm_shared_virtual_memory)
1401
1465
1466
+ #if defined(cl_img_cancel_command)
1467
+ clCancelCommandsIMG_clextfn clCancelCommandsIMG;
1468
+ #endif // defined(cl_img_cancel_command)
1469
+
1402
1470
#if defined(cl_img_generate_mipmap)
1403
1471
clEnqueueGenerateMipmapIMG_clextfn clEnqueueGenerateMipmapIMG;
1404
1472
#endif // defined(cl_img_generate_mipmap)
@@ -1535,6 +1603,8 @@ static void _init(cl_platform_id platform, openclext_dispatch_table* dispatch_pt
1535
1603
CLEXT_GET_EXTENSION (clCommandFillImageKHR);
1536
1604
CLEXT_GET_EXTENSION (clCommandNDRangeKernelKHR);
1537
1605
CLEXT_GET_EXTENSION (clGetCommandBufferInfoKHR);
1606
+ CLEXT_GET_EXTENSION (clCommandSVMMemcpyKHR);
1607
+ CLEXT_GET_EXTENSION (clCommandSVMMemFillKHR);
1538
1608
#endif // defined(cl_khr_command_buffer)
1539
1609
1540
1610
#if defined(cl_khr_command_buffer_multi_device)
@@ -1604,6 +1674,10 @@ static void _init(cl_platform_id platform, openclext_dispatch_table* dispatch_pt
1604
1674
CLEXT_GET_EXTENSION (clGetSemaphoreHandleForTypeKHR);
1605
1675
#endif // defined(cl_khr_external_semaphore)
1606
1676
1677
+ #if defined(cl_khr_external_semaphore_sync_fd)
1678
+ CLEXT_GET_EXTENSION (clReImportSemaphoreSyncFdKHR);
1679
+ #endif // defined(cl_khr_external_semaphore_sync_fd)
1680
+
1607
1681
#if defined(CLEXT_INCLUDE_GL)
1608
1682
#if defined(cl_khr_gl_event)
1609
1683
CLEXT_GET_EXTENSION (clCreateEventFromGLsyncKHR);
@@ -1665,6 +1739,10 @@ static void _init(cl_platform_id platform, openclext_dispatch_table* dispatch_pt
1665
1739
CLEXT_GET_EXTENSION (clSetKernelExecInfoARM);
1666
1740
#endif // defined(cl_arm_shared_virtual_memory)
1667
1741
1742
+ #if defined(cl_img_cancel_command)
1743
+ CLEXT_GET_EXTENSION (clCancelCommandsIMG);
1744
+ #endif // defined(cl_img_cancel_command)
1745
+
1668
1746
#if defined(cl_img_generate_mipmap)
1669
1747
CLEXT_GET_EXTENSION (clEnqueueGenerateMipmapIMG);
1670
1748
#endif // defined(cl_img_generate_mipmap)
@@ -2391,6 +2469,62 @@ cl_int CL_API_CALL clGetCommandBufferInfoKHR(
2391
2469
param_value_size_ret);
2392
2470
}
2393
2471
2472
+ cl_int CL_API_CALL clCommandSVMMemcpyKHR (
2473
+ cl_command_buffer_khr command_buffer,
2474
+ cl_command_queue command_queue,
2475
+ void * dst_ptr,
2476
+ const void * src_ptr,
2477
+ size_t size,
2478
+ cl_uint num_sync_points_in_wait_list,
2479
+ const cl_sync_point_khr* sync_point_wait_list,
2480
+ cl_sync_point_khr* sync_point,
2481
+ cl_mutable_command_khr* mutable_handle)
2482
+ {
2483
+ struct openclext_dispatch_table * dispatch_ptr = _get_dispatch (command_buffer);
2484
+ if (dispatch_ptr == nullptr || dispatch_ptr->clCommandSVMMemcpyKHR == nullptr ) {
2485
+ return CL_INVALID_OPERATION;
2486
+ }
2487
+ return dispatch_ptr->clCommandSVMMemcpyKHR (
2488
+ command_buffer,
2489
+ command_queue,
2490
+ dst_ptr,
2491
+ src_ptr,
2492
+ size,
2493
+ num_sync_points_in_wait_list,
2494
+ sync_point_wait_list,
2495
+ sync_point,
2496
+ mutable_handle);
2497
+ }
2498
+
2499
+ cl_int CL_API_CALL clCommandSVMMemFillKHR (
2500
+ cl_command_buffer_khr command_buffer,
2501
+ cl_command_queue command_queue,
2502
+ void * svm_ptr,
2503
+ const void * pattern,
2504
+ size_t pattern_size,
2505
+ size_t size,
2506
+ cl_uint num_sync_points_in_wait_list,
2507
+ const cl_sync_point_khr* sync_point_wait_list,
2508
+ cl_sync_point_khr* sync_point,
2509
+ cl_mutable_command_khr* mutable_handle)
2510
+ {
2511
+ struct openclext_dispatch_table * dispatch_ptr = _get_dispatch (command_buffer);
2512
+ if (dispatch_ptr == nullptr || dispatch_ptr->clCommandSVMMemFillKHR == nullptr ) {
2513
+ return CL_INVALID_OPERATION;
2514
+ }
2515
+ return dispatch_ptr->clCommandSVMMemFillKHR (
2516
+ command_buffer,
2517
+ command_queue,
2518
+ svm_ptr,
2519
+ pattern,
2520
+ pattern_size,
2521
+ size,
2522
+ num_sync_points_in_wait_list,
2523
+ sync_point_wait_list,
2524
+ sync_point,
2525
+ mutable_handle);
2526
+ }
2527
+
2394
2528
#endif // defined(cl_khr_command_buffer)
2395
2529
2396
2530
#if defined(cl_khr_command_buffer_multi_device)
@@ -3004,6 +3138,25 @@ cl_int CL_API_CALL clGetSemaphoreHandleForTypeKHR(
3004
3138
3005
3139
#endif // defined(cl_khr_external_semaphore)
3006
3140
3141
+ #if defined(cl_khr_external_semaphore_sync_fd)
3142
+
3143
+ cl_int CL_API_CALL clReImportSemaphoreSyncFdKHR (
3144
+ cl_semaphore_khr sema_object,
3145
+ cl_semaphore_reimport_properties_khr* reimport_props,
3146
+ int fd)
3147
+ {
3148
+ struct openclext_dispatch_table * dispatch_ptr = _get_dispatch (sema_object);
3149
+ if (dispatch_ptr == nullptr || dispatch_ptr->clReImportSemaphoreSyncFdKHR == nullptr ) {
3150
+ return CL_INVALID_OPERATION;
3151
+ }
3152
+ return dispatch_ptr->clReImportSemaphoreSyncFdKHR (
3153
+ sema_object,
3154
+ reimport_props,
3155
+ fd);
3156
+ }
3157
+
3158
+ #endif // defined(cl_khr_external_semaphore_sync_fd)
3159
+
3007
3160
#if defined(CLEXT_INCLUDE_GL)
3008
3161
#if defined(cl_khr_gl_event)
3009
3162
@@ -3539,6 +3692,23 @@ cl_int CL_API_CALL clSetKernelExecInfoARM(
3539
3692
3540
3693
#endif // defined(cl_arm_shared_virtual_memory)
3541
3694
3695
+ #if defined(cl_img_cancel_command)
3696
+
3697
+ cl_int CL_API_CALL clCancelCommandsIMG (
3698
+ const cl_event* event_list,
3699
+ size_t num_events_in_list)
3700
+ {
3701
+ struct openclext_dispatch_table * dispatch_ptr = _get_dispatch (num_events_in_list > 0 && event_list ? event_list[0 ] : nullptr );
3702
+ if (dispatch_ptr == nullptr || dispatch_ptr->clCancelCommandsIMG == nullptr ) {
3703
+ return CL_INVALID_OPERATION;
3704
+ }
3705
+ return dispatch_ptr->clCancelCommandsIMG (
3706
+ event_list,
3707
+ num_events_in_list);
3708
+ }
3709
+
3710
+ #endif // defined(cl_img_cancel_command)
3711
+
3542
3712
#if defined(cl_img_generate_mipmap)
3543
3713
3544
3714
cl_int CL_API_CALL clEnqueueGenerateMipmapIMG (
0 commit comments