-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathopenclext.cpp
More file actions
4666 lines (4107 loc) · 144 KB
/
openclext.cpp
File metadata and controls
4666 lines (4107 loc) · 144 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*******************************************************************************
// Copyright (c) 2021-2026 Ben Ashbaugh
//
// SPDX-License-Identifier: MIT or Apache-2.0
*/
/*
// This file is generated from the Khronos OpenCL XML API Registry.
*/
// clang-format off
#if defined _WIN32 || defined __CYGWIN__
#ifdef __GNUC__
#define CL_API_ENTRY __attribute__((dllexport))
#else
#define CL_API_ENTRY __declspec(dllexport)
#endif
#else
#if __GNUC__ >= 4
#define CL_API_ENTRY __attribute__((visibility("default")))
#else
#define CL_API_ENTRY
#endif
#endif
#define CL_USE_DEPRECATED_OPENCL_1_0_APIS
#define CL_USE_DEPRECATED_OPENCL_1_1_APIS
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
#define CL_USE_DEPRECATED_OPENCL_2_0_APIS
#define CL_USE_DEPRECATED_OPENCL_2_1_APIS
#define CL_USE_DEPRECATED_OPENCL_2_2_APIS
#define CL_USE_DEPRECATED_OPENCL_3_0_APIS
#include <CL/cl.h>
#include <CL/cl_ext.h>
#if defined(CLEXT_INCLUDE_GL)
#include <CL/cl_gl.h>
// Some versions of the headers to not define cl_khr_gl_event.
#ifndef cl_khr_gl_event
#define cl_khr_gl_event 1
#endif
#endif
#if defined(CLEXT_INCLUDE_EGL)
#include <CL/cl_egl.h>
#endif
#if defined(CLEXT_INCLUDE_DX9)
#include <CL/cl_dx9_media_sharing.h>
#endif
// Note: If both D3D10 and D3D11 are supported, the D3D11 header must be
// included first.
#if defined(CLEXT_INCLUDE_D3D11)
#include <CL/cl_d3d11.h>
#endif
#if defined(CLEXT_INCLUDE_D3D10)
#include <CL/cl_d3d10.h>
#endif
#if defined(CLEXT_INCLUDE_VA_API)
#include <CL/cl_va_api_media_sharing_intel.h>
#endif
#include <stdlib.h>
#include <vector>
static inline cl_platform_id _get_platform(cl_platform_id platform)
{
return platform;
}
static inline cl_platform_id _get_platform(cl_device_id device)
{
if (device == nullptr) return nullptr;
cl_platform_id platform = nullptr;
clGetDeviceInfo(
device,
CL_DEVICE_PLATFORM,
sizeof(platform),
&platform,
nullptr);
return platform;
}
static inline cl_platform_id _get_platform(cl_command_queue command_queue)
{
if (command_queue == nullptr) return nullptr;
cl_device_id device = nullptr;
clGetCommandQueueInfo(
command_queue,
CL_QUEUE_DEVICE,
sizeof(device),
&device,
nullptr);
return _get_platform(device);
}
static inline cl_platform_id _get_platform(cl_context context)
{
if (context == nullptr) return nullptr;
cl_uint numDevices = 0;
clGetContextInfo(
context,
CL_CONTEXT_NUM_DEVICES,
sizeof(numDevices),
&numDevices,
nullptr );
if (numDevices == 1) { // fast path, no dynamic allocation
cl_device_id device = nullptr;
clGetContextInfo(
context,
CL_CONTEXT_DEVICES,
sizeof(cl_device_id),
&device,
nullptr );
return _get_platform(device);
}
// slower path, dynamic allocation
std::vector<cl_device_id> devices(numDevices);
clGetContextInfo(
context,
CL_CONTEXT_DEVICES,
numDevices * sizeof(cl_device_id),
devices.data(),
nullptr );
return _get_platform(devices[0]);
}
static inline cl_platform_id _get_platform(cl_kernel kernel)
{
if (kernel == nullptr) return nullptr;
cl_context context = nullptr;
clGetKernelInfo(
kernel,
CL_KERNEL_CONTEXT,
sizeof(context),
&context,
nullptr);
return _get_platform(context);
}
static inline cl_platform_id _get_platform(cl_mem memobj)
{
if (memobj == nullptr) return nullptr;
cl_context context = nullptr;
clGetMemObjectInfo(
memobj,
CL_MEM_CONTEXT,
sizeof(context),
&context,
nullptr);
return _get_platform(context);
}
static inline cl_platform_id _get_platform(cl_event event)
{
if (event == nullptr) return nullptr;
cl_context context = nullptr;
clGetEventInfo(
event,
CL_EVENT_CONTEXT,
sizeof(context),
&context,
nullptr);
return _get_platform(context);
}
/***************************************************************
* Function Pointer Typedefs
***************************************************************/
#if defined(cl_khr_command_buffer)
typedef cl_command_buffer_khr (CL_API_CALL* clCreateCommandBufferKHR_clextfn)(
cl_uint num_queues,
const cl_command_queue* queues,
const cl_command_buffer_properties_khr* properties,
cl_int* errcode_ret);
typedef cl_int (CL_API_CALL* clFinalizeCommandBufferKHR_clextfn)(
cl_command_buffer_khr command_buffer);
typedef cl_int (CL_API_CALL* clRetainCommandBufferKHR_clextfn)(
cl_command_buffer_khr command_buffer);
typedef cl_int (CL_API_CALL* clReleaseCommandBufferKHR_clextfn)(
cl_command_buffer_khr command_buffer);
typedef cl_int (CL_API_CALL* clEnqueueCommandBufferKHR_clextfn)(
cl_uint num_queues,
cl_command_queue* queues,
cl_command_buffer_khr command_buffer,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
typedef cl_int (CL_API_CALL* clCommandBarrierWithWaitListKHR_clextfn)(
cl_command_buffer_khr command_buffer,
cl_command_queue command_queue,
const cl_command_properties_khr* properties,
cl_uint num_sync_points_in_wait_list,
const cl_sync_point_khr* sync_point_wait_list,
cl_sync_point_khr* sync_point,
cl_mutable_command_khr* mutable_handle);
typedef cl_int (CL_API_CALL* clCommandCopyBufferKHR_clextfn)(
cl_command_buffer_khr command_buffer,
cl_command_queue command_queue,
const cl_command_properties_khr* properties,
cl_mem src_buffer,
cl_mem dst_buffer,
size_t src_offset,
size_t dst_offset,
size_t size,
cl_uint num_sync_points_in_wait_list,
const cl_sync_point_khr* sync_point_wait_list,
cl_sync_point_khr* sync_point,
cl_mutable_command_khr* mutable_handle);
typedef cl_int (CL_API_CALL* clCommandCopyBufferRectKHR_clextfn)(
cl_command_buffer_khr command_buffer,
cl_command_queue command_queue,
const cl_command_properties_khr* properties,
cl_mem src_buffer,
cl_mem dst_buffer,
const size_t* src_origin,
const size_t* dst_origin,
const size_t* region,
size_t src_row_pitch,
size_t src_slice_pitch,
size_t dst_row_pitch,
size_t dst_slice_pitch,
cl_uint num_sync_points_in_wait_list,
const cl_sync_point_khr* sync_point_wait_list,
cl_sync_point_khr* sync_point,
cl_mutable_command_khr* mutable_handle);
typedef cl_int (CL_API_CALL* clCommandCopyBufferToImageKHR_clextfn)(
cl_command_buffer_khr command_buffer,
cl_command_queue command_queue,
const cl_command_properties_khr* properties,
cl_mem src_buffer,
cl_mem dst_image,
size_t src_offset,
const size_t* dst_origin,
const size_t* region,
cl_uint num_sync_points_in_wait_list,
const cl_sync_point_khr* sync_point_wait_list,
cl_sync_point_khr* sync_point,
cl_mutable_command_khr* mutable_handle);
typedef cl_int (CL_API_CALL* clCommandCopyImageKHR_clextfn)(
cl_command_buffer_khr command_buffer,
cl_command_queue command_queue,
const cl_command_properties_khr* properties,
cl_mem src_image,
cl_mem dst_image,
const size_t* src_origin,
const size_t* dst_origin,
const size_t* region,
cl_uint num_sync_points_in_wait_list,
const cl_sync_point_khr* sync_point_wait_list,
cl_sync_point_khr* sync_point,
cl_mutable_command_khr* mutable_handle);
typedef cl_int (CL_API_CALL* clCommandCopyImageToBufferKHR_clextfn)(
cl_command_buffer_khr command_buffer,
cl_command_queue command_queue,
const cl_command_properties_khr* properties,
cl_mem src_image,
cl_mem dst_buffer,
const size_t* src_origin,
const size_t* region,
size_t dst_offset,
cl_uint num_sync_points_in_wait_list,
const cl_sync_point_khr* sync_point_wait_list,
cl_sync_point_khr* sync_point,
cl_mutable_command_khr* mutable_handle);
typedef cl_int (CL_API_CALL* clCommandFillBufferKHR_clextfn)(
cl_command_buffer_khr command_buffer,
cl_command_queue command_queue,
const cl_command_properties_khr* properties,
cl_mem buffer,
const void* pattern,
size_t pattern_size,
size_t offset,
size_t size,
cl_uint num_sync_points_in_wait_list,
const cl_sync_point_khr* sync_point_wait_list,
cl_sync_point_khr* sync_point,
cl_mutable_command_khr* mutable_handle);
typedef cl_int (CL_API_CALL* clCommandFillImageKHR_clextfn)(
cl_command_buffer_khr command_buffer,
cl_command_queue command_queue,
const cl_command_properties_khr* properties,
cl_mem image,
const void* fill_color,
const size_t* origin,
const size_t* region,
cl_uint num_sync_points_in_wait_list,
const cl_sync_point_khr* sync_point_wait_list,
cl_sync_point_khr* sync_point,
cl_mutable_command_khr* mutable_handle);
typedef cl_int (CL_API_CALL* clCommandNDRangeKernelKHR_clextfn)(
cl_command_buffer_khr command_buffer,
cl_command_queue command_queue,
const cl_command_properties_khr* properties,
cl_kernel kernel,
cl_uint work_dim,
const size_t* global_work_offset,
const size_t* global_work_size,
const size_t* local_work_size,
cl_uint num_sync_points_in_wait_list,
const cl_sync_point_khr* sync_point_wait_list,
cl_sync_point_khr* sync_point,
cl_mutable_command_khr* mutable_handle);
typedef cl_int (CL_API_CALL* clGetCommandBufferInfoKHR_clextfn)(
cl_command_buffer_khr command_buffer,
cl_command_buffer_info_khr param_name,
size_t param_value_size,
void* param_value,
size_t* param_value_size_ret);
typedef cl_int (CL_API_CALL* clCommandSVMMemcpyKHR_clextfn)(
cl_command_buffer_khr command_buffer,
cl_command_queue command_queue,
const cl_command_properties_khr* properties,
void* dst_ptr,
const void* src_ptr,
size_t size,
cl_uint num_sync_points_in_wait_list,
const cl_sync_point_khr* sync_point_wait_list,
cl_sync_point_khr* sync_point,
cl_mutable_command_khr* mutable_handle);
typedef cl_int (CL_API_CALL* clCommandSVMMemFillKHR_clextfn)(
cl_command_buffer_khr command_buffer,
cl_command_queue command_queue,
const cl_command_properties_khr* properties,
void* svm_ptr,
const void* pattern,
size_t pattern_size,
size_t size,
cl_uint num_sync_points_in_wait_list,
const cl_sync_point_khr* sync_point_wait_list,
cl_sync_point_khr* sync_point,
cl_mutable_command_khr* mutable_handle);
#else
#pragma message("Define for cl_khr_command_buffer was not found! Please update your headers.")
#endif // defined(cl_khr_command_buffer)
#if defined(cl_khr_command_buffer_multi_device)
typedef cl_command_buffer_khr (CL_API_CALL* clRemapCommandBufferKHR_clextfn)(
cl_command_buffer_khr command_buffer,
cl_bool automatic,
cl_uint num_queues,
const cl_command_queue* queues,
cl_uint num_handles,
const cl_mutable_command_khr* handles,
cl_mutable_command_khr* handles_ret,
cl_int* errcode_ret);
#else
#pragma message("Define for cl_khr_command_buffer_multi_device was not found! Please update your headers.")
#endif // defined(cl_khr_command_buffer_multi_device)
#if defined(cl_khr_command_buffer_mutable_dispatch)
typedef cl_int (CL_API_CALL* clUpdateMutableCommandsKHR_clextfn)(
cl_command_buffer_khr command_buffer,
cl_uint num_configs,
const cl_command_buffer_update_type_khr* config_types,
const void** configs);
typedef cl_int (CL_API_CALL* clGetMutableCommandInfoKHR_clextfn)(
cl_mutable_command_khr command,
cl_mutable_command_info_khr param_name,
size_t param_value_size,
void* param_value,
size_t* param_value_size_ret);
#else
#pragma message("Define for cl_khr_command_buffer_mutable_dispatch was not found! Please update your headers.")
#endif // defined(cl_khr_command_buffer_mutable_dispatch)
#if defined(cl_khr_create_command_queue)
typedef cl_command_queue (CL_API_CALL* clCreateCommandQueueWithPropertiesKHR_clextfn)(
cl_context context,
cl_device_id device,
const cl_queue_properties_khr* properties,
cl_int* errcode_ret);
#else
#pragma message("Define for cl_khr_create_command_queue was not found! Please update your headers.")
#endif // defined(cl_khr_create_command_queue)
#if defined(CLEXT_INCLUDE_D3D10)
#if defined(cl_khr_d3d10_sharing)
typedef cl_int (CL_API_CALL* clGetDeviceIDsFromD3D10KHR_clextfn)(
cl_platform_id platform,
cl_d3d10_device_source_khr d3d_device_source,
void* d3d_object,
cl_d3d10_device_set_khr d3d_device_set,
cl_uint num_entries,
cl_device_id* devices,
cl_uint* num_devices);
typedef cl_mem (CL_API_CALL* clCreateFromD3D10BufferKHR_clextfn)(
cl_context context,
cl_mem_flags flags,
ID3D10Buffer* resource,
cl_int* errcode_ret);
typedef cl_mem (CL_API_CALL* clCreateFromD3D10Texture2DKHR_clextfn)(
cl_context context,
cl_mem_flags flags,
ID3D10Texture2D* resource,
UINT subresource,
cl_int* errcode_ret);
typedef cl_mem (CL_API_CALL* clCreateFromD3D10Texture3DKHR_clextfn)(
cl_context context,
cl_mem_flags flags,
ID3D10Texture3D* resource,
UINT subresource,
cl_int* errcode_ret);
typedef cl_int (CL_API_CALL* clEnqueueAcquireD3D10ObjectsKHR_clextfn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
typedef cl_int (CL_API_CALL* clEnqueueReleaseD3D10ObjectsKHR_clextfn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
#else
#pragma message("Define for cl_khr_d3d10_sharing was not found! Please update your headers.")
#endif // defined(cl_khr_d3d10_sharing)
#endif // defined(CLEXT_INCLUDE_D3D10)
#if defined(CLEXT_INCLUDE_D3D11)
#if defined(cl_khr_d3d11_sharing)
typedef cl_int (CL_API_CALL* clGetDeviceIDsFromD3D11KHR_clextfn)(
cl_platform_id platform,
cl_d3d11_device_source_khr d3d_device_source,
void* d3d_object,
cl_d3d11_device_set_khr d3d_device_set,
cl_uint num_entries,
cl_device_id* devices,
cl_uint* num_devices);
typedef cl_mem (CL_API_CALL* clCreateFromD3D11BufferKHR_clextfn)(
cl_context context,
cl_mem_flags flags,
ID3D11Buffer* resource,
cl_int* errcode_ret);
typedef cl_mem (CL_API_CALL* clCreateFromD3D11Texture2DKHR_clextfn)(
cl_context context,
cl_mem_flags flags,
ID3D11Texture2D* resource,
UINT subresource,
cl_int* errcode_ret);
typedef cl_mem (CL_API_CALL* clCreateFromD3D11Texture3DKHR_clextfn)(
cl_context context,
cl_mem_flags flags,
ID3D11Texture3D* resource,
UINT subresource,
cl_int* errcode_ret);
typedef cl_int (CL_API_CALL* clEnqueueAcquireD3D11ObjectsKHR_clextfn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
typedef cl_int (CL_API_CALL* clEnqueueReleaseD3D11ObjectsKHR_clextfn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
#else
#pragma message("Define for cl_khr_d3d11_sharing was not found! Please update your headers.")
#endif // defined(cl_khr_d3d11_sharing)
#endif // defined(CLEXT_INCLUDE_D3D11)
#if defined(CLEXT_INCLUDE_DX9)
#if defined(cl_khr_dx9_media_sharing)
typedef cl_int (CL_API_CALL* clGetDeviceIDsFromDX9MediaAdapterKHR_clextfn)(
cl_platform_id platform,
cl_uint num_media_adapters,
cl_dx9_media_adapter_type_khr* media_adapter_type,
void* media_adapters,
cl_dx9_media_adapter_set_khr media_adapter_set,
cl_uint num_entries,
cl_device_id* devices,
cl_uint* num_devices);
typedef cl_mem (CL_API_CALL* clCreateFromDX9MediaSurfaceKHR_clextfn)(
cl_context context,
cl_mem_flags flags,
cl_dx9_media_adapter_type_khr adapter_type,
void* surface_info,
cl_uint plane,
cl_int* errcode_ret);
typedef cl_int (CL_API_CALL* clEnqueueAcquireDX9MediaSurfacesKHR_clextfn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
typedef cl_int (CL_API_CALL* clEnqueueReleaseDX9MediaSurfacesKHR_clextfn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
#else
#pragma message("Define for cl_khr_dx9_media_sharing was not found! Please update your headers.")
#endif // defined(cl_khr_dx9_media_sharing)
#endif // defined(CLEXT_INCLUDE_DX9)
#if defined(CLEXT_INCLUDE_EGL)
#if defined(cl_khr_egl_event)
typedef cl_event (CL_API_CALL* clCreateEventFromEGLSyncKHR_clextfn)(
cl_context context,
CLeglSyncKHR sync,
CLeglDisplayKHR display,
cl_int* errcode_ret);
#else
#pragma message("Define for cl_khr_egl_event was not found! Please update your headers.")
#endif // defined(cl_khr_egl_event)
#endif // defined(CLEXT_INCLUDE_EGL)
#if defined(CLEXT_INCLUDE_EGL)
#if defined(cl_khr_egl_image)
typedef cl_mem (CL_API_CALL* clCreateFromEGLImageKHR_clextfn)(
cl_context context,
CLeglDisplayKHR egldisplay,
CLeglImageKHR eglimage,
cl_mem_flags flags,
const cl_egl_image_properties_khr* properties,
cl_int* errcode_ret);
typedef cl_int (CL_API_CALL* clEnqueueAcquireEGLObjectsKHR_clextfn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
typedef cl_int (CL_API_CALL* clEnqueueReleaseEGLObjectsKHR_clextfn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
#else
#pragma message("Define for cl_khr_egl_image was not found! Please update your headers.")
#endif // defined(cl_khr_egl_image)
#endif // defined(CLEXT_INCLUDE_EGL)
#if defined(cl_khr_external_memory)
typedef cl_int (CL_API_CALL* clEnqueueAcquireExternalMemObjectsKHR_clextfn)(
cl_command_queue command_queue,
cl_uint num_mem_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
typedef cl_int (CL_API_CALL* clEnqueueReleaseExternalMemObjectsKHR_clextfn)(
cl_command_queue command_queue,
cl_uint num_mem_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
#else
#pragma message("Define for cl_khr_external_memory was not found! Please update your headers.")
#endif // defined(cl_khr_external_memory)
#if defined(cl_khr_external_semaphore)
typedef cl_int (CL_API_CALL* clGetSemaphoreHandleForTypeKHR_clextfn)(
cl_semaphore_khr sema_object,
cl_device_id device,
cl_external_semaphore_handle_type_khr handle_type,
size_t handle_size,
void* handle_ptr,
size_t* handle_size_ret);
#else
#pragma message("Define for cl_khr_external_semaphore was not found! Please update your headers.")
#endif // defined(cl_khr_external_semaphore)
#if defined(cl_khr_external_semaphore_sync_fd)
typedef cl_int (CL_API_CALL* clReImportSemaphoreSyncFdKHR_clextfn)(
cl_semaphore_khr sema_object,
cl_semaphore_reimport_properties_khr* reimport_props,
int fd);
#else
#pragma message("Define for cl_khr_external_semaphore_sync_fd was not found! Please update your headers.")
#endif // defined(cl_khr_external_semaphore_sync_fd)
#if defined(CLEXT_INCLUDE_GL)
#if defined(cl_khr_gl_event)
typedef cl_event (CL_API_CALL* clCreateEventFromGLsyncKHR_clextfn)(
cl_context context,
cl_GLsync sync,
cl_int* errcode_ret);
#else
#pragma message("Define for cl_khr_gl_event was not found! Please update your headers.")
#endif // defined(cl_khr_gl_event)
#endif // defined(CLEXT_INCLUDE_GL)
#if defined(cl_khr_il_program)
typedef cl_program (CL_API_CALL* clCreateProgramWithILKHR_clextfn)(
cl_context context,
const void* il,
size_t length,
cl_int* errcode_ret);
#else
#pragma message("Define for cl_khr_il_program was not found! Please update your headers.")
#endif // defined(cl_khr_il_program)
#if defined(cl_khr_semaphore)
typedef cl_semaphore_khr (CL_API_CALL* clCreateSemaphoreWithPropertiesKHR_clextfn)(
cl_context context,
const cl_semaphore_properties_khr* sema_props,
cl_int* errcode_ret);
typedef cl_int (CL_API_CALL* clEnqueueWaitSemaphoresKHR_clextfn)(
cl_command_queue command_queue,
cl_uint num_sema_objects,
const cl_semaphore_khr* sema_objects,
const cl_semaphore_payload_khr* sema_payload_list,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
typedef cl_int (CL_API_CALL* clEnqueueSignalSemaphoresKHR_clextfn)(
cl_command_queue command_queue,
cl_uint num_sema_objects,
const cl_semaphore_khr* sema_objects,
const cl_semaphore_payload_khr* sema_payload_list,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
typedef cl_int (CL_API_CALL* clGetSemaphoreInfoKHR_clextfn)(
cl_semaphore_khr sema_object,
cl_semaphore_info_khr param_name,
size_t param_value_size,
void* param_value,
size_t* param_value_size_ret);
typedef cl_int (CL_API_CALL* clReleaseSemaphoreKHR_clextfn)(
cl_semaphore_khr sema_object);
typedef cl_int (CL_API_CALL* clRetainSemaphoreKHR_clextfn)(
cl_semaphore_khr sema_object);
#else
#pragma message("Define for cl_khr_semaphore was not found! Please update your headers.")
#endif // defined(cl_khr_semaphore)
#if defined(cl_khr_subgroups)
typedef cl_int (CL_API_CALL* clGetKernelSubGroupInfoKHR_clextfn)(
cl_kernel in_kernel,
cl_device_id in_device,
cl_kernel_sub_group_info param_name,
size_t input_value_size,
const void* input_value,
size_t param_value_size,
void* param_value,
size_t* param_value_size_ret);
#else
#pragma message("Define for cl_khr_subgroups was not found! Please update your headers.")
#endif // defined(cl_khr_subgroups)
#if defined(cl_khr_suggested_local_work_size)
typedef cl_int (CL_API_CALL* clGetKernelSuggestedLocalWorkSizeKHR_clextfn)(
cl_command_queue command_queue,
cl_kernel kernel,
cl_uint work_dim,
const size_t* global_work_offset,
const size_t* global_work_size,
size_t* suggested_local_work_size);
#else
#pragma message("Define for cl_khr_suggested_local_work_size was not found! Please update your headers.")
#endif // defined(cl_khr_suggested_local_work_size)
#if defined(cl_khr_terminate_context)
typedef cl_int (CL_API_CALL* clTerminateContextKHR_clextfn)(
cl_context context);
#else
#pragma message("Define for cl_khr_terminate_context was not found! Please update your headers.")
#endif // defined(cl_khr_terminate_context)
#if defined(cl_ext_buffer_device_address)
typedef cl_int (CL_API_CALL* clSetKernelArgDevicePointerEXT_clextfn)(
cl_kernel kernel,
cl_uint arg_index,
cl_mem_device_address_ext arg_value);
#else
#pragma message("Define for cl_ext_buffer_device_address was not found! Please update your headers.")
#endif // defined(cl_ext_buffer_device_address)
#if defined(cl_ext_device_fission)
typedef cl_int (CL_API_CALL* clReleaseDeviceEXT_clextfn)(
cl_device_id device);
typedef cl_int (CL_API_CALL* clRetainDeviceEXT_clextfn)(
cl_device_id device);
typedef cl_int (CL_API_CALL* clCreateSubDevicesEXT_clextfn)(
cl_device_id in_device,
const cl_device_partition_property_ext* properties,
cl_uint num_entries,
cl_device_id* out_devices,
cl_uint* num_devices);
#else
#pragma message("Define for cl_ext_device_fission was not found! Please update your headers.")
#endif // defined(cl_ext_device_fission)
#if defined(cl_ext_image_requirements_info)
typedef cl_int (CL_API_CALL* clGetImageRequirementsInfoEXT_clextfn)(
cl_context context,
const cl_mem_properties* properties,
cl_mem_flags flags,
const cl_image_format* image_format,
const cl_image_desc* image_desc,
cl_image_requirements_info_ext param_name,
size_t param_value_size,
void* param_value,
size_t* param_value_size_ret);
#else
#pragma message("Define for cl_ext_image_requirements_info was not found! Please update your headers.")
#endif // defined(cl_ext_image_requirements_info)
#if defined(cl_ext_migrate_memobject)
typedef cl_int (CL_API_CALL* clEnqueueMigrateMemObjectEXT_clextfn)(
cl_command_queue command_queue,
cl_uint num_mem_objects,
const cl_mem* mem_objects,
cl_mem_migration_flags_ext flags,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
#else
#pragma message("Define for cl_ext_migrate_memobject was not found! Please update your headers.")
#endif // defined(cl_ext_migrate_memobject)
#if defined(cl_arm_import_memory)
typedef cl_mem (CL_API_CALL* clImportMemoryARM_clextfn)(
cl_context context,
cl_mem_flags flags,
const cl_import_properties_arm* properties,
void* memory,
size_t size,
cl_int* errcode_ret);
#else
#pragma message("Define for cl_arm_import_memory was not found! Please update your headers.")
#endif // defined(cl_arm_import_memory)
#if defined(cl_arm_shared_virtual_memory)
typedef void* (CL_API_CALL* clSVMAllocARM_clextfn)(
cl_context context,
cl_svm_mem_flags_arm flags,
size_t size,
cl_uint alignment);
typedef void (CL_API_CALL* clSVMFreeARM_clextfn)(
cl_context context,
void* svm_pointer);
typedef cl_int (CL_API_CALL* clEnqueueSVMFreeARM_clextfn)(
cl_command_queue command_queue,
cl_uint num_svm_pointers,
void* svm_pointers[],
void (CL_CALLBACK* pfn_free_func)(cl_command_queue queue, cl_uint num_svm_pointers, void * svm_pointers[], void *user_data),
void* user_data,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
typedef cl_int (CL_API_CALL* clEnqueueSVMMemcpyARM_clextfn)(
cl_command_queue command_queue,
cl_bool blocking_copy,
void* dst_ptr,
const void* src_ptr,
size_t size,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
typedef cl_int (CL_API_CALL* clEnqueueSVMMemFillARM_clextfn)(
cl_command_queue command_queue,
void* svm_ptr,
const void* pattern,
size_t pattern_size,
size_t size,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
typedef cl_int (CL_API_CALL* clEnqueueSVMMapARM_clextfn)(
cl_command_queue command_queue,
cl_bool blocking_map,
cl_map_flags flags,
void* svm_ptr,
size_t size,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
typedef cl_int (CL_API_CALL* clEnqueueSVMUnmapARM_clextfn)(
cl_command_queue command_queue,
void* svm_ptr,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
typedef cl_int (CL_API_CALL* clSetKernelArgSVMPointerARM_clextfn)(
cl_kernel kernel,
cl_uint arg_index,
const void* arg_value);
typedef cl_int (CL_API_CALL* clSetKernelExecInfoARM_clextfn)(
cl_kernel kernel,
cl_kernel_exec_info_arm param_name,
size_t param_value_size,
const void* param_value);
#else
#pragma message("Define for cl_arm_shared_virtual_memory was not found! Please update your headers.")
#endif // defined(cl_arm_shared_virtual_memory)
#if defined(cl_img_cancel_command)
typedef cl_int (CL_API_CALL* clCancelCommandsIMG_clextfn)(
const cl_event* event_list,
size_t num_events_in_list);
#else
#pragma message("Define for cl_img_cancel_command was not found! Please update your headers.")
#endif // defined(cl_img_cancel_command)
#if defined(cl_img_generate_mipmap)
typedef cl_int (CL_API_CALL* clEnqueueGenerateMipmapIMG_clextfn)(
cl_command_queue command_queue,
cl_mem src_image,
cl_mem dst_image,
cl_mipmap_filter_mode_img mipmap_filter_mode,
const size_t* array_region,
const size_t* mip_region,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
#else
#pragma message("Define for cl_img_generate_mipmap was not found! Please update your headers.")
#endif // defined(cl_img_generate_mipmap)
#if defined(cl_img_use_gralloc_ptr)
typedef cl_int (CL_API_CALL* clEnqueueAcquireGrallocObjectsIMG_clextfn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
typedef cl_int (CL_API_CALL* clEnqueueReleaseGrallocObjectsIMG_clextfn)(
cl_command_queue command_queue,
cl_uint num_objects,
const cl_mem* mem_objects,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
#else
#pragma message("Define for cl_img_use_gralloc_ptr was not found! Please update your headers.")
#endif // defined(cl_img_use_gralloc_ptr)
#if defined(cl_intel_accelerator)
typedef cl_accelerator_intel (CL_API_CALL* clCreateAcceleratorINTEL_clextfn)(
cl_context context,
cl_accelerator_type_intel accelerator_type,
size_t descriptor_size,
const void* descriptor,
cl_int* errcode_ret);
typedef cl_int (CL_API_CALL* clGetAcceleratorInfoINTEL_clextfn)(
cl_accelerator_intel accelerator,
cl_accelerator_info_intel param_name,
size_t param_value_size,
void* param_value,
size_t* param_value_size_ret);
typedef cl_int (CL_API_CALL* clRetainAcceleratorINTEL_clextfn)(
cl_accelerator_intel accelerator);
typedef cl_int (CL_API_CALL* clReleaseAcceleratorINTEL_clextfn)(
cl_accelerator_intel accelerator);
#else
#pragma message("Define for cl_intel_accelerator was not found! Please update your headers.")
#endif // defined(cl_intel_accelerator)
#if defined(cl_intel_create_buffer_with_properties)
typedef cl_mem (CL_API_CALL* clCreateBufferWithPropertiesINTEL_clextfn)(
cl_context context,
const cl_mem_properties_intel* properties,
cl_mem_flags flags,
size_t size,
void* host_ptr,
cl_int* errcode_ret);
#else
#pragma message("Define for cl_intel_create_buffer_with_properties was not found! Please update your headers.")
#endif // defined(cl_intel_create_buffer_with_properties)
#if defined(CLEXT_INCLUDE_DX9)
#if defined(cl_intel_dx9_media_sharing)