|
9 | 9 | from llvmlite import binding as ll
|
10 | 10 | from llvmlite import ir as llvmir
|
11 | 11 | from numba import typeof
|
12 |
| -from numba.core import cgutils, types, typing, utils |
| 12 | +from numba.core import cgutils, funcdesc, types, typing, utils |
13 | 13 | from numba.core.base import BaseContext
|
14 | 14 | from numba.core.callconv import MinimalCallConv
|
15 | 15 | from numba.core.registry import cpu_target
|
@@ -240,7 +240,7 @@ def _generate_kernel_wrapper(self, func, argtypes):
|
240 | 240 | llvmir.VoidType(), arginfo.argument_types
|
241 | 241 | )
|
242 | 242 | wrapper_module = self.create_module("dpex.kernel.wrapper")
|
243 |
| - wrappername = "dpexPy_{name}".format(name=func.name) |
| 243 | + wrappername = func.name.replace("dpex_fn", "dpex_kernel") |
244 | 244 | argtys = list(arginfo.argument_types)
|
245 | 245 | fnty = llvmir.FunctionType(
|
246 | 246 | llvmir.IntType(32),
|
@@ -373,13 +373,9 @@ def target_data(self):
|
373 | 373 | return self._target_data
|
374 | 374 |
|
375 | 375 | def mangler(self, name, argtypes, abi_tags=(), uid=None):
|
376 |
| - def repl(m): |
377 |
| - ch = m.group(0) |
378 |
| - return "_%X_" % ord(ch) |
379 |
| - |
380 |
| - qualified = name + "." + ".".join(str(a) for a in argtypes) |
381 |
| - mangled = VALID_CHARS.sub(repl, qualified) |
382 |
| - return "dpex_py_devfn_" + mangled |
| 376 | + return funcdesc.default_mangler( |
| 377 | + name + "dpex_fn", argtypes, abi_tags=abi_tags, uid=uid |
| 378 | + ) |
383 | 379 |
|
384 | 380 | def prepare_ocl_kernel(self, func, argtypes):
|
385 | 381 | module = func.module
|
|
0 commit comments