Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions numba_dpex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,6 @@ def parse_sem_version(version_string: str) -> Tuple[int, int, int]:
from .core.decorators import device_func, dpjit, kernel # noqa E402
from .core.kernel_launcher import call_kernel, call_kernel_async # noqa E402
from .core.targets import dpjit_target # noqa E402
from .ocl.stubs import ( # noqa E402
GLOBAL_MEM_FENCE,
LOCAL_MEM_FENCE,
atomic,
barrier,
get_global_id,
get_global_size,
get_group_id,
get_local_id,
get_local_size,
get_num_groups,
get_work_dim,
local,
mem_fence,
private,
sub_group_barrier,
)

load_dpctl_sycl_interface()
del load_dpctl_sycl_interface
Expand Down
2 changes: 0 additions & 2 deletions numba_dpex/core/datamodel/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from numba_dpex.kernel_api.memory_enums import AddressSpace as address_space

from ..types import (
Array,
DpctlSyclEvent,
DpctlSyclQueue,
DpnpNdArray,
Expand Down Expand Up @@ -335,7 +334,6 @@ def _init_kernel_data_model_manager() -> datamodel.DataModelManager:
"""
dmm = datamodel.default_manager.copy()
dmm.register(types.CPointer, GenericPointerModel)
dmm.register(Array, USMArrayDeviceModel)

# Register the USMNdArray type to USMArrayDeviceModel in numba_dpex's data
# model manager. The dpex_data_model_manager is used by the DpexKernelTarget
Expand Down
1 change: 0 additions & 1 deletion numba_dpex/core/pipelines/kernel_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
NoPythonSupportedFeatureValidation,
)

from numba_dpex.core import config
from numba_dpex.core.exceptions import UnsupportedCompilationModeError
from numba_dpex.core.passes.passes import (
NoPythonBackend,
Expand Down
2 changes: 0 additions & 2 deletions numba_dpex/core/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#
# SPDX-License-Identifier: Apache-2.0

from .array_type import Array
from .dpctl_types import DpctlSyclEvent, DpctlSyclQueue
from .dpnp_ndarray_type import DpnpNdArray
from .kernel_api.literal_intenum import IntEnumLiteral
Expand Down Expand Up @@ -34,7 +33,6 @@
usm_ndarray = USMNdArray

__all__ = [
"Array",
"DpctlSyclQueue",
"DpctlSyclEvent",
"DpnpNdArray",
Expand Down
65 changes: 0 additions & 65 deletions numba_dpex/core/types/array_type.py

This file was deleted.

40 changes: 40 additions & 0 deletions numba_dpex/core/utils/cgutils_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from llvmlite import ir as llvmir
from numba.core import cgutils, types

from numba_dpex.core.utils.itanium_mangler import mangle_c


class LLVMTypes:
"""
Expand All @@ -21,6 +23,44 @@ class LLVMTypes:
void_t = llvmir.VoidType()


def declare_function(context, builder, name, sig, cargs, mangler=mangle_c):
"""Insert declaration for a opencl builtin function.
Uses the Itanium mangler.

Args
----
context: target context

builder: llvm builder

name: str
symbol name

sig: signature
function signature of the symbol being declared

cargs: sequence of str
C type names for the arguments

mangler: a mangler function
function to use to mangle the symbol

"""
mod = builder.module
if sig.return_type == types.void:
llretty = llvmir.VoidType()
else:
llretty = context.get_value_type(sig.return_type)
llargs = [context.get_value_type(t) for t in sig.args]
fnty = llvmir.FunctionType(llretty, llargs)
mangled = mangler(name, cargs)
fn = cgutils.get_or_insert_function(mod, fnty, mangled)
from numba_dpex import spirv_kernel_target

fn.calling_convention = spirv_kernel_target.CC_SPIR_FUNC
return fn


def get_llvm_type(context, type):
"""Returns the LLVM Value corresponding to a Numba type.

Expand Down
3 changes: 1 addition & 2 deletions numba_dpex/dpnp_iface/dpnp_ufunc_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
from numba.core import types

from numba_dpex.core.typing import dpnpdecl

from ..ocl import mathimpl
from numba_dpex.kernel_api_impl.spirv.math import mathimpl

# A global instance of dpnp ufuncs that are supported by numba-dpex
_dpnp_ufunc_db = None
Expand Down
3 changes: 3 additions & 0 deletions numba_dpex/kernel_api_impl/spirv/math/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-FileCopyrightText: 2024 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
Loading