Skip to content

Commit 9ce9927

Browse files
author
Diptorup Deb
committed
Expose device_func decorator at numba_dpex.experimental module.
- To get the experimental device_func decorator to be usable standalone the decorator is now available via the numba_dpex.experimental module. - The DpexExpKernelTarget allows dynamic_globals to make it possible to call device_func from kernel.
1 parent 1ade40d commit 9ce9927

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

numba_dpex/experimental/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from numba.core.imputils import Registry
1010

11-
from .decorators import kernel
11+
from .decorators import device_func, kernel
1212
from .kernel_dispatcher import KernelDispatcher
1313
from .launcher import call_kernel, call_kernel_async
1414
from .literal_intenum_type import IntEnumLiteral
@@ -28,6 +28,7 @@ def dpex_dispatcher_const(context):
2828

2929

3030
__all__ = [
31+
"device_func",
3132
"kernel",
3233
"call_kernel",
3334
"call_kernel_async",

numba_dpex/experimental/target.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ class DpexExpKernelTargetContext(DpexKernelTargetContext):
8989
they are stable enough to be migrated to DpexKernelTargetContext.
9090
"""
9191

92+
allow_dynamic_globals = True
93+
9294
def __init__(self, typingctx, target=DPEX_KERNEL_EXP_TARGET_NAME):
9395
super().__init__(typingctx, target)
9496
self.data_model_manager = exp_dmm

0 commit comments

Comments
 (0)