|
11 | 11 | import dpnp
|
12 | 12 | from llvmlite import binding as ll
|
13 | 13 | from llvmlite import ir as llvmir
|
14 |
| -from numba.core import cgutils, funcdesc |
| 14 | +from numba.core import cgutils |
15 | 15 | from numba.core import types as nb_types
|
16 | 16 | from numba.core import typing
|
17 | 17 | from numba.core.base import BaseContext
|
|
21 | 21 | from numba.core.typing import cmathdecl, enumdecl
|
22 | 22 |
|
23 | 23 | from numba_dpex.core.datamodel.models import _init_kernel_data_model_manager
|
| 24 | +from numba_dpex.core.debuginfo import DIBuilder as DpexDIbuilder |
24 | 25 | from numba_dpex.core.types import IntEnumLiteral
|
25 | 26 | from numba_dpex.core.typing import dpnpdecl
|
| 27 | +from numba_dpex.core.utils import itanium_mangler |
26 | 28 | from numba_dpex.kernel_api.flag_enum import FlagEnum
|
27 | 29 | from numba_dpex.kernel_api.memory_enums import AddressSpace as address_space
|
28 | 30 | from numba_dpex.kernel_api_impl.spirv import printimpl
|
@@ -134,6 +136,7 @@ class SPIRVTargetContext(BaseContext):
|
134 | 136 |
|
135 | 137 | implement_powi_as_math_call = True
|
136 | 138 | allow_dynamic_globals = True
|
| 139 | + DIBuilder = DpexDIbuilder |
137 | 140 |
|
138 | 141 | def __init__(self, typingctx, target=SPIRV_TARGET_NAME):
|
139 | 142 | super().__init__(typingctx, target)
|
@@ -188,7 +191,7 @@ def _generate_spir_kernel_wrapper(self, func, argtypes):
|
188 | 191 | wrapper_module = self._internal_codegen.create_empty_spirv_module(
|
189 | 192 | "dpex.kernel.wrapper"
|
190 | 193 | )
|
191 |
| - wrappername = func.name.replace("dpex_fn", "dpex_kernel") |
| 194 | + wrappername = func.name + ("dpex_kernel") |
192 | 195 | argtys = list(arginfo.argument_types)
|
193 | 196 | fnty = llvmir.FunctionType(
|
194 | 197 | llvmir.IntType(32),
|
@@ -319,12 +322,9 @@ def target_data(self):
|
319 | 322 |
|
320 | 323 | def mangler(self, name, types, *, abi_tags=(), uid=None):
|
321 | 324 | """
|
322 |
| - Generates a name for a function by appending \"dpex_fn\" to the |
323 |
| - name of the function before calling Numba's default function name |
324 |
| - mangler.""" |
325 |
| - return funcdesc.default_mangler( |
326 |
| - name + "dpex_fn", types, abi_tags=abi_tags, uid=uid |
327 |
| - ) |
| 325 | + Generates a mangled function name using numba_dpex's itanium mangler. |
| 326 | + """ |
| 327 | + return itanium_mangler.mangle(name, types, abi_tags=abi_tags, uid=uid) |
328 | 328 |
|
329 | 329 | def prepare_spir_kernel(self, func, argtypes):
|
330 | 330 | """Generates a wrapper function with \"spir_kernel\" calling conv that
|
|
0 commit comments