-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathdpctl_sycl_device_interface.h
More file actions
795 lines (730 loc) · 25.1 KB
/
dpctl_sycl_device_interface.h
File metadata and controls
795 lines (730 loc) · 25.1 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
//===----- dpctl_sycl_device_interface.h - C API for sycl::device -*-C++-*- ==//
//
// Data Parallel Control (dpctl)
//
// Copyright 2020-2025 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.
//
//===----------------------------------------------------------------------===//
///
/// \file
/// This header declares a C interface to sycl::device. Not all of the device
/// API is exposed, only the bits needed in other places like context and queue
/// interfaces.
///
//===----------------------------------------------------------------------===//
#pragma once
#include "Support/DllExport.h"
#include "Support/ExternC.h"
#include "Support/MemOwnershipAttrs.h"
#include "dpctl_data_types.h"
#include "dpctl_sycl_device_manager.h"
#include "dpctl_sycl_enum_types.h"
#include "dpctl_sycl_types.h"
DPCTL_C_EXTERN_C_BEGIN
/**
* @defgroup DeviceInterface Device class C wrapper
*/
/*!
* @brief Returns a copy of the DPCTLSyclDeviceRef object.
*
* @param DRef DPCTLSyclDeviceRef object to be copied.
* @return A new DPCTLSyclDeviceRef created by copying the passed in
* DPCTLSyclDeviceRef object.
* @ingroup DeviceInterface
*/
DPCTL_API
__dpctl_give DPCTLSyclDeviceRef
DPCTLDevice_Copy(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Returns a new DPCTLSyclDeviceRef opaque object wrapping a SYCL device
* instance as a host device.
*
* @return An opaque pointer to a ``sycl::device`` created as an instance of
* the host device.
* @ingroup DeviceInterface
*/
DPCTL_API
__dpctl_give DPCTLSyclDeviceRef DPCTLDevice_Create(void);
/*!
* @brief Returns a new DPCTLSyclDeviceRef opaque object created using the
* provided device_selector.
*
* @param DSRef An opaque pointer to a ``sycl::device_selector``.
* @return Returns an opaque pointer to a SYCL device created using the
* device_selector, if the requested device could not be created a
* nullptr is returned.
* @ingroup DeviceInterface
*/
DPCTL_API
__dpctl_give DPCTLSyclDeviceRef DPCTLDevice_CreateFromSelector(
__dpctl_keep const DPCTLSyclDeviceSelectorRef DSRef);
/*!
* @brief Deletes a DPCTLSyclDeviceRef pointer after casting to to sycl::device.
*
* @param DRef The DPCTLSyclDeviceRef pointer to be freed.
* @ingroup DeviceInterface
*/
DPCTL_API
void DPCTLDevice_Delete(__dpctl_take DPCTLSyclDeviceRef DRef);
/*!
* @brief Returns true if this SYCL device is an OpenCL device and the device
* type is ``sycl::info::device_type::accelerator``.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return True if the device type is an accelerator, else False.
* @ingroup DeviceInterface
*/
DPCTL_API
bool DPCTLDevice_IsAccelerator(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Returns true if this SYCL device is an OpenCL device and the device
* type is ``sycl::info::device_type::cpu``.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return True if the device type is a cpu, else False.
* @ingroup DeviceInterface
*/
DPCTL_API
bool DPCTLDevice_IsCPU(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Returns true if this SYCL device is an OpenCL device and the device
* type is ``sycl::info::device_type::gpu``.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return True if the device type is a gpu, else False.
* @ingroup DeviceInterface
*/
DPCTL_API
bool DPCTLDevice_IsGPU(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Returns the backend for the device.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return A DPCTLSyclBackendType enum value representing the
* ``sycl::backend`` for the device.
* @ingroup DeviceInterface
*/
DPCTL_API
DPCTLSyclBackendType
DPCTLDevice_GetBackend(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Returns the DPCTLSyclDeviceType enum value for the DPCTLSyclDeviceRef
* argument.
*
* @param DRef Opaque pointer to a sycl::device
* @return The DPCTLSyclDeviceType value corresponding to the device.
* @ingroup DeviceInterface
*/
DPCTL_API
DPCTLSyclDeviceType
DPCTLDevice_GetDeviceType(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Returns the OpenCL software driver version as a C string.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return A C string in the form major_number.minor.number that corresponds
* to the OpenCL driver version if this is a OpenCL device.
* @ingroup DeviceInterface
*/
DPCTL_API
__dpctl_give const char *
DPCTLDevice_GetDriverVersion(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over device.get_info<info::device::max_compute_units>().
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the valid result if device exists else returns 0.
* @ingroup DeviceInterface
*/
DPCTL_API
uint32_t
DPCTLDevice_GetMaxComputeUnits(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over device.get_info<info::device::global_mem_size>().
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the valid result if device exists else returns 0.
* @ingroup DeviceInterface
*/
DPCTL_API
uint64_t
DPCTLDevice_GetGlobalMemSize(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over device.get_info<info::device::local_mem_size>().
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the valid result if device exists else returns 0.
* @ingroup DeviceInterface
*/
DPCTL_API
uint64_t
DPCTLDevice_GetLocalMemSize(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper for get_info<info::device::max_work_item_dimensions>().
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the valid result if device exists else returns 0.
* @ingroup DeviceInterface
*/
DPCTL_API
uint32_t
DPCTLDevice_GetMaxWorkItemDims(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper for get_info<info::device::max_work_item_sizes<1>>().
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the valid result if device exists else returns NULL.
* @ingroup DeviceInterface
*/
DPCTL_API
__dpctl_keep size_t *
DPCTLDevice_GetMaxWorkItemSizes1d(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper for get_info<info::device::max_work_item_sizes<2>>().
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the valid result if device exists else returns NULL.
* @ingroup DeviceInterface
*/
DPCTL_API
__dpctl_keep size_t *
DPCTLDevice_GetMaxWorkItemSizes2d(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper for get_info<info::device::max_work_item_sizes<3>>().
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the valid result if device exists else returns NULL.
* @ingroup DeviceInterface
*/
DPCTL_API
__dpctl_keep size_t *
DPCTLDevice_GetMaxWorkItemSizes3d(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper for get_info<info::device::max_work_group_size>().
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the valid result if device exists else returns 0.
* @ingroup DeviceInterface
*/
DPCTL_API
size_t
DPCTLDevice_GetMaxWorkGroupSize(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over device.get_info<info::device::max_num_sub_groups>.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the valid result if device exists else returns 0.
* @ingroup DeviceInterface
*/
DPCTL_API
uint32_t
DPCTLDevice_GetMaxNumSubGroups(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Returns the ``sycl::platform`` for the device as DPCTLSyclPlatformRef
* opaque pointer.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return An opaque pointer to the sycl::platform for the device.
* @ingroup DeviceInterface
*/
DPCTL_API
__dpctl_give DPCTLSyclPlatformRef
DPCTLDevice_GetPlatform(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Returns a C string for the device name.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return A C string containing the OpenCL device name.
* @ingroup DeviceInterface
*/
DPCTL_API
__dpctl_give const char *
DPCTLDevice_GetName(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Returns a C string corresponding to the vendor name.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return A C string containing the OpenCL device vendor name.
* @ingroup DeviceInterface
*/
DPCTL_API
__dpctl_give const char *
DPCTLDevice_GetVendor(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Checks if two DPCTLSyclDeviceRef objects point to the same
* sycl::device.
*
* @param DRef1 First opaque pointer to a ``sycl::device``.
* @param DRef2 Second opaque pointer to a ``sycl::device``.
* @return True if the underlying sycl::device are same, false otherwise.
* @ingroup DeviceInterface
*/
DPCTL_API
bool DPCTLDevice_AreEq(__dpctl_keep const DPCTLSyclDeviceRef DRef1,
__dpctl_keep const DPCTLSyclDeviceRef DRef2);
/*!
* @brief Checks if device has aspect.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @param AT DPCTLSyclAspectType of ``device::aspect``.
* @return True if sycl::device has device::aspect, else false.
* @ingroup DeviceInterface
*/
DPCTL_API
bool DPCTLDevice_HasAspect(__dpctl_keep const DPCTLSyclDeviceRef DRef,
DPCTLSyclAspectType AT);
/*!
* @brief Wrapper over
* device.get_info<info::device::max_read_image_args>().
*
* @param DRef Opaque pointer to a sycl::device
* @return Returns the maximum number of simultaneous image objects that
* can be read from by a kernel. The minimum value is 128 if the
* SYCL device has aspect::image.
*/
DPCTL_API
uint32_t
DPCTLDevice_GetMaxReadImageArgs(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::max_write_image_args>().
*
* @param DRef Opaque pointer to a sycl::device
* @return Returns the maximum number of simultaneous image objects that
* can be written to by a kernel. The minimum value is 8 if the SYCL
* device has aspect::image.
*/
DPCTL_API
uint32_t
DPCTLDevice_GetMaxWriteImageArgs(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::image2d_max_width>().
*
* @param DRef Opaque pointer to a sycl::device
* @return Returns the maximum width of a 2D image
* or 1D image in pixels. The minimum value is
* 8192 if the SYCL device has aspect::image.
*/
DPCTL_API
size_t
DPCTLDevice_GetImage2dMaxWidth(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::image2d_max_height>().
*
* @param DRef Opaque pointer to a sycl::device
* @return Returns the maximum height of a 2D image
* or 1D image in pixels. The minimum value is
* 8192 if the SYCL device has aspect::image.
*/
DPCTL_API
size_t
DPCTLDevice_GetImage2dMaxHeight(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::image3d_max_width>().
*
* @param DRef Opaque pointer to a sycl::device
* @return Returns the maximum width of a 3D image
* in pixels. The minimum value is
* 2048 if the SYCL device has aspect::image.
*/
DPCTL_API
size_t
DPCTLDevice_GetImage3dMaxWidth(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::image3d_max_height>().
*
* @param DRef Opaque pointer to a sycl::device
* @return Returns the maximum height of a 3D image
* The minimum value is
* 2048 if the SYCL device has aspect::image.
*/
DPCTL_API
size_t
DPCTLDevice_GetImage3dMaxHeight(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::image3d_max_depth>().
*
* @param DRef Opaque pointer to a sycl::device
* @return Returns the maximum depth of a 3D image
* The minimum value is
* 2048 if the SYCL device has aspect::image.
*/
DPCTL_API
size_t
DPCTLDevice_GetImage3dMaxDepth(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Returns a vector of sub devices
* partitioned from this SYCL device based on the count parameter. The returned
* vector contains as many sub devices as can be created such that each sub
* device contains count compute units. If the device’s total number of compute
* units is not evenly divided by count, then the remaining compute units are
* not included in any of the sub devices.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @param count Count compute units that need to contains in
* subdevices
* @return A #DPCTLDeviceVectorRef containing #DPCTLSyclDeviceRef objects
* @ingroup DeviceInterface
*/
DPCTL_API
__dpctl_give DPCTLDeviceVectorRef
DPCTLDevice_CreateSubDevicesEqually(__dpctl_keep const DPCTLSyclDeviceRef DRef,
size_t count);
/*!
* @brief Returns a vector of sub devices
* partitioned from this SYCL device based on the counts parameter. For each
* non-zero value M in the counts vector, a sub device with M compute units
* is created.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @param counts Array with count compute units
* that need to contains in subdevices
* @param ncounts Number of counts
* @return A #DPCTLDeviceVectorRef containing #DPCTLSyclDeviceRef objects
* @ingroup DeviceInterface
*/
DPCTL_API
__dpctl_give DPCTLDeviceVectorRef
DPCTLDevice_CreateSubDevicesByCounts(__dpctl_keep const DPCTLSyclDeviceRef DRef,
__dpctl_keep size_t *counts,
size_t ncounts);
/*!
* @brief Returns a vector of sub-devices
* partitioned from this SYCL device by affinity domain based on the domain
* parameter.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @param PartAffDomTy A DPCTLPartitionAffinityDomainType enum value
*
* @return A #DPCTLDeviceVectorRef containing #DPCTLSyclDeviceRef objects
* @ingroup DeviceInterface
*/
DPCTL_API
__dpctl_give DPCTLDeviceVectorRef DPCTLDevice_CreateSubDevicesByAffinity(
__dpctl_keep const DPCTLSyclDeviceRef DRef,
DPCTLPartitionAffinityDomainType PartAffDomTy);
/*!
* @brief Wrapper over
* device.get_info<info::device::sub_group_independent_forward_progress>.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns true if the device supports independent forward progress of
* sub-groups with respect to other sub-groups in the same work-group.
* @ingroup DeviceInterface
*/
DPCTL_API
bool DPCTLDevice_GetSubGroupIndependentForwardProgress(
__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::preferred_vector_width_char>.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the preferred native vector width size for built-in scalar
* types that can be put into vectors.
* @ingroup DeviceInterface
*/
DPCTL_API
uint32_t DPCTLDevice_GetPreferredVectorWidthChar(
__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::preferred_vector_width_short>.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the preferred native vector width size for built-in scalar
* types that can be put into vectors.
* @ingroup DeviceInterface
*/
DPCTL_API
uint32_t DPCTLDevice_GetPreferredVectorWidthShort(
__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::preferred_vector_width_int>.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the preferred native vector width size for built-in scalar
* types that can be put into vectors.
* @ingroup DeviceInterface
*/
DPCTL_API
uint32_t DPCTLDevice_GetPreferredVectorWidthInt(
__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::preferred_vector_width_long>.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the preferred native vector width size for built-in scalar
* types that can be put into vectors.
* @ingroup DeviceInterface
*/
DPCTL_API
uint32_t DPCTLDevice_GetPreferredVectorWidthLong(
__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::preferred_vector_width_float>.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the preferred native vector width size for built-in scalar
* type.
* @ingroup DeviceInterface
*/
DPCTL_API
uint32_t DPCTLDevice_GetPreferredVectorWidthFloat(
__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::preferred_vector_width_double>.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the preferred native vector width size for built-in scalar
* types that can be put into vectors.
* @ingroup DeviceInterface
*/
DPCTL_API
uint32_t DPCTLDevice_GetPreferredVectorWidthDouble(
__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* ``device.get_info<info::device::preferred_vector_width_half>``.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the preferred native vector width size for built-in scalar
* types that can be put into vectors.
* @ingroup DeviceInterface
*/
DPCTL_API
uint32_t DPCTLDevice_GetPreferredVectorWidthHalf(
__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::native_vector_width_char>.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the native ISA vector width size for built-in scalar
* types that can be put into vectors.
* @ingroup DeviceInterface
*/
DPCTL_API
uint32_t DPCTLDevice_GetNativeVectorWidthChar(
__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::native_vector_width_short>.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the native ISA vector width size for built-in scalar
* types that can be put into vectors.
* @ingroup DeviceInterface
*/
DPCTL_API
uint32_t DPCTLDevice_GetNativeVectorWidthShort(
__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::native_vector_width_int>.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the native ISA vector width size for built-in scalar
* types that can be put into vectors.
* @ingroup DeviceInterface
*/
DPCTL_API
uint32_t
DPCTLDevice_GetNativeVectorWidthInt(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::native_vector_width_long>.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the native ISA vector width size for built-in scalar
* types that can be put into vectors.
* @ingroup DeviceInterface
*/
DPCTL_API
uint32_t DPCTLDevice_GetNativeVectorWidthLong(
__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::native_vector_width_float>.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the native ISA vector width size for built-in scalar
* type.
* @ingroup DeviceInterface
*/
DPCTL_API
uint32_t DPCTLDevice_GetNativeVectorWidthFloat(
__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::native_vector_width_double>.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the native ISA vector width size for built-in scalar
* types that can be put into vectors.
* @ingroup DeviceInterface
*/
DPCTL_API
uint32_t DPCTLDevice_GetNativeVectorWidthDouble(
__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* ``device.get_info<info::device::native_vector_width_half>``.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return Returns the native ISA vector width size for built-in scalar
* types that can be put into vectors.
* @ingroup DeviceInterface
*/
DPCTL_API
uint32_t DPCTLDevice_GetNativeVectorWidthHalf(
__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::parent_device>
*
* @param DRef Opaque pointer to a sycl::device
* @return Returns an opaque pointer to the parent device for a sub-device,
* or nullptr otherwise.
*/
DPCTL_API
__dpctl_give DPCTLSyclDeviceRef
DPCTLDevice_GetParentDevice(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::partition_max_sub_devices>
*
* @param DRef Opaque pointer to a sycl::device
* @return Returns the maximum number of sub-devices that can be created
* when this device is partitioned.
*/
DPCTL_API
uint32_t DPCTLDevice_GetPartitionMaxSubDevices(
__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* std::hash<sycl::device>'s operator()
*
* @param DRef Opaque pointer to a sycl::device
* @return Returns hash value.
*/
DPCTL_API
size_t DPCTLDevice_Hash(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::profiling_timer_resolution>
*
* @param DRef Opaque pointer to a sycl::device
* @return Returns the resolution of device timer in nanoseconds.
*/
DPCTL_API
size_t DPCTLDevice_GetProfilingTimerResolution(
__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::global_mem_cache_line_size>
*
* @param DRef Opaque pointer to a sycl::device
* @return Returns the size of global memory cache line in bytes as uint32_t.
*/
DPCTL_API
uint32_t DPCTLDevice_GetGlobalMemCacheLineSize(
__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::max_clock_frequency>
*
* @param DRef Opaque pointer to a sycl::device
* @return Returns the maximum clock frequency in MHz as uint32_t.
*/
DPCTL_API
uint32_t
DPCTLDevice_GetMaxClockFrequency(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::max_mem_alloc_size>
*
* @param DRef Opaque pointer to a sycl::device
* @return Returns the maximum size of memory object in bytes as uint64_t.
*/
DPCTL_API
uint64_t
DPCTLDevice_GetMaxMemAllocSize(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::global_mem_cache_size>
*
* @param DRef Opaque pointer to a sycl::device
* @return Returns the size of global memory cache in bytes as uint64_t.
*/
DPCTL_API
uint64_t
DPCTLDevice_GetGlobalMemCacheSize(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper over
* device.get_info<info::device::global_mem_cache_type>
*
* @param DRef Opaque pointer to a sycl::device
* @return Returns the type of global memory cache supported.
*/
DPCTL_API
DPCTLGlobalMemCacheType
DPCTLDevice_GetGlobalMemCacheType(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Wrapper for get_info<info::device::sub_group_sizes>().
*
* @param DRef Opaque pointer to a ``sycl::device``
* @param res_len Populated with size of the returned array
* @return Returns the valid result if device exists else returns NULL.
* @ingroup DeviceInterface
*/
DPCTL_API
__dpctl_keep size_t *
DPCTLDevice_GetSubGroupSizes(__dpctl_keep const DPCTLSyclDeviceRef DRef,
size_t *res_len);
/*!
* @brief Wrapper over
* device.get_info<info::device::parent_device>
*
* @param DRef Opaque pointer to a sycl::device
* @return Returns an opaque pointer to the composite device for a
* component device, or nullptr if the device is not a component device.
*/
DPCTL_API
__dpctl_give DPCTLSyclDeviceRef
DPCTLDevice_GetCompositeDevice(__dpctl_keep const DPCTLSyclDeviceRef DRef);
/*!
* @brief Returns a vector of component devices that are contained by the
* provided composite device. If the device is not a composite device,
* returns an empty vector.
*
* @param DRef Opaque pointer to a ``sycl::device``
* @return A #DPCTLDeviceVectorRef containing component
* #DPCTLSyclDeviceRef objects
* @ingroup DeviceInterface
*/
DPCTL_API
__dpctl_give DPCTLDeviceVectorRef
DPCTLDevice_GetComponentDevices(__dpctl_keep const DPCTLSyclDeviceRef DRef);
DPCTL_C_EXTERN_C_END