4
4
5
5
from numba .core import types
6
6
7
- from numba_dpex import dpctl_sem_version
8
7
from numba_dpex .core .types .kernel_api .local_accessor import LocalAccessorType
9
8
10
9
@@ -14,61 +13,27 @@ def numba_type_to_dpctl_typenum(context, ty):
14
13
``DPCTLKernelArgType``.
15
14
"""
16
15
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
19
17
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
+ )
44
38
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
0 commit comments