3
3
# SPDX-License-Identifier: Apache-2.0
4
4
5
5
"""
6
- Implements the SPIR-V overloads for the kernel_api.atomic_ref class methods.
6
+ Implements the SPIR-V overloads for the kernel_api.AtomicRef class methods.
7
7
"""
8
8
9
9
from llvmlite import ir as llvmir
15
15
from numba_dpex .core .targets .kernel_target import CC_SPIR_FUNC , LLVM_SPIRV_ARGS
16
16
from numba_dpex .core .types import USMNdArray
17
17
from numba_dpex .experimental .flag_enum import FlagEnum
18
+ from numba_dpex .kernel_api import (
19
+ AddressSpace ,
20
+ AtomicRef ,
21
+ MemoryOrder ,
22
+ MemoryScope ,
23
+ )
18
24
19
25
from ..dpcpp_types import AtomicRefType
20
- from ..kernel_iface import AddressSpace , AtomicRef , MemoryOrder , MemoryScope
21
26
from ..target import DPEX_KERNEL_EXP_TARGET_NAME
22
27
from ._spv_atomic_inst_helper import (
23
28
get_atomic_inst_name ,
@@ -358,7 +363,7 @@ def ol_atomic_ref(
358
363
address_space = AddressSpace .GLOBAL ,
359
364
):
360
365
"""Overload of the constructor for the class
361
- class:`numba_dpex.experimental.kernel_iface .AtomicRef`.
366
+ class:`numba_dpex.kernel_api .AtomicRef`.
362
367
363
368
Raises:
364
369
errors.TypingError: If the `ref` argument is not a UsmNdArray type.
@@ -436,8 +441,7 @@ def ol_atomic_ref_ctor_impl(
436
441
437
442
@overload_method (AtomicRefType , "fetch_add" , target = DPEX_KERNEL_EXP_TARGET_NAME )
438
443
def ol_fetch_add (atomic_ref , val ):
439
- """SPIR-V overload for
440
- :meth:`numba_dpex.experimental.kernel_iface.AtomicRef.fetch_add`.
444
+ """SPIR-V overload for :meth:`numba_dpex.kernel_api.AtomicRef.fetch_add`.
441
445
442
446
Generates the same LLVM IR instruction as dpcpp for the
443
447
`atomic_ref::fetch_add` function.
@@ -461,8 +465,7 @@ def ol_fetch_add_impl(atomic_ref, val):
461
465
462
466
@overload_method (AtomicRefType , "fetch_sub" , target = DPEX_KERNEL_EXP_TARGET_NAME )
463
467
def ol_fetch_sub (atomic_ref , val ):
464
- """SPIR-V overload for
465
- :meth:`numba_dpex.experimental.kernel_iface.AtomicRef.fetch_sub`.
468
+ """SPIR-V overload for :meth:`numba_dpex.kernel_api.AtomicRef.fetch_sub`.
466
469
467
470
Generates the same LLVM IR instruction as dpcpp for the
468
471
`atomic_ref::fetch_sub` function.
@@ -486,8 +489,7 @@ def ol_fetch_sub_impl(atomic_ref, val):
486
489
487
490
@overload_method (AtomicRefType , "fetch_min" , target = DPEX_KERNEL_EXP_TARGET_NAME )
488
491
def ol_fetch_min (atomic_ref , val ):
489
- """SPIR-V overload for
490
- :meth:`numba_dpex.experimental.kernel_iface.AtomicRef.fetch_min`.
492
+ """SPIR-V overload for :meth:`numba_dpex.kernel_api.AtomicRef.fetch_min`.
491
493
492
494
Generates the same LLVM IR instruction as dpcpp for the
493
495
`atomic_ref::fetch_min` function.
@@ -511,8 +513,7 @@ def ol_fetch_min_impl(atomic_ref, val):
511
513
512
514
@overload_method (AtomicRefType , "fetch_max" , target = DPEX_KERNEL_EXP_TARGET_NAME )
513
515
def ol_fetch_max (atomic_ref , val ):
514
- """SPIR-V overload for
515
- :meth:`numba_dpex.experimental.kernel_iface.AtomicRef.fetch_max`.
516
+ """SPIR-V overload for :meth:`numba_dpex.kernel_api.AtomicRef.fetch_max`.
516
517
517
518
Generates the same LLVM IR instruction as dpcpp for the
518
519
`atomic_ref::fetch_max` function.
@@ -536,8 +537,7 @@ def ol_fetch_max_impl(atomic_ref, val):
536
537
537
538
@overload_method (AtomicRefType , "fetch_and" , target = DPEX_KERNEL_EXP_TARGET_NAME )
538
539
def ol_fetch_and (atomic_ref , val ):
539
- """SPIR-V overload for
540
- :meth:`numba_dpex.experimental.kernel_iface.AtomicRef.fetch_and`.
540
+ """SPIR-V overload for :meth:`numba_dpex.kernel_api.AtomicRef.fetch_and`.
541
541
542
542
Generates the same LLVM IR instruction as dpcpp for the
543
543
`atomic_ref::fetch_and` function.
@@ -566,8 +566,7 @@ def ol_fetch_and_impl(atomic_ref, val):
566
566
567
567
@overload_method (AtomicRefType , "fetch_or" , target = DPEX_KERNEL_EXP_TARGET_NAME )
568
568
def ol_fetch_or (atomic_ref , val ):
569
- """SPIR-V overload for
570
- :meth:`numba_dpex.experimental.kernel_iface.AtomicRef.fetch_or`.
569
+ """SPIR-V overload for :meth:`numba_dpex.kernel_api.AtomicRef.fetch_or`.
571
570
572
571
Generates the same LLVM IR instruction as dpcpp for the
573
572
`atomic_ref::fetch_or` function.
@@ -596,8 +595,7 @@ def ol_fetch_or_impl(atomic_ref, val):
596
595
597
596
@overload_method (AtomicRefType , "fetch_xor" , target = DPEX_KERNEL_EXP_TARGET_NAME )
598
597
def ol_fetch_xor (atomic_ref , val ):
599
- """SPIR-V overload for
600
- :meth:`numba_dpex.experimental.kernel_iface.AtomicRef.fetch_xor`.
598
+ """SPIR-V overload for :meth:`numba_dpex.kernel_api.AtomicRef.fetch_xor`.
601
599
602
600
Generates the same LLVM IR instruction as dpcpp for the
603
601
`atomic_ref::fetch_xor` function.
@@ -626,8 +624,7 @@ def ol_fetch_xor_impl(atomic_ref, val):
626
624
627
625
@overload_method (AtomicRefType , "load" , target = DPEX_KERNEL_EXP_TARGET_NAME )
628
626
def ol_load (atomic_ref ): # pylint: disable=unused-argument
629
- """SPIR-V overload for
630
- :meth:`numba_dpex.experimental.kernel_iface.AtomicRef.load`.
627
+ """SPIR-V overload for :meth:`numba_dpex.kernel_api.AtomicRef.load`.
631
628
632
629
Generates the same LLVM IR instruction as dpcpp for the
633
630
`atomic_ref::load` function.
@@ -643,8 +640,7 @@ def ol_load_impl(atomic_ref):
643
640
644
641
@overload_method (AtomicRefType , "store" , target = DPEX_KERNEL_EXP_TARGET_NAME )
645
642
def ol_store (atomic_ref , val ):
646
- """SPIR-V overload for
647
- :meth:`numba_dpex.experimental.kernel_iface.AtomicRef.store`.
643
+ """SPIR-V overload for :meth:`numba_dpex.kernel_api.AtomicRef.store`.
648
644
649
645
Generates the same LLVM IR instruction as dpcpp for the
650
646
`atomic_ref::store` function.
@@ -669,8 +665,7 @@ def ol_store_impl(atomic_ref, val):
669
665
670
666
@overload_method (AtomicRefType , "exchange" , target = DPEX_KERNEL_EXP_TARGET_NAME )
671
667
def ol_exchange (atomic_ref , val ):
672
- """SPIR-V overload for
673
- :meth:`numba_dpex.experimental.kernel_iface.AtomicRef.exchange`.
668
+ """SPIR-V overload for :meth:`numba_dpex.kernel_api.AtomicRef.exchange`.
674
669
675
670
Generates the same LLVM IR instruction as dpcpp for the
676
671
`atomic_ref::exchange` function.
0 commit comments