Repository navigation
Expand file tree
/
Copy path_backend.pxd
More file actions
843 lines (774 loc) · 35.7 KB
/
Copy path_backend.pxd
File metadata and controls
843 lines (774 loc) · 35.7 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
# Data Parallel Control (dpctl)
#
# Copyright 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# distutils: language = c++
# cython: language_level=3
"""This file defines the Cython extern types for the functions and opaque data
types defined by dpctl's C API.
"""
from libc.stdint cimport int64_t, uint8_t, uint16_t, uint32_t, uint64_t
from libcpp cimport bool
cdef extern from "syclinterface/dpctl_error_handler_type.h":
ctypedef void error_handler_callback(int err_code)
cdef extern from "syclinterface/dpctl_utils.h":
cdef void DPCTLCString_Delete(const char *str)
cdef void DPCTLSize_t_Array_Delete(size_t *arr)
cdef void DPCTLInt_Array_Delete(int *arr)
cdef extern from "syclinterface/dpctl_sycl_enum_types.h":
ctypedef enum _usm_type "DPCTLSyclUSMType":
_USM_UNKNOWN "DPCTL_USM_UNKNOWN"
_USM_DEVICE "DPCTL_USM_DEVICE"
_USM_SHARED "DPCTL_USM_SHARED"
_USM_HOST "DPCTL_USM_HOST"
ctypedef enum _backend_type "DPCTLSyclBackendType":
_ALL_BACKENDS "DPCTL_ALL_BACKENDS"
_CUDA "DPCTL_CUDA"
_HIP "DPCTL_HIP"
_LEVEL_ZERO "DPCTL_LEVEL_ZERO"
_OPENCL "DPCTL_OPENCL"
_UNKNOWN_BACKEND "DPCTL_UNKNOWN_BACKEND"
ctypedef enum _device_type "DPCTLSyclDeviceType":
_ACCELERATOR "DPCTL_ACCELERATOR"
_ALL_DEVICES "DPCTL_ALL"
_AUTOMATIC "DPCTL_AUTOMATIC"
_CPU "DPCTL_CPU"
_CUSTOM "DPCTL_CUSTOM"
_GPU "DPCTL_GPU"
_UNKNOWN_DEVICE "DPCTL_UNKNOWN_DEVICE"
ctypedef enum _arg_data_type "DPCTLKernelArgType":
_INT8_T "DPCTL_INT8_T",
_UINT8_T "DPCTL_UINT8_T",
_INT16_T "DPCTL_INT16_T",
_UINT16_T "DPCTL_UINT16_T",
_INT32_T "DPCTL_INT32_T",
_UINT32_T "DPCTL_UINT32_T",
_INT64_T "DPCTL_INT64_T",
_UINT64_T "DPCTL_UINT64_T",
_FLOAT "DPCTL_FLOAT32_T",
_DOUBLE "DPCTL_FLOAT64_T",
_VOID_PTR "DPCTL_VOID_PTR",
_LOCAL_ACCESSOR "DPCTL_LOCAL_ACCESSOR",
_WORK_GROUP_MEMORY "DPCTL_WORK_GROUP_MEMORY"
_RAW_KERNEL_ARG "DPCTL_RAW_KERNEL_ARG"
ctypedef enum _queue_property_type "DPCTLQueuePropertyType":
_DEFAULT_PROPERTY "DPCTL_DEFAULT_PROPERTY"
_ENABLE_PROFILING "DPCTL_ENABLE_PROFILING"
_IN_ORDER "DPCTL_IN_ORDER"
ctypedef enum _aspect_type "DPCTLSyclAspectType":
_host "host",
_cpu "cpu",
_gpu "gpu",
_accelerator "accelerator",
_custom "custom",
_fp16 "fp16",
_fp64 "fp64",
_atomic64 "atomic64",
_image "image",
_online_compiler "online_compiler",
_online_linker "online_linker",
_queue_profiling "queue_profiling",
_usm_device_allocations "usm_device_allocations",
_usm_host_allocations "usm_host_allocations",
_usm_shared_allocations "usm_shared_allocations",
_usm_system_allocations "usm_system_allocations",
_usm_atomic_host_allocations "usm_atomic_host_allocations",
_usm_atomic_shared_allocations "usm_atomic_shared_allocations",
_host_debuggable "host_debuggable",
_emulated "emulated",
_is_component "is_component",
_is_composite "is_composite",
_ext_oneapi_ipc_memory "ext_oneapi_ipc_memory",
ctypedef enum _partition_affinity_domain_type \
"DPCTLPartitionAffinityDomainType":
_PARTITION_AFFINITY_DOMAIN_UNKNOWN \
"DPCTL_PARTITION_AFFINITY_DOMAIN_UNKNOWN",
_not_applicable "not_applicable",
_numa "numa",
_L4_cache "L4_cache",
_L3_cache "L3_cache",
_L2_cache "L2_cache",
_L1_cache "L1_cache",
_next_partitionable "next_partitionable",
ctypedef enum _peer_access "DPCTLPeerAccessType":
_access_supported "access_supported",
_atomics_supported "atomics_supported",
ctypedef enum _event_status_type "DPCTLSyclEventStatusType":
_UNKNOWN_STATUS "DPCTL_UNKNOWN_STATUS"
_SUBMITTED "DPCTL_SUBMITTED"
_RUNNING "DPCTL_RUNNING"
_COMPLETE "DPCTL_COMPLETE"
ctypedef enum _global_mem_cache_type "DPCTLGlobalMemCacheType":
_MEM_CACHE_TYPE_INDETERMINATE "DPCTL_MEM_CACHE_TYPE_INDETERMINATE"
_MEM_CACHE_TYPE_NONE "DPCTL_MEM_CACHE_TYPE_NONE"
_MEM_CACHE_TYPE_READ_ONLY "DPCTL_MEM_CACHE_TYPE_READ_ONLY"
_MEM_CACHE_TYPE_READ_WRITE "DPCTL_MEM_CACHE_TYPE_READ_WRITE"
ctypedef enum _local_mem_type "DPCTLLocalMemType":
_LOCAL_MEM_TYPE_UNKNOWN "DPCTL_LOCAL_MEM_TYPE_UNKNOWN"
_LOCAL_MEM_TYPE_NONE "DPCTL_LOCAL_MEM_TYPE_NONE"
_LOCAL_MEM_TYPE_LOCAL "DPCTL_LOCAL_MEM_TYPE_LOCAL"
_LOCAL_MEM_TYPE_GLOBAL "DPCTL_LOCAL_MEM_TYPE_GLOBAL"
ctypedef enum _partition_property_type "DPCTLPartitionPropertyType":
_PARTITION_UNKNOWN "DPCTL_PARTITION_UNKNOWN"
_PARTITION_NO_PARTITION "DPCTL_PARTITION_NO_PARTITION"
_PARTITION_EQUALLY "DPCTL_PARTITION_EQUALLY"
_PARTITION_BY_COUNTS "DPCTL_PARTITION_BY_COUNTS"
_PARTITION_BY_AFFINITY_DOMAIN "DPCTL_PARTITION_BY_AFFINITY_DOMAIN"
ctypedef enum _fp_config_type "DPCTLFPConfigType":
_FP_UNKNOWN "DPCTL_FP_UNKNOWN"
_FP_DENORM "DPCTL_FP_DENORM"
_FP_INF_NAN "DPCTL_FP_INF_NAN"
_FP_ROUND_TO_NEAREST "DPCTL_FP_ROUND_TO_NEAREST"
_FP_ROUND_TO_ZERO "DPCTL_FP_ROUND_TO_ZERO"
_FP_ROUND_TO_INF "DPCTL_FP_ROUND_TO_INF"
_FP_FMA "DPCTL_FP_FMA"
_FP_CORRECT_ROUND_DIV_SQRT "DPCTL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT"
_FP_SOFT_FLOAT "DPCTL_FP_SOFT_FLOAT"
ctypedef enum _memory_order_type "DPCTLMemoryOrderType":
_MEMORY_ORDER_UNKNOWN "DPCTL_MEMORY_ORDER_UNKNOWN"
_MEMORY_ORDER_RELAXED "DPCTL_MEMORY_ORDER_RELAXED"
_MEMORY_ORDER_ACQUIRE "DPCTL_MEMORY_ORDER_ACQUIRE"
_MEMORY_ORDER_RELEASE "DPCTL_MEMORY_ORDER_RELEASE"
_MEMORY_ORDER_ACQ_REL "DPCTL_MEMORY_ORDER_ACQ_REL"
_MEMORY_ORDER_SEQ_CST "DPCTL_MEMORY_ORDER_SEQ_CST"
ctypedef enum _memory_scope_type "DPCTLMemoryScopeType":
_MEMORY_SCOPE_UNKNOWN "DPCTL_MEMORY_SCOPE_UNKNOWN"
_MEMORY_SCOPE_WORK_ITEM "DPCTL_MEMORY_SCOPE_WORK_ITEM"
_MEMORY_SCOPE_SUB_GROUP "DPCTL_MEMORY_SCOPE_SUB_GROUP"
_MEMORY_SCOPE_WORK_GROUP "DPCTL_MEMORY_SCOPE_WORK_GROUP"
_MEMORY_SCOPE_DEVICE "DPCTL_MEMORY_SCOPE_DEVICE"
_MEMORY_SCOPE_SYSTEM "DPCTL_MEMORY_SCOPE_SYSTEM"
cdef extern from "syclinterface/dpctl_sycl_types.h":
cdef struct DPCTLOpaqueSyclContext
cdef struct DPCTLOpaqueSyclDevice
cdef struct DPCTLOpaqueSyclDeviceSelector
cdef struct DPCTLOpaqueSyclEvent
cdef struct DPCTLOpaqueSyclKernel
cdef struct DPCTLOpaqueSyclPlatform
cdef struct DPCTLOpaqueSyclKernelBundle
cdef struct DPCTLOpaqueSyclQueue
cdef struct DPCTLOpaqueSyclUSM
ctypedef DPCTLOpaqueSyclContext *DPCTLSyclContextRef
ctypedef DPCTLOpaqueSyclDevice *DPCTLSyclDeviceRef
ctypedef DPCTLOpaqueSyclDeviceSelector *DPCTLSyclDeviceSelectorRef
ctypedef DPCTLOpaqueSyclEvent *DPCTLSyclEventRef
ctypedef DPCTLOpaqueSyclKernel *DPCTLSyclKernelRef
ctypedef DPCTLOpaqueSyclPlatform *DPCTLSyclPlatformRef
ctypedef DPCTLOpaqueSyclKernelBundle *DPCTLSyclKernelBundleRef
ctypedef DPCTLOpaqueSyclQueue *DPCTLSyclQueueRef
ctypedef DPCTLOpaqueSyclUSM *DPCTLSyclUSMRef
cdef extern from "syclinterface/dpctl_sycl_device_manager.h":
cdef struct DPCTLDeviceVector
ctypedef DPCTLDeviceVector *DPCTLDeviceVectorRef
cdef extern from "syclinterface/dpctl_sycl_device_interface.h":
cdef bool DPCTLDevice_AreEq(const DPCTLSyclDeviceRef DRef1,
const DPCTLSyclDeviceRef DRef2)
cdef DPCTLSyclDeviceRef DPCTLDevice_Copy(const DPCTLSyclDeviceRef DRef)
cdef DPCTLSyclDeviceRef DPCTLDevice_Create()
cdef DPCTLSyclDeviceRef DPCTLDevice_CreateFromSelector(
const DPCTLSyclDeviceSelectorRef DSRef)
cdef void DPCTLDevice_Delete(DPCTLSyclDeviceRef DRef)
cdef _backend_type DPCTLDevice_GetBackend(const DPCTLSyclDeviceRef)
cdef _device_type DPCTLDevice_GetDeviceType(const DPCTLSyclDeviceRef)
cdef const char *DPCTLDevice_GetDriverVersion(const DPCTLSyclDeviceRef DRef)
cdef size_t DPCTLDevice_GetGlobalMemSize(const DPCTLSyclDeviceRef DRef)
cdef size_t DPCTLDevice_GetLocalMemSize(const DPCTLSyclDeviceRef DRef)
cdef uint32_t DPCTLDevice_GetMaxComputeUnits(const DPCTLSyclDeviceRef DRef)
cdef uint32_t DPCTLDevice_GetMaxNumSubGroups(const DPCTLSyclDeviceRef DRef)
cdef size_t DPCTLDevice_GetMaxWorkGroupSize(const DPCTLSyclDeviceRef DRef)
cdef uint32_t DPCTLDevice_GetMaxWorkItemDims(const DPCTLSyclDeviceRef DRef)
cdef size_t *DPCTLDevice_GetMaxWorkItemSizes1d(
const DPCTLSyclDeviceRef DRef
)
cdef size_t *DPCTLDevice_GetMaxWorkItemSizes2d(
const DPCTLSyclDeviceRef DRef
)
cdef size_t *DPCTLDevice_GetMaxWorkItemSizes3d(
const DPCTLSyclDeviceRef DRef
)
cdef const char *DPCTLDevice_GetName(const DPCTLSyclDeviceRef DRef)
cdef DPCTLSyclPlatformRef DPCTLDevice_GetPlatform(
const DPCTLSyclDeviceRef DRef)
cdef const char *DPCTLDevice_GetVendor(const DPCTLSyclDeviceRef DRef)
cdef size_t DPCTLDevice_Hash(const DPCTLSyclDeviceRef DRef)
cdef bool DPCTLDevice_IsAccelerator(const DPCTLSyclDeviceRef DRef)
cdef bool DPCTLDevice_IsCPU(const DPCTLSyclDeviceRef DRef)
cdef bool DPCTLDevice_IsGPU(const DPCTLSyclDeviceRef DRef)
cdef uint32_t DPCTLDevice_GetPreferredVectorWidthChar(
const DPCTLSyclDeviceRef DRef
)
cdef uint32_t DPCTLDevice_GetPreferredVectorWidthShort(
const DPCTLSyclDeviceRef DRef
)
cdef uint32_t DPCTLDevice_GetPreferredVectorWidthInt(
const DPCTLSyclDeviceRef DRef
)
cdef uint32_t DPCTLDevice_GetPreferredVectorWidthLong(
const DPCTLSyclDeviceRef DRef
)
cdef uint32_t DPCTLDevice_GetPreferredVectorWidthFloat(
const DPCTLSyclDeviceRef DRef
)
cdef uint32_t DPCTLDevice_GetPreferredVectorWidthDouble(
const DPCTLSyclDeviceRef DRef
)
cdef uint32_t DPCTLDevice_GetPreferredVectorWidthHalf(
const DPCTLSyclDeviceRef DRef
)
cdef uint32_t DPCTLDevice_GetNativeVectorWidthChar(
const DPCTLSyclDeviceRef DRef
)
cdef uint32_t DPCTLDevice_GetNativeVectorWidthShort(
const DPCTLSyclDeviceRef DRef
)
cdef uint32_t DPCTLDevice_GetNativeVectorWidthInt(
const DPCTLSyclDeviceRef DRef
)
cdef uint32_t DPCTLDevice_GetNativeVectorWidthLong(
const DPCTLSyclDeviceRef DRef
)
cdef uint32_t DPCTLDevice_GetNativeVectorWidthFloat(
const DPCTLSyclDeviceRef DRef
)
cdef uint32_t DPCTLDevice_GetNativeVectorWidthDouble(
const DPCTLSyclDeviceRef DRef
)
cdef uint32_t DPCTLDevice_GetNativeVectorWidthHalf(
const DPCTLSyclDeviceRef DRef
)
cdef bool DPCTLDevice_HasAspect(const DPCTLSyclDeviceRef, _aspect_type)
cdef uint32_t DPCTLDevice_GetMaxReadImageArgs(const DPCTLSyclDeviceRef DRef)
cdef uint32_t DPCTLDevice_GetMaxWriteImageArgs(
const DPCTLSyclDeviceRef DRef
)
cdef size_t DPCTLDevice_GetImage2dMaxWidth(const DPCTLSyclDeviceRef DRef)
cdef size_t DPCTLDevice_GetImage2dMaxHeight(const DPCTLSyclDeviceRef DRef)
cdef size_t DPCTLDevice_GetImage3dMaxWidth(const DPCTLSyclDeviceRef DRef)
cdef size_t DPCTLDevice_GetImage3dMaxHeight(const DPCTLSyclDeviceRef DRef)
cdef size_t DPCTLDevice_GetImage3dMaxDepth(const DPCTLSyclDeviceRef DRef)
cdef DPCTLDeviceVectorRef DPCTLDevice_CreateSubDevicesEqually(
const DPCTLSyclDeviceRef DRef, size_t count)
cdef DPCTLDeviceVectorRef DPCTLDevice_CreateSubDevicesByCounts(
const DPCTLSyclDeviceRef DRef, size_t *counts, size_t ncounts)
cdef DPCTLDeviceVectorRef DPCTLDevice_CreateSubDevicesByAffinity(
const DPCTLSyclDeviceRef DRef,
_partition_affinity_domain_type PartitionAffinityDomainTy)
cdef DPCTLSyclDeviceRef DPCTLDevice_GetParentDevice(
const DPCTLSyclDeviceRef DRef
)
cdef size_t DPCTLDevice_GetProfilingTimerResolution(
const DPCTLSyclDeviceRef DRef
)
cdef uint32_t DPCTLDevice_GetGlobalMemCacheLineSize(
const DPCTLSyclDeviceRef DRef
)
cdef uint64_t DPCTLDevice_GetGlobalMemCacheSize(
const DPCTLSyclDeviceRef DRef
)
cdef _global_mem_cache_type DPCTLDevice_GetGlobalMemCacheType(
const DPCTLSyclDeviceRef DRef)
cdef size_t *DPCTLDevice_GetSubGroupSizes(
const DPCTLSyclDeviceRef DRef, size_t *res_len
)
cdef uint32_t DPCTLDevice_GetPartitionMaxSubDevices(
const DPCTLSyclDeviceRef DRef
)
cdef uint32_t DPCTLDevice_GetMaxClockFrequency(
const DPCTLSyclDeviceRef DRef
)
cdef uint64_t DPCTLDevice_GetMaxMemAllocSize(const DPCTLSyclDeviceRef DRef)
cdef DPCTLSyclDeviceRef DPCTLDevice_GetCompositeDevice(
const DPCTLSyclDeviceRef DRef
)
cdef DPCTLDeviceVectorRef DPCTLDevice_GetComponentDevices(
const DPCTLSyclDeviceRef DRef
)
cdef bool DPCTLDevice_CanAccessPeer(const DPCTLSyclDeviceRef DRef,
const DPCTLSyclDeviceRef PDRef,
_peer_access PT)
cdef void DPCTLDevice_EnablePeerAccess(const DPCTLSyclDeviceRef DRef,
const DPCTLSyclDeviceRef PDRef)
cdef void DPCTLDevice_DisablePeerAccess(const DPCTLSyclDeviceRef DRef,
const DPCTLSyclDeviceRef PDRef)
cdef uint32_t DPCTLDevice_GetVendorId(const DPCTLSyclDeviceRef DRef)
cdef uint32_t DPCTLDevice_GetAddressBits(const DPCTLSyclDeviceRef DRef)
cdef size_t DPCTLDevice_GetImageMaxBufferSize(
const DPCTLSyclDeviceRef DRef)
cdef uint32_t DPCTLDevice_GetMaxSamplers(const DPCTLSyclDeviceRef DRef)
cdef size_t DPCTLDevice_GetMaxParameterSize(
const DPCTLSyclDeviceRef DRef)
cdef uint32_t DPCTLDevice_GetMemBaseAddrAlign(
const DPCTLSyclDeviceRef DRef)
cdef bool DPCTLDevice_GetErrorCorrectionSupport(
const DPCTLSyclDeviceRef DRef)
cdef bool DPCTLDevice_IsAvailable(const DPCTLSyclDeviceRef DRef)
cdef const char *DPCTLDevice_GetVersion(const DPCTLSyclDeviceRef DRef)
cdef const char *DPCTLDevice_GetBackendVersion(
const DPCTLSyclDeviceRef DRef)
cdef _local_mem_type DPCTLDevice_GetLocalMemType(
const DPCTLSyclDeviceRef DRef)
cdef _partition_property_type DPCTLDevice_GetPartitionTypeProperty(
const DPCTLSyclDeviceRef DRef)
cdef _partition_affinity_domain_type \
DPCTLDevice_GetPartitionTypeAffinityDomain(
const DPCTLSyclDeviceRef DRef)
cdef int *DPCTLDevice_GetHalfFPConfig(
const DPCTLSyclDeviceRef DRef, size_t *res_len)
cdef int *DPCTLDevice_GetSingleFPConfig(
const DPCTLSyclDeviceRef DRef, size_t *res_len)
cdef int *DPCTLDevice_GetDoubleFPConfig(
const DPCTLSyclDeviceRef DRef, size_t *res_len)
cdef int *DPCTLDevice_GetAtomicMemoryOrderCapabilities(
const DPCTLSyclDeviceRef DRef, size_t *res_len)
cdef int *DPCTLDevice_GetAtomicFenceOrderCapabilities(
const DPCTLSyclDeviceRef DRef, size_t *res_len)
cdef int *DPCTLDevice_GetAtomicMemoryScopeCapabilities(
const DPCTLSyclDeviceRef DRef, size_t *res_len)
cdef int *DPCTLDevice_GetAtomicFenceScopeCapabilities(
const DPCTLSyclDeviceRef DRef, size_t *res_len)
cdef int *DPCTLDevice_GetPartitionProperties(
const DPCTLSyclDeviceRef DRef, size_t *res_len)
cdef int *DPCTLDevice_GetPartitionAffinityDomains(
const DPCTLSyclDeviceRef DRef, size_t *res_len)
cdef bool DPCTLDevice_CanCompileSPIRV(const DPCTLSyclDeviceRef DRef)
cdef bool DPCTLDevice_CanCompileOpenCL(const DPCTLSyclDeviceRef DRef)
cdef bool DPCTLDevice_CanCompileSYCL(const DPCTLSyclDeviceRef DRef)
cdef extern from "syclinterface/dpctl_sycl_device_manager.h":
cdef DPCTLDeviceVectorRef DPCTLDeviceVector_CreateFromArray(
size_t nelems,
DPCTLSyclDeviceRef *elems)
cdef void DPCTLDeviceVector_Delete(DPCTLDeviceVectorRef DVRef)
cdef void DPCTLDeviceVector_Clear(DPCTLDeviceVectorRef DVRef)
cdef size_t DPCTLDeviceVector_Size(DPCTLDeviceVectorRef DVRef)
cdef DPCTLSyclDeviceRef DPCTLDeviceVector_GetAt(
DPCTLDeviceVectorRef DVRef,
size_t index)
cdef DPCTLDeviceVectorRef DPCTLDeviceMgr_GetDevices(int device_identifier)
cdef int DPCTLDeviceMgr_GetPositionInDevices(
const DPCTLSyclDeviceRef DRef,
int device_identifier)
cdef size_t DPCTLDeviceMgr_GetNumDevices(int device_identifier)
cdef const char * DPCTLDeviceMgr_GetDeviceInfoStr(
const DPCTLSyclDeviceRef DRef
)
cdef DPCTLSyclContextRef DPCTLDeviceMgr_GetCachedContext(
const DPCTLSyclDeviceRef DRef)
cdef int64_t DPCTLDeviceMgr_GetRelativeId(const DPCTLSyclDeviceRef DRef)
cdef DPCTLDeviceVectorRef DPCTLDeviceMgr_GetCompositeDevices()
cdef extern from "syclinterface/dpctl_sycl_device_selector_interface.h":
DPCTLSyclDeviceSelectorRef DPCTLAcceleratorSelector_Create()
DPCTLSyclDeviceSelectorRef DPCTLDefaultSelector_Create()
DPCTLSyclDeviceSelectorRef DPCTLCPUSelector_Create()
DPCTLSyclDeviceSelectorRef DPCTLFilterSelector_Create(const char *)
DPCTLSyclDeviceSelectorRef DPCTLGPUSelector_Create()
void DPCTLDeviceSelector_Delete(DPCTLSyclDeviceSelectorRef)
int DPCTLDeviceSelector_Score(
DPCTLSyclDeviceSelectorRef, DPCTLSyclDeviceRef
)
cdef extern from "syclinterface/dpctl_sycl_event_interface.h":
cdef DPCTLSyclEventRef DPCTLEvent_Create()
cdef DPCTLSyclEventRef DPCTLEvent_Copy(const DPCTLSyclEventRef ERef)
cdef void DPCTLEvent_Wait(DPCTLSyclEventRef ERef) nogil
cdef void DPCTLEvent_WaitAndThrow(DPCTLSyclEventRef ERef) nogil
cdef void DPCTLEvent_Delete(DPCTLSyclEventRef ERef)
cdef _event_status_type DPCTLEvent_GetCommandExecutionStatus(
DPCTLSyclEventRef ERef
)
cdef _backend_type DPCTLEvent_GetBackend(DPCTLSyclEventRef ERef)
cdef struct DPCTLEventVector
ctypedef DPCTLEventVector *DPCTLEventVectorRef
cdef void DPCTLEventVector_Delete(DPCTLEventVectorRef EVRef)
cdef size_t DPCTLEventVector_Size(DPCTLEventVectorRef EVRef)
cdef DPCTLSyclEventRef DPCTLEventVector_GetAt(
DPCTLEventVectorRef EVRef,
size_t index)
cdef DPCTLEventVectorRef DPCTLEvent_GetWaitList(
DPCTLSyclEventRef ERef)
cdef size_t DPCTLEvent_GetProfilingInfoSubmit(DPCTLSyclEventRef ERef)
cdef size_t DPCTLEvent_GetProfilingInfoStart(DPCTLSyclEventRef ERef)
cdef size_t DPCTLEvent_GetProfilingInfoEnd(DPCTLSyclEventRef ERef)
cdef extern from "syclinterface/dpctl_sycl_kernel_interface.h":
cdef size_t DPCTLKernel_GetNumArgs(const DPCTLSyclKernelRef KRef)
cdef void DPCTLKernel_Delete(DPCTLSyclKernelRef KRef)
cdef DPCTLSyclKernelRef DPCTLKernel_Copy(const DPCTLSyclKernelRef KRef)
cdef size_t DPCTLKernel_GetWorkGroupSize(const DPCTLSyclKernelRef KRef)
cdef size_t DPCTLKernel_GetPreferredWorkGroupSizeMultiple(
const DPCTLSyclKernelRef KRef
)
cdef size_t DPCTLKernel_GetPrivateMemSize(const DPCTLSyclKernelRef KRef)
cdef uint32_t DPCTLKernel_GetMaxNumSubGroups(const DPCTLSyclKernelRef KRef)
cdef uint32_t DPCTLKernel_GetMaxSubGroupSize(const DPCTLSyclKernelRef KRef)
cdef uint32_t DPCTLKernel_GetCompileNumSubGroups(
const DPCTLSyclKernelRef KRef
)
cdef uint32_t DPCTLKernel_GetCompileSubGroupSize(
const DPCTLSyclKernelRef KRef
)
cdef extern from "syclinterface/dpctl_sycl_platform_manager.h":
cdef struct DPCTLPlatformVector
ctypedef DPCTLPlatformVector *DPCTLPlatformVectorRef
cdef void DPCTLPlatformVector_Delete(DPCTLPlatformVectorRef)
cdef void DPCTLPlatformVector_Clear(DPCTLPlatformVectorRef)
cdef size_t DPCTLPlatformVector_Size(DPCTLPlatformVectorRef)
cdef DPCTLSyclPlatformRef DPCTLPlatformVector_GetAt(
DPCTLPlatformVectorRef,
size_t index)
cdef void DPCTLPlatformMgr_PrintInfo(const DPCTLSyclPlatformRef, size_t)
cdef const char *DPCTLPlatformMgr_GetInfo(
const DPCTLSyclPlatformRef, size_t
)
cdef extern from "syclinterface/dpctl_sycl_platform_interface.h":
cdef bool DPCTLPlatform_AreEq(
const DPCTLSyclPlatformRef, const DPCTLSyclPlatformRef
)
cdef DPCTLSyclPlatformRef DPCTLPlatform_Copy(const DPCTLSyclPlatformRef)
cdef DPCTLSyclPlatformRef DPCTLPlatform_Create()
cdef DPCTLSyclPlatformRef DPCTLPlatform_CreateFromSelector(
const DPCTLSyclDeviceSelectorRef)
cdef void DPCTLPlatform_Delete(DPCTLSyclPlatformRef)
cdef _backend_type DPCTLPlatform_GetBackend(const DPCTLSyclPlatformRef)
cdef const char *DPCTLPlatform_GetName(const DPCTLSyclPlatformRef)
cdef const char *DPCTLPlatform_GetVendor(const DPCTLSyclPlatformRef)
cdef const char *DPCTLPlatform_GetVersion(const DPCTLSyclPlatformRef)
cdef size_t DPCTLPlatform_Hash(const DPCTLSyclPlatformRef)
cdef DPCTLPlatformVectorRef DPCTLPlatform_GetPlatforms()
cdef DPCTLSyclContextRef DPCTLPlatform_GetDefaultContext(
const DPCTLSyclPlatformRef)
cdef DPCTLDeviceVectorRef DPCTLPlatform_GetDevices(
const DPCTLSyclPlatformRef PRef, _device_type DTy)
cdef DPCTLDeviceVectorRef DPCTLPlatform_GetCompositeDevices(
const DPCTLSyclPlatformRef PRef)
cdef extern from "syclinterface/dpctl_sycl_context_interface.h":
cdef DPCTLSyclContextRef DPCTLContext_Create(
const DPCTLSyclDeviceRef DRef,
error_handler_callback *handler,
int properties)
cdef DPCTLSyclContextRef DPCTLContext_CreateFromDevices(
const DPCTLDeviceVectorRef DVRef,
error_handler_callback *handler,
int properties)
cdef DPCTLSyclContextRef DPCTLContext_Copy(
const DPCTLSyclContextRef CRef)
cdef DPCTLDeviceVectorRef DPCTLContext_GetDevices(
const DPCTLSyclContextRef CRef)
cdef size_t DPCTLContext_DeviceCount(const DPCTLSyclContextRef CRef)
cdef bool DPCTLContext_AreEq(const DPCTLSyclContextRef CtxRef1,
const DPCTLSyclContextRef CtxRef2)
cdef size_t DPCTLContext_Hash(const DPCTLSyclContextRef CRef)
cdef _backend_type DPCTLContext_GetBackend(const DPCTLSyclContextRef)
cdef void DPCTLContext_Delete(DPCTLSyclContextRef CtxRef)
cdef DPCTLSyclPlatformRef DPCTLContext_GetPlatform(
const DPCTLSyclContextRef CRef)
cdef int *DPCTLContext_GetAtomicMemoryOrderCapabilities(
const DPCTLSyclContextRef CRef,
size_t *res_len)
cdef int *DPCTLContext_GetAtomicFenceOrderCapabilities(
const DPCTLSyclContextRef CRef,
size_t *res_len)
cdef int *DPCTLContext_GetAtomicMemoryScopeCapabilities(
const DPCTLSyclContextRef CRef,
size_t *res_len)
cdef int *DPCTLContext_GetAtomicFenceScopeCapabilities(
const DPCTLSyclContextRef CRef,
size_t *res_len)
cdef extern from "syclinterface/dpctl_sycl_kernel_bundle_interface.h":
ctypedef struct _spec_const "DPCTLSpecConst":
uint32_t id
size_t size
const void *value
cdef DPCTLSyclKernelBundleRef DPCTLKernelBundle_CreateFromSpirv(
const DPCTLSyclContextRef Ctx,
const DPCTLSyclDeviceRef Dev,
const void *IL,
size_t Length,
const char *CompileOpts,
size_t NumSpecConsts,
const _spec_const *SpecConsts)
cdef DPCTLSyclKernelBundleRef DPCTLKernelBundle_CreateFromOCLSource(
const DPCTLSyclContextRef Ctx,
const DPCTLSyclDeviceRef Dev,
const char *Source,
const char *CompileOpts)
cdef DPCTLSyclKernelRef DPCTLKernelBundle_GetKernel(
DPCTLSyclKernelBundleRef KBRef,
const char *KernelName)
cdef bool DPCTLKernelBundle_HasKernel(
DPCTLSyclKernelBundleRef KBRef, const char *KernelName
)
cdef void DPCTLKernelBundle_Delete(DPCTLSyclKernelBundleRef KBRef)
cdef DPCTLSyclKernelBundleRef DPCTLKernelBundle_Copy(
const DPCTLSyclKernelBundleRef KBRef)
cdef struct DPCTLBuildOptionList
cdef struct DPCTLKernelNameList
cdef struct DPCTLVirtualHeaderList
cdef struct DPCTLKernelBuildLog
ctypedef DPCTLBuildOptionList* DPCTLBuildOptionListRef
ctypedef DPCTLKernelNameList* DPCTLKernelNameListRef
ctypedef DPCTLVirtualHeaderList* DPCTLVirtualHeaderListRef
ctypedef DPCTLKernelBuildLog* DPCTLKernelBuildLogRef
cdef DPCTLBuildOptionListRef DPCTLBuildOptionList_Create()
cdef void DPCTLBuildOptionList_Delete(DPCTLBuildOptionListRef Ref)
cdef void DPCTLBuildOptionList_Append(DPCTLBuildOptionListRef Ref,
const char *Option)
cdef DPCTLKernelNameListRef DPCTLKernelNameList_Create()
cdef void DPCTLKernelNameList_Delete(DPCTLKernelNameListRef Ref)
cdef void DPCTLKernelNameList_Append(DPCTLKernelNameListRef Ref,
const char *Option)
cdef DPCTLVirtualHeaderListRef DPCTLVirtualHeaderList_Create()
cdef void DPCTLVirtualHeaderList_Delete(DPCTLVirtualHeaderListRef Ref)
cdef void DPCTLVirtualHeaderList_Append(DPCTLVirtualHeaderListRef Ref,
const char *Name,
const char *Content)
cdef DPCTLKernelBuildLogRef DPCTLKernelBuildLog_Create()
cdef void DPCTLKernelBuildLog_Delete(DPCTLKernelBuildLogRef Ref)
cdef const char *DPCTLKernelBuildLog_Get(DPCTLKernelBuildLogRef)
cdef bool DPCTLKernelBundle_CreateFromSYCLSource_Available()
cdef DPCTLSyclKernelBundleRef DPCTLKernelBundle_CreateFromSYCLSource(
const DPCTLSyclContextRef Ctx,
const DPCTLSyclDeviceRef Dev,
const char *Source,
DPCTLVirtualHeaderListRef Headers,
DPCTLKernelNameListRef Names,
DPCTLBuildOptionListRef BuildOptions,
DPCTLKernelBuildLogRef BuildLog)
cdef DPCTLSyclKernelRef DPCTLKernelBundle_GetSyclKernel(
DPCTLSyclKernelBundleRef KBRef,
const char *KernelName)
cdef bool DPCTLKernelBundle_HasSyclKernel(DPCTLSyclKernelBundleRef KBRef,
const char *KernelName)
cdef extern from "syclinterface/dpctl_sycl_queue_interface.h":
ctypedef struct _md_local_accessor "MDLocalAccessor":
size_t ndim
_arg_data_type dpctl_type_id
size_t dim0
size_t dim1
size_t dim2
cdef bool DPCTLQueue_AreEq(const DPCTLSyclQueueRef QRef1,
const DPCTLSyclQueueRef QRef2)
cdef DPCTLSyclQueueRef DPCTLQueue_Create(
const DPCTLSyclContextRef CRef,
const DPCTLSyclDeviceRef DRef,
error_handler_callback *handler,
int properties)
cdef DPCTLSyclQueueRef DPCTLQueue_CreateForDevice(
const DPCTLSyclDeviceRef dRef,
error_handler_callback *handler,
int properties)
cdef void DPCTLQueue_Delete(DPCTLSyclQueueRef QRef)
cdef DPCTLSyclQueueRef DPCTLQueue_Copy(DPCTLSyclQueueRef QRef)
cdef _backend_type DPCTLQueue_GetBackend(const DPCTLSyclQueueRef Q)
cdef DPCTLSyclContextRef DPCTLQueue_GetContext(const DPCTLSyclQueueRef Q)
cdef DPCTLSyclDeviceRef DPCTLQueue_GetDevice(const DPCTLSyclQueueRef Q)
cdef size_t DPCTLQueue_Hash(const DPCTLSyclQueueRef Q)
cdef DPCTLSyclEventRef DPCTLQueue_SubmitRange(
const DPCTLSyclKernelRef Ref,
const DPCTLSyclQueueRef QRef,
void **Args,
const _arg_data_type *ArgTypes,
size_t NArgs,
const size_t Range[3],
size_t NDims,
const DPCTLSyclEventRef *DepEvents,
size_t NDepEvents)
cdef DPCTLSyclEventRef DPCTLQueue_SubmitNDRange(
const DPCTLSyclKernelRef Ref,
const DPCTLSyclQueueRef QRef,
void **Args,
const _arg_data_type *ArgTypes,
size_t NArgs,
const size_t gRange[3],
const size_t lRange[3],
size_t NDims,
const DPCTLSyclEventRef *DepEvents,
size_t NDepEvents)
cdef void DPCTLQueue_Wait(const DPCTLSyclQueueRef QRef) nogil
cdef DPCTLSyclEventRef DPCTLQueue_Memcpy(
const DPCTLSyclQueueRef Q,
void *Dest,
const void *Src,
size_t Count)
cdef DPCTLSyclEventRef DPCTLQueue_MemcpyWithEvents(
const DPCTLSyclQueueRef Q,
void *Dest,
const void *Src,
size_t Count,
const DPCTLSyclEventRef *depEvents,
size_t depEventsCount)
cdef DPCTLSyclEventRef DPCTLQueue_CopyData(
const DPCTLSyclQueueRef Q,
void *Dest,
const void *Src,
size_t Count)
cdef DPCTLSyclEventRef DPCTLQueue_CopyDataWithEvents(
const DPCTLSyclQueueRef Q,
void *Dest,
const void *Src,
size_t Count,
const DPCTLSyclEventRef *depEvents,
size_t depEventsCount)
cdef DPCTLSyclEventRef DPCTLQueue_Fill8(
const DPCTLSyclQueueRef Q,
void *Dest,
uint8_t Val,
size_t Count)
cdef DPCTLSyclEventRef DPCTLQueue_Fill8WithEvents(
const DPCTLSyclQueueRef Q,
void *Dest,
uint8_t Val,
size_t Count,
const DPCTLSyclEventRef *depEvents,
size_t depEventsCount)
cdef DPCTLSyclEventRef DPCTLQueue_Fill16(
const DPCTLSyclQueueRef Q,
void *Dest,
uint16_t Val,
size_t Count)
cdef DPCTLSyclEventRef DPCTLQueue_Fill16WithEvents(
const DPCTLSyclQueueRef Q,
void *Dest,
uint16_t Val,
size_t Count,
const DPCTLSyclEventRef *depEvents,
size_t depEventsCount)
cdef DPCTLSyclEventRef DPCTLQueue_Fill32(
const DPCTLSyclQueueRef Q,
void *Dest,
uint32_t Val,
size_t Count)
cdef DPCTLSyclEventRef DPCTLQueue_Fill32WithEvents(
const DPCTLSyclQueueRef Q,
void *Dest,
uint32_t Val,
size_t Count,
const DPCTLSyclEventRef *depEvents,
size_t depEventsCount)
cdef DPCTLSyclEventRef DPCTLQueue_Fill64(
const DPCTLSyclQueueRef Q,
void *Dest,
uint64_t Val,
size_t Count)
cdef DPCTLSyclEventRef DPCTLQueue_Fill64WithEvents(
const DPCTLSyclQueueRef Q,
void *Dest,
uint64_t Val,
size_t Count,
const DPCTLSyclEventRef *depEvents,
size_t depEventsCount)
cdef DPCTLSyclEventRef DPCTLQueue_Fill128(
const DPCTLSyclQueueRef Q,
void *Dest,
uint64_t *Val,
size_t Count)
cdef DPCTLSyclEventRef DPCTLQueue_Fill128WithEvents(
const DPCTLSyclQueueRef Q,
void *Dest,
uint64_t *Val,
size_t Count,
const DPCTLSyclEventRef *depEvents,
size_t depEventsCount)
cdef DPCTLSyclEventRef DPCTLQueue_Memset(
const DPCTLSyclQueueRef Q,
void *Dest,
uint8_t Val,
size_t Count)
cdef DPCTLSyclEventRef DPCTLQueue_MemsetWithEvents(
const DPCTLSyclQueueRef Q,
void *Dest,
uint8_t Val,
size_t Count,
const DPCTLSyclEventRef *depEvents,
size_t depEventsCount)
cdef DPCTLSyclEventRef DPCTLQueue_Prefetch(
const DPCTLSyclQueueRef Q,
const void *Src,
size_t Count)
cdef DPCTLSyclEventRef DPCTLQueue_MemAdvise(
const DPCTLSyclQueueRef Q,
const void *Src,
size_t Count,
int Advice)
cdef bool DPCTLQueue_IsInOrder(const DPCTLSyclQueueRef QRef)
cdef DPCTLSyclEventRef DPCTLQueue_SubmitBarrier(
const DPCTLSyclQueueRef QRef)
cdef DPCTLSyclEventRef DPCTLQueue_SubmitBarrierForEvents(
const DPCTLSyclQueueRef QRef,
const DPCTLSyclEventRef *DepEvents,
size_t NDepEvents)
cdef bool DPCTLQueue_HasEnableProfiling(const DPCTLSyclQueueRef QRef)
cdef extern from "syclinterface/dpctl_sycl_usm_interface.h":
cdef DPCTLSyclUSMRef DPCTLmalloc_shared(
size_t size,
DPCTLSyclQueueRef QRef) nogil
cdef DPCTLSyclUSMRef DPCTLmalloc_host(
size_t size,
DPCTLSyclQueueRef QRef) nogil
cdef DPCTLSyclUSMRef DPCTLmalloc_device(
size_t size,
DPCTLSyclQueueRef QRef) nogil
cdef DPCTLSyclUSMRef DPCTLaligned_alloc_shared(
size_t alignment,
size_t size,
DPCTLSyclQueueRef QRef) nogil
cdef DPCTLSyclUSMRef DPCTLaligned_alloc_host(
size_t alignment,
size_t size,
DPCTLSyclQueueRef QRef) nogil
cdef DPCTLSyclUSMRef DPCTLaligned_alloc_device(
size_t alignment,
size_t size,
DPCTLSyclQueueRef QRef) nogil
cdef void DPCTLfree_with_queue(
DPCTLSyclUSMRef MRef,
DPCTLSyclQueueRef QRef)
cdef void DPCTLfree_with_context(
DPCTLSyclUSMRef MRef,
DPCTLSyclContextRef CRef)
cdef _usm_type DPCTLUSM_GetPointerType(
DPCTLSyclUSMRef MRef,
DPCTLSyclContextRef CRef)
cdef DPCTLSyclDeviceRef DPCTLUSM_GetPointerDevice(
DPCTLSyclUSMRef MRef,
DPCTLSyclContextRef CRef)
cdef extern from "syclinterface/dpctl_sycl_extension_interface.h":
cdef struct RawWorkGroupMemoryTy
ctypedef RawWorkGroupMemoryTy RawWorkGroupMemory
cdef struct DPCTLOpaqueWorkGroupMemory
ctypedef DPCTLOpaqueWorkGroupMemory *DPCTLSyclWorkGroupMemoryRef
cdef DPCTLSyclWorkGroupMemoryRef DPCTLWorkGroupMemory_Create(size_t nbytes)
cdef void DPCTLWorkGroupMemory_Delete(
DPCTLSyclWorkGroupMemoryRef Ref)
cdef bint DPCTLWorkGroupMemory_Available()
cdef bint DPCTLIPCMem_Available()
cdef struct DPCTLOpaqueRawKernelArg
ctypedef DPCTLOpaqueRawKernelArg *DPCTLSyclRawKernelArgRef
cdef DPCTLSyclRawKernelArgRef DPCTLRawKernelArg_Create(void* bytes,
size_t count)
cdef void DPCTLRawKernelArg_Delete(
DPCTLSyclRawKernelArgRef Ref)
cdef bint DPCTLRawKernelArg_Available()
cdef extern from "syclinterface/dpctl_sycl_ipc_memory_interface.h":
cdef int DPCTLIPCMem_GetHandle(
DPCTLSyclUSMRef Ptr,
DPCTLSyclContextRef CRef,
char **DataOut,
size_t *SizeOut)
cdef DPCTLSyclUSMRef DPCTLIPCMem_OpenHandle(
const char *HandleData,
size_t HandleDataSize,
DPCTLSyclContextRef CRef,
DPCTLSyclDeviceRef DRef)
cdef void DPCTLIPCMem_CloseHandle(
DPCTLSyclUSMRef MappedPtr,
DPCTLSyclContextRef CRef)
cdef void DPCTLIPCMem_FreeHandleData(char *Data)