1717from numba .core .datamodel import DataModelManager
1818from numba .core .types .containers import UniTuple
1919
20- from numba_dpex import utils
2120from numba_dpex .core import config
2221from numba_dpex .core .exceptions import UnreachableError
2322from numba_dpex .core .runtime .context import DpexRTContext
2423from numba_dpex .core .types import USMNdArray
2524from numba_dpex .core .types .kernel_api .local_accessor import LocalAccessorType
2625from numba_dpex .core .types .kernel_api .ranges import NdRangeType , RangeType
26+ from numba_dpex .core .utils import cgutils_extra
2727from numba_dpex .core .utils .kernel_flattened_args_builder import (
2828 KernelFlattenedArgsBuilder ,
2929)
3030from numba_dpex .dpctl_iface import libsyclinterface_bindings as sycl
31- from numba_dpex .utils import create_null_ptr
3231
3332MAX_SIZE_OF_SYCL_RANGE = 3
3433
@@ -142,10 +141,15 @@ def _build_nullptr(self):
142141
143142 Returns: An LLVM Value storing a null pointer
144143 """
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+ )
146147 self .builder .store (self .context .get_constant (types .int64 , 0 ), zero )
147148 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+ ),
149153 )
150154
151155 # TODO: remove, not part of the builder
@@ -159,7 +163,9 @@ def get_queue(self, exec_queue: dpctl.SyclQueue) -> llvmir.Instruction:
159163 # Allocate a stack var to store the queue created from the filter string
160164 sycl_queue_val = cgutils .alloca_once (
161165 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+ ),
163169 )
164170 # Insert a global constant to store the filter string
165171 device = self .context .insert_const_string (
@@ -256,8 +262,8 @@ def _create_sycl_range(self, idx_range):
256262 """
257263 int64_range = [
258264 (
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
261267 else rext
262268 )
263269 for rext in idx_range
@@ -334,7 +340,7 @@ def set_kernel_from_spirv(
334340 )
335341 else :
336342 spv_compiler_options = self .builder .load (
337- create_null_ptr (self .builder , self .context )
343+ cgutils_extra . create_null_ptr (self .builder , self .context )
338344 )
339345
340346 # build_or_get_kernel steals reference to context and device cause it
0 commit comments