Skip to content

Commit 59bb09b

Browse files
author
Diptorup Deb
committed
Rename kernel_iface to kernel_api.
1 parent 803c180 commit 59bb09b

File tree

13 files changed

+28
-37
lines changed

13 files changed

+28
-37
lines changed

numba_dpex/experimental/_kernel_dpcpp_spirv_overloads/_atomic_ref_overloads.py

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: Apache-2.0
44

55
"""
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.
77
"""
88

99
from llvmlite import ir as llvmir
@@ -15,7 +15,7 @@
1515
from numba_dpex.core.targets.kernel_target import CC_SPIR_FUNC, LLVM_SPIRV_ARGS
1616
from numba_dpex.core.types import USMNdArray
1717
from numba_dpex.experimental.flag_enum import FlagEnum
18-
from numba_dpex.kernel_iface import (
18+
from numba_dpex.kernel_api import (
1919
AddressSpace,
2020
AtomicRef,
2121
MemoryOrder,
@@ -363,7 +363,7 @@ def ol_atomic_ref(
363363
address_space=AddressSpace.GLOBAL,
364364
):
365365
"""Overload of the constructor for the class
366-
class:`numba_dpex.experimental.kernel_iface.AtomicRef`.
366+
class:`numba_dpex.kernel_api.AtomicRef`.
367367
368368
Raises:
369369
errors.TypingError: If the `ref` argument is not a UsmNdArray type.
@@ -441,8 +441,7 @@ def ol_atomic_ref_ctor_impl(
441441

442442
@overload_method(AtomicRefType, "fetch_add", target=DPEX_KERNEL_EXP_TARGET_NAME)
443443
def ol_fetch_add(atomic_ref, val):
444-
"""SPIR-V overload for
445-
:meth:`numba_dpex.experimental.kernel_iface.AtomicRef.fetch_add`.
444+
"""SPIR-V overload for :meth:`numba_dpex.kernel_api.AtomicRef.fetch_add`.
446445
447446
Generates the same LLVM IR instruction as dpcpp for the
448447
`atomic_ref::fetch_add` function.
@@ -466,8 +465,7 @@ def ol_fetch_add_impl(atomic_ref, val):
466465

467466
@overload_method(AtomicRefType, "fetch_sub", target=DPEX_KERNEL_EXP_TARGET_NAME)
468467
def ol_fetch_sub(atomic_ref, val):
469-
"""SPIR-V overload for
470-
:meth:`numba_dpex.experimental.kernel_iface.AtomicRef.fetch_sub`.
468+
"""SPIR-V overload for :meth:`numba_dpex.kernel_api.AtomicRef.fetch_sub`.
471469
472470
Generates the same LLVM IR instruction as dpcpp for the
473471
`atomic_ref::fetch_sub` function.
@@ -491,8 +489,7 @@ def ol_fetch_sub_impl(atomic_ref, val):
491489

492490
@overload_method(AtomicRefType, "fetch_min", target=DPEX_KERNEL_EXP_TARGET_NAME)
493491
def ol_fetch_min(atomic_ref, val):
494-
"""SPIR-V overload for
495-
:meth:`numba_dpex.experimental.kernel_iface.AtomicRef.fetch_min`.
492+
"""SPIR-V overload for :meth:`numba_dpex.kernel_api.AtomicRef.fetch_min`.
496493
497494
Generates the same LLVM IR instruction as dpcpp for the
498495
`atomic_ref::fetch_min` function.
@@ -516,8 +513,7 @@ def ol_fetch_min_impl(atomic_ref, val):
516513

517514
@overload_method(AtomicRefType, "fetch_max", target=DPEX_KERNEL_EXP_TARGET_NAME)
518515
def ol_fetch_max(atomic_ref, val):
519-
"""SPIR-V overload for
520-
:meth:`numba_dpex.experimental.kernel_iface.AtomicRef.fetch_max`.
516+
"""SPIR-V overload for :meth:`numba_dpex.kernel_api.AtomicRef.fetch_max`.
521517
522518
Generates the same LLVM IR instruction as dpcpp for the
523519
`atomic_ref::fetch_max` function.
@@ -541,8 +537,7 @@ def ol_fetch_max_impl(atomic_ref, val):
541537

542538
@overload_method(AtomicRefType, "fetch_and", target=DPEX_KERNEL_EXP_TARGET_NAME)
543539
def ol_fetch_and(atomic_ref, val):
544-
"""SPIR-V overload for
545-
:meth:`numba_dpex.experimental.kernel_iface.AtomicRef.fetch_and`.
540+
"""SPIR-V overload for :meth:`numba_dpex.kernel_api.AtomicRef.fetch_and`.
546541
547542
Generates the same LLVM IR instruction as dpcpp for the
548543
`atomic_ref::fetch_and` function.
@@ -571,8 +566,7 @@ def ol_fetch_and_impl(atomic_ref, val):
571566

572567
@overload_method(AtomicRefType, "fetch_or", target=DPEX_KERNEL_EXP_TARGET_NAME)
573568
def ol_fetch_or(atomic_ref, val):
574-
"""SPIR-V overload for
575-
:meth:`numba_dpex.experimental.kernel_iface.AtomicRef.fetch_or`.
569+
"""SPIR-V overload for :meth:`numba_dpex.kernel_api.AtomicRef.fetch_or`.
576570
577571
Generates the same LLVM IR instruction as dpcpp for the
578572
`atomic_ref::fetch_or` function.
@@ -601,8 +595,7 @@ def ol_fetch_or_impl(atomic_ref, val):
601595

602596
@overload_method(AtomicRefType, "fetch_xor", target=DPEX_KERNEL_EXP_TARGET_NAME)
603597
def ol_fetch_xor(atomic_ref, val):
604-
"""SPIR-V overload for
605-
:meth:`numba_dpex.experimental.kernel_iface.AtomicRef.fetch_xor`.
598+
"""SPIR-V overload for :meth:`numba_dpex.kernel_api.AtomicRef.fetch_xor`.
606599
607600
Generates the same LLVM IR instruction as dpcpp for the
608601
`atomic_ref::fetch_xor` function.
@@ -631,8 +624,7 @@ def ol_fetch_xor_impl(atomic_ref, val):
631624

632625
@overload_method(AtomicRefType, "load", target=DPEX_KERNEL_EXP_TARGET_NAME)
633626
def ol_load(atomic_ref): # pylint: disable=unused-argument
634-
"""SPIR-V overload for
635-
:meth:`numba_dpex.experimental.kernel_iface.AtomicRef.load`.
627+
"""SPIR-V overload for :meth:`numba_dpex.kernel_api.AtomicRef.load`.
636628
637629
Generates the same LLVM IR instruction as dpcpp for the
638630
`atomic_ref::load` function.
@@ -648,8 +640,7 @@ def ol_load_impl(atomic_ref):
648640

649641
@overload_method(AtomicRefType, "store", target=DPEX_KERNEL_EXP_TARGET_NAME)
650642
def ol_store(atomic_ref, val):
651-
"""SPIR-V overload for
652-
:meth:`numba_dpex.experimental.kernel_iface.AtomicRef.store`.
643+
"""SPIR-V overload for :meth:`numba_dpex.kernel_api.AtomicRef.store`.
653644
654645
Generates the same LLVM IR instruction as dpcpp for the
655646
`atomic_ref::store` function.
@@ -674,8 +665,7 @@ def ol_store_impl(atomic_ref, val):
674665

675666
@overload_method(AtomicRefType, "exchange", target=DPEX_KERNEL_EXP_TARGET_NAME)
676667
def ol_exchange(atomic_ref, val):
677-
"""SPIR-V overload for
678-
:meth:`numba_dpex.experimental.kernel_iface.AtomicRef.exchange`.
668+
"""SPIR-V overload for :meth:`numba_dpex.kernel_api.AtomicRef.exchange`.
679669
680670
Generates the same LLVM IR instruction as dpcpp for the
681671
`atomic_ref::exchange` function.

numba_dpex/experimental/_kernel_dpcpp_spirv_overloads/_spv_atomic_inst_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from numba.core import types
1010

11-
from numba_dpex.kernel_iface import MemoryOrder, MemoryScope
11+
from numba_dpex.kernel_api import MemoryOrder, MemoryScope
1212

1313

1414
class _SpvScope(IntEnum):

numba_dpex/experimental/dpcpp_types.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
"""Collection of numba-dpex typing classes for kernel_iface Python classes.
5+
"""Collection of numba-dpex typing classes for kernel_api Python classes.
66
"""
77

88
from numba.core.types import Type
99

1010

1111
class AtomicRefType(Type):
1212
"""numba-dpex internal type to represent a Python object of
13-
:class:`numba_dpex.experimental.kernel_iface.AtomicRef`.
13+
:class:`numba_dpex.kernel_api.AtomicRef`.
1414
"""
1515

1616
def __init__(
@@ -38,21 +38,21 @@ def __init__(
3838
@property
3939
def memory_order(self) -> int:
4040
"""Returns the integer value for a memory order that corresponds to
41-
kernel_iface.MemoryOrder.
41+
kernel_api.MemoryOrder.
4242
"""
4343
return self._memory_order
4444

4545
@property
4646
def memory_scope(self) -> int:
4747
"""Returns the integer value for a memory order that corresponds to
48-
kernel_iface.MemoryScope.
48+
kernel_api.MemoryScope.
4949
"""
5050
return self._memory_scope
5151

5252
@property
5353
def address_space(self) -> int:
5454
"""Returns the integer value for a memory order that corresponds to
55-
kernel_iface.AddressSpace.
55+
kernel_api.AddressSpace.
5656
"""
5757
return self._address_space
5858

numba_dpex/experimental/typeof.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010
from numba.extending import typeof_impl
1111

12+
from numba_dpex.kernel_api import AtomicRef
13+
1214
from .dpcpp_types import AtomicRefType
13-
from .kernel_iface import AtomicRef
1415

1516

1617
@typeof_impl.register(AtomicRef)

numba_dpex/kernel_iface/__init__.py renamed to numba_dpex/kernel_api/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
# SPDX-License-Identifier: Apache-2.0
44

55
"""
6-
The kernel_iface provides a set of Python classes and functions that are
7-
analogous to the C++ SYCL API. The kernel_iface API is meant to allow
6+
The kernel_api module provides a set of Python classes and functions that are
7+
analogous to the C++ SYCL API. The kernel_api module is meant to allow
88
prototyping SYCL-like kernels in pure Python before compiling them using
9-
numba_dpex.kernel.
9+
numba_dpex.
1010
"""
1111

1212
from .atomic_ref import AtomicRef

numba_dpex/tests/experimental/kernel_iface/spv_overloads/test_atomic_fetch_phi.py renamed to numba_dpex/tests/experimental/kernel_api_overloads/spv_overloads/test_atomic_fetch_phi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import numba_dpex as dpex
1010
import numba_dpex.experimental as dpex_exp
11-
from numba_dpex.kernel_iface import AtomicRef
11+
from numba_dpex.kernel_api import AtomicRef
1212
from numba_dpex.tests._helper import get_all_dtypes
1313

1414
list_of_supported_dtypes = get_all_dtypes(

0 commit comments

Comments
 (0)