17
17
from numba .core .datamodel import DataModelManager
18
18
from numba .core .types .containers import UniTuple
19
19
20
- from numba_dpex import utils
21
20
from numba_dpex .core import config
22
21
from numba_dpex .core .exceptions import UnreachableError
23
22
from numba_dpex .core .runtime .context import DpexRTContext
24
23
from numba_dpex .core .types import USMNdArray
25
24
from numba_dpex .core .types .kernel_api .local_accessor import LocalAccessorType
26
25
from numba_dpex .core .types .kernel_api .ranges import NdRangeType , RangeType
26
+ from numba_dpex .core .utils import cgutils_extra
27
27
from numba_dpex .core .utils .kernel_flattened_args_builder import (
28
28
KernelFlattenedArgsBuilder ,
29
29
)
30
30
from numba_dpex .dpctl_iface import libsyclinterface_bindings as sycl
31
- from numba_dpex .utils import create_null_ptr
32
31
33
32
MAX_SIZE_OF_SYCL_RANGE = 3
34
33
@@ -142,10 +141,15 @@ def _build_nullptr(self):
142
141
143
142
Returns: An LLVM Value storing a null pointer
144
143
"""
145
- zero = cgutils .alloca_once (self .builder , utils .LLVMTypes .int64_t )
144
+ zero = cgutils .alloca_once (
145
+ self .builder , cgutils_extra .LLVMTypes .int64_t
146
+ )
146
147
self .builder .store (self .context .get_constant (types .int64 , 0 ), zero )
147
148
return self .builder .bitcast (
148
- zero , utils .get_llvm_type (context = self .context , type = types .voidptr )
149
+ zero ,
150
+ cgutils_extra .get_llvm_type (
151
+ context = self .context , type = types .voidptr
152
+ ),
149
153
)
150
154
151
155
# TODO: remove, not part of the builder
@@ -159,7 +163,9 @@ def get_queue(self, exec_queue: dpctl.SyclQueue) -> llvmir.Instruction:
159
163
# Allocate a stack var to store the queue created from the filter string
160
164
sycl_queue_val = cgutils .alloca_once (
161
165
self .builder ,
162
- utils .get_llvm_type (context = self .context , type = types .voidptr ),
166
+ cgutils_extra .get_llvm_type (
167
+ context = self .context , type = types .voidptr
168
+ ),
163
169
)
164
170
# Insert a global constant to store the filter string
165
171
device = self .context .insert_const_string (
@@ -256,8 +262,8 @@ def _create_sycl_range(self, idx_range):
256
262
"""
257
263
int64_range = [
258
264
(
259
- self .builder .sext (rext , utils .LLVMTypes .int64_t )
260
- if rext .type != utils .LLVMTypes .int64_t
265
+ self .builder .sext (rext , cgutils_extra .LLVMTypes .int64_t )
266
+ if rext .type != cgutils_extra .LLVMTypes .int64_t
261
267
else rext
262
268
)
263
269
for rext in idx_range
@@ -334,7 +340,7 @@ def set_kernel_from_spirv(
334
340
)
335
341
else :
336
342
spv_compiler_options = self .builder .load (
337
- create_null_ptr (self .builder , self .context )
343
+ cgutils_extra . create_null_ptr (self .builder , self .context )
338
344
)
339
345
340
346
# build_or_get_kernel steals reference to context and device cause it
0 commit comments