@@ -393,116 +393,199 @@ cdef class SyclDevice(_SyclDevice):
393
393
394
394
@property
395
395
def has_aspect_host (self ):
396
- " Returns True if this device is a host device, False otherwise"
396
+ """ Returns True if this device is a host device, False otherwise.
397
+
398
+ Returns:
399
+ bool: Indicates if the device is a host device.
400
+ """
397
401
cdef _aspect_type AT = _aspect_type._host
398
402
return DPCTLDevice_HasAspect(self ._device_ref, AT)
399
403
400
404
@property
401
405
def has_aspect_cpu (self ):
402
- " Returns True if this device is a CPU device, False otherwise"
406
+ """ Returns True if this device is a CPU device, False otherwise.
407
+
408
+ Returns:
409
+ bool: Indicates if the device is a cpu.
410
+ """
403
411
cdef _aspect_type AT = _aspect_type._cpu
404
412
return DPCTLDevice_HasAspect(self ._device_ref, AT)
405
413
406
414
@property
407
415
def has_aspect_gpu (self ):
408
- " Returns True if this device is a GPU device, False otherwise"
416
+ """ Returns True if this device is a GPU device, False otherwise.
417
+
418
+ Returns:
419
+ bool: Indicates if the device is a gpu.
420
+ """
409
421
cdef _aspect_type AT = _aspect_type._gpu
410
422
return DPCTLDevice_HasAspect(self ._device_ref, AT)
411
423
412
424
@property
413
425
def has_aspect_accelerator (self ):
414
- " Returns True if this device is an accelerator device, False otherwise"
426
+ """ Returns True if this device is an accelerator device, False
427
+ otherwise.
428
+
429
+ SYCL considers an accelerator to be a device that usually uses a
430
+ peripheral interconnect for communication.
431
+
432
+ Returns:
433
+ bool: Indicates if the device is an accelerator.
434
+ """
415
435
cdef _aspect_type AT = _aspect_type._accelerator
416
436
return DPCTLDevice_HasAspect(self ._device_ref, AT)
417
437
418
438
@property
419
439
def has_aspect_custom (self ):
420
- " Returns True if this device is a custom device, False otherwise"
440
+ """ Returns True if this device is a custom device, False otherwise.
441
+
442
+ A custom device can be a dedicated accelerator that can use the
443
+ SYCL API, but programmable kernels cannot be dispatched to the device,
444
+ only fixed functionality is available. Refer SYCL spec for more details.
445
+
446
+ Returns:
447
+ bool: Indicates if the device is a custom SYCL device.
448
+ """
421
449
cdef _aspect_type AT = _aspect_type._custom
422
450
return DPCTLDevice_HasAspect(self ._device_ref, AT)
423
451
424
452
@property
425
453
def has_aspect_fp16 (self ):
426
- """ Returns True if kernels submitted to this device
427
- may use 16-bit floating point types, False otherwise
454
+ """ Returns True if the device supports half-precision floating point
455
+ operations, False otherwise.
456
+
457
+ Returns:
458
+ bool: Indicates that the device supports half precision floating
459
+ point operations.
428
460
"""
429
461
cdef _aspect_type AT = _aspect_type._fp16
430
462
return DPCTLDevice_HasAspect(self ._device_ref, AT)
431
463
432
464
@property
433
465
def has_aspect_fp64 (self ):
434
- """ Returns True if kernels submitted to this device
435
- may use 64-bit floating point types, False otherwise
466
+ """ Returns True if the device supports 64-bit precision floating point
467
+ operations, False otherwise.
468
+
469
+ Returns:
470
+ bool: Indicates that the device supports 64-bit precision floating
471
+ point operations.
436
472
"""
437
473
cdef _aspect_type AT = _aspect_type._fp64
438
474
return DPCTLDevice_HasAspect(self ._device_ref, AT)
439
475
440
476
@property
441
477
def has_aspect_atomic64 (self ):
442
- """ Returns True if kernels submitted to this device
443
- may perform 64-bit atomic operations, False otherwise
478
+ """ Returns true if the device supports a basic set of atomic
479
+ operations, False otherwise.
480
+
481
+ Indicates that the device supports the following atomic operations on
482
+ 64-bit values:
483
+ - atomic::load
484
+ - atomic::store
485
+ - atomic::fetch_add
486
+ - atomic::fetch_sub
487
+ - atomic::exchange
488
+ - atomic::compare_exchange_strong
489
+ - atomic::compare_exchange_weak
490
+
491
+ Returns:
492
+ bool: Indicates that the device supports a basic set of atomic
493
+ operations on 64-bit values.
444
494
"""
445
495
cdef _aspect_type AT = _aspect_type._atomic64
446
496
return DPCTLDevice_HasAspect(self ._device_ref, AT)
447
497
448
498
@property
449
499
def has_aspect_image (self ):
450
- """ Returns True if this device supports images, False otherwise
500
+ """ Returns True if the device supports images, False otherwise (refer
501
+ Sec 4.7.3 of SYCL 2020 spec).
502
+
503
+ Returns:
504
+ bool: Indicates that the device supports images
451
505
"""
452
506
cdef _aspect_type AT = _aspect_type._image
453
507
return DPCTLDevice_HasAspect(self ._device_ref, AT)
454
508
455
509
@property
456
510
def has_aspect_online_compiler (self ):
457
511
""" Returns True if this device supports online compilation of
458
- device code, False otherwise
512
+ device code, False otherwise.
513
+
514
+ Returns:
515
+ bool: Indicates that the device supports online compilation of
516
+ device code.
459
517
"""
460
518
cdef _aspect_type AT = _aspect_type._online_compiler
461
519
return DPCTLDevice_HasAspect(self ._device_ref, AT)
462
520
463
521
@property
464
522
def has_aspect_online_linker (self ):
465
523
""" Returns True if this device supports online linking of
466
- device code, False otherwise
524
+ device code, False otherwise.
525
+
526
+ Returns:
527
+ bool: Indicates that the device supports online linking of device
528
+ code.
467
529
"""
468
530
cdef _aspect_type AT = _aspect_type._online_linker
469
531
return DPCTLDevice_HasAspect(self ._device_ref, AT)
470
532
471
533
@property
472
534
def has_aspect_queue_profiling (self ):
473
535
""" Returns True if this device supports queue profiling,
474
- False otherwise
536
+ False otherwise.
537
+
538
+ Returns:
539
+ bool: Indicates that the device supports queue profiling.
475
540
"""
476
541
cdef _aspect_type AT = _aspect_type._queue_profiling
477
542
return DPCTLDevice_HasAspect(self ._device_ref, AT)
478
543
479
544
@property
480
545
def has_aspect_usm_device_allocations (self ):
481
546
""" Returns True if this device supports explicit USM allocations,
482
- False otherwise
547
+ False otherwise (refer Siction 4.8 of SYCL 2020 specs).
548
+
549
+ Returns:
550
+ bool: Indicates that the device supports explicit USM allocations.
483
551
"""
484
552
cdef _aspect_type AT = _aspect_type._usm_device_allocations
485
553
return DPCTLDevice_HasAspect(self ._device_ref, AT)
486
554
487
555
@property
488
556
def has_aspect_usm_host_allocations (self ):
489
557
""" Returns True if this device can access USM-host memory,
490
- False otherwise
558
+ False otherwise (refer Siction 4.8 of SYCL 2020 specs).
559
+
560
+ Returns:
561
+ bool: Indicates that the device can access USM memory
562
+ allocated via ``usm::alloc::host``.
491
563
"""
492
564
cdef _aspect_type AT = _aspect_type._usm_host_allocations
493
565
return DPCTLDevice_HasAspect(self ._device_ref, AT)
494
566
495
567
@property
496
568
def has_aspect_usm_shared_allocations (self ):
497
569
""" Returns True if this device supports USM-shared memory
498
- allocated on the same device, False otherwise
570
+ allocated on the same device, False otherwise.
571
+
572
+ Returns:
573
+ bool: Indicates that the device supports USM memory
574
+ allocated via ``usm::alloc::shared``.
499
575
"""
500
576
cdef _aspect_type AT = _aspect_type._usm_shared_allocations
501
577
return DPCTLDevice_HasAspect(self ._device_ref, AT)
502
578
503
579
@property
504
580
def has_aspect_usm_restricted_shared_allocations (self ):
505
- """ Deprecated property, do not use.
581
+ """ Returns True if this device supports USM memory
582
+ allocated as restricted USM, False otherwise.
583
+
584
+ Returns:
585
+ bool: Indicates that the device supports USM memory allocated via
586
+ ``usm::alloc::shared`` as restricted USM.
587
+
588
+ .. deprecated:: 0.14
506
589
"""
507
590
cdef _aspect_type AT = _aspect_type._usm_restricted_shared_allocations
508
591
return DPCTLDevice_HasAspect(self ._device_ref, AT)
@@ -511,7 +594,11 @@ cdef class SyclDevice(_SyclDevice):
511
594
def has_aspect_usm_system_allocations (self ):
512
595
""" Returns True if system allocator may be used instead of SYCL USM
513
596
allocation mechanism for USM-shared allocations on this device,
514
- False otherwise
597
+ False otherwise.
598
+
599
+ Returns:
600
+ bool: Indicates that system allocator may be used instead of SYCL
601
+ ``usm::alloc::shared``.
515
602
"""
516
603
cdef _aspect_type AT = _aspect_type._usm_system_allocations
517
604
return DPCTLDevice_HasAspect(self ._device_ref, AT)
0 commit comments