Skip to content

Commit b8c72fd

Browse files
committed
Remove runtime semantic version check
1 parent 868f31f commit b8c72fd

File tree

5 files changed

+36
-117
lines changed

5 files changed

+36
-117
lines changed

numba_dpex/__init__.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,23 +67,12 @@ def parse_sem_version(version_string: str) -> Tuple[int, int, int]:
6767

6868

6969
numba_sem_version = parse_sem_version(numba_version)
70-
if numba_sem_version < (0, 58, 0) or numba_sem_version >= (0, 59, 0):
71-
logging.warning(
72-
"numba_dpex needs at least numba 0.58.0 but no more than 0.59.0, using "
73-
f"numba={numba_version} may cause unexpected behavior"
74-
)
70+
dpctl_sem_version = parse_sem_version(dpctl.__version__)
7571

7672
# Monkey patches
7773
patch_is_ufunc.patch()
7874
patch_arrayexpr_tree_to_ir.patch()
7975

80-
dpctl_sem_version = parse_sem_version(dpctl.__version__)
81-
if dpctl_sem_version < (0, 14):
82-
logging.warning(
83-
"numba_dpex needs dpctl 0.14 or greater, using "
84-
f"dpctl={dpctl_sem_version} may cause unexpected behavior"
85-
)
86-
8776
from numba import prange # noqa E402
8877

8978
import numba_dpex.core.dpjit_dispatcher # noqa E402

numba_dpex/core/dpjit_dispatcher.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
target_registry,
1010
)
1111

12-
from numba_dpex import numba_sem_version
1312
from numba_dpex.core.pipelines import dpjit_compiler
1413
from numba_dpex.core.targets.dpjit_target import DPEX_TARGET_NAME
1514

@@ -58,21 +57,12 @@ def __init__(
5857
targetoptions={},
5958
pipeline_class=dpjit_compiler.DpjitCompiler,
6059
):
61-
if numba_sem_version < (0, 59, 0):
62-
super().__init__(
63-
py_func=py_func,
64-
locals=locals,
65-
impl_kind="direct",
66-
targetoptions=targetoptions,
67-
pipeline_class=pipeline_class,
68-
)
69-
else:
70-
super().__init__(
71-
py_func=py_func,
72-
locals=locals,
73-
targetoptions=targetoptions,
74-
pipeline_class=pipeline_class,
75-
)
60+
super().__init__(
61+
py_func=py_func,
62+
locals=locals,
63+
targetoptions=targetoptions,
64+
pipeline_class=pipeline_class,
65+
)
7666
self._compiler = _DpjitCompiler(
7767
py_func,
7868
self.targetdescr,

numba_dpex/dpctl_iface/_helpers.py

Lines changed: 22 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from numba.core import types
66

7-
from numba_dpex import dpctl_sem_version
87
from numba_dpex.core.types.kernel_api.local_accessor import LocalAccessorType
98

109

@@ -14,61 +13,27 @@ def numba_type_to_dpctl_typenum(context, ty):
1413
``DPCTLKernelArgType``.
1514
"""
1615

17-
if dpctl_sem_version >= (0, 17, 0):
18-
from dpctl._sycl_queue import kernel_arg_type as kargty
16+
from dpctl._sycl_queue import kernel_arg_type as kargty
1917

20-
if ty == types.boolean:
21-
return context.get_constant(types.int32, kargty.dpctl_uint8.value)
22-
elif ty == types.int32 or isinstance(ty, types.scalars.IntegerLiteral):
23-
return context.get_constant(types.int32, kargty.dpctl_int32.value)
24-
elif ty == types.uint32:
25-
return context.get_constant(types.int32, kargty.dpctl_uint32.value)
26-
elif ty == types.int64:
27-
return context.get_constant(types.int32, kargty.dpctl_int64.value)
28-
elif ty == types.uint64:
29-
return context.get_constant(types.int32, kargty.dpctl_uint64.value)
30-
elif ty == types.float32:
31-
return context.get_constant(types.int32, kargty.dpctl_float32.value)
32-
elif ty == types.float64:
33-
return context.get_constant(types.int32, kargty.dpctl_float64.value)
34-
elif ty == types.voidptr or isinstance(ty, types.CPointer):
35-
return context.get_constant(
36-
types.int32, kargty.dpctl_void_ptr.value
37-
)
38-
elif isinstance(ty, LocalAccessorType):
39-
return context.get_constant(
40-
types.int32, kargty.dpctl_local_accessor.value
41-
)
42-
else:
43-
raise NotImplementedError
18+
if ty == types.boolean:
19+
return context.get_constant(types.int32, kargty.dpctl_uint8.value)
20+
elif ty == types.int32 or isinstance(ty, types.scalars.IntegerLiteral):
21+
return context.get_constant(types.int32, kargty.dpctl_int32.value)
22+
elif ty == types.uint32:
23+
return context.get_constant(types.int32, kargty.dpctl_uint32.value)
24+
elif ty == types.int64:
25+
return context.get_constant(types.int32, kargty.dpctl_int64.value)
26+
elif ty == types.uint64:
27+
return context.get_constant(types.int32, kargty.dpctl_uint64.value)
28+
elif ty == types.float32:
29+
return context.get_constant(types.int32, kargty.dpctl_float32.value)
30+
elif ty == types.float64:
31+
return context.get_constant(types.int32, kargty.dpctl_float64.value)
32+
elif ty == types.voidptr or isinstance(ty, types.CPointer):
33+
return context.get_constant(types.int32, kargty.dpctl_void_ptr.value)
34+
elif isinstance(ty, LocalAccessorType):
35+
return context.get_constant(
36+
types.int32, kargty.dpctl_local_accessor.value
37+
)
4438
else:
45-
if ty == types.int32 or isinstance(ty, types.scalars.IntegerLiteral):
46-
# DPCTL_LONG_LONG
47-
return context.get_constant(types.int32, 9)
48-
elif ty == types.uint32:
49-
# DPCTL_UNSIGNED_LONG_LONG
50-
return context.get_constant(types.int32, 10)
51-
elif ty == types.boolean:
52-
# DPCTL_UNSIGNED_INT
53-
return context.get_constant(types.int32, 5)
54-
elif ty == types.int64:
55-
# DPCTL_LONG_LONG
56-
return context.get_constant(types.int32, 9)
57-
elif ty == types.uint64:
58-
# DPCTL_SIZE_T
59-
return context.get_constant(types.int32, 11)
60-
elif ty == types.float32:
61-
# DPCTL_FLOAT
62-
return context.get_constant(types.int32, 12)
63-
elif ty == types.float64:
64-
# DPCTL_DOUBLE
65-
return context.get_constant(types.int32, 13)
66-
elif ty == types.voidptr or isinstance(ty, types.CPointer):
67-
# DPCTL_VOID_PTR
68-
return context.get_constant(types.int32, 15)
69-
elif isinstance(ty, LocalAccessorType):
70-
raise NotImplementedError(
71-
"LocalAccessor args for kernels requires dpctl 0.17 or greater."
72-
)
73-
else:
74-
raise NotImplementedError
39+
raise NotImplementedError

numba_dpex/kernel_api_impl/spirv/dispatcher.py

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from numba.core.types import void
2727
from numba.core.typing.typeof import Purpose, typeof
2828

29-
from numba_dpex import config, numba_sem_version
29+
from numba_dpex import config
3030
from numba_dpex.core.descriptor import dpex_kernel_target
3131
from numba_dpex.core.exceptions import (
3232
ExecutionQueueInferenceError,
@@ -322,22 +322,12 @@ def __init__(
322322

323323
self._kernel_name = pyfunc.__name__
324324

325-
if numba_sem_version < (0, 59, 0):
326-
# pylint: disable=unexpected-keyword-arg
327-
super().__init__(
328-
py_func=pyfunc,
329-
locals=local_vars_to_numba_types,
330-
impl_kind="direct",
331-
targetoptions=targetoptions,
332-
pipeline_class=pipeline_class,
333-
)
334-
else:
335-
super().__init__(
336-
py_func=pyfunc,
337-
locals=local_vars_to_numba_types,
338-
targetoptions=targetoptions,
339-
pipeline_class=pipeline_class,
340-
)
325+
super().__init__(
326+
py_func=pyfunc,
327+
locals=local_vars_to_numba_types,
328+
targetoptions=targetoptions,
329+
pipeline_class=pipeline_class,
330+
)
341331
self._compiler = _SPIRVKernelCompiler(
342332
pyfunc,
343333
self.targetdescr,

numba_dpex/tests/misc/test_dpctl_version.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)