File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 1010
1111from numba_dpex .core import config
1212
13- from .targets .dpjit_target import DPEX_TARGET_NAME , DpexTargetContext
13+ from .targets .dpjit_target import (
14+ DPEX_TARGET_NAME ,
15+ DpexTargetContext ,
16+ DpexTypingContext ,
17+ )
1418from .targets .kernel_target import (
1519 DPEX_KERNEL_TARGET_NAME ,
1620 CompilationMode ,
@@ -110,7 +114,7 @@ def _toplevel_target_context(self):
110114 @cached_property
111115 def _toplevel_typing_context (self ):
112116 # Lazily-initialized top-level typing context, for all threads
113- return typing . Context ()
117+ return DpexTypingContext ()
114118
115119 @property
116120 def target_context (self ):
Original file line number Diff line number Diff line change 77
88from functools import cached_property
99
10+ from numba .core import typing
1011from numba .core .compiler_lock import global_compiler_lock
1112from numba .core .cpu import CPUContext
1213from numba .core .imputils import Registry
@@ -28,6 +29,10 @@ class Dpex(CPU):
2829dpex_function_registry = Registry ()
2930
3031
32+ class DpexTypingContext (typing .Context ):
33+ """Custom typing context to support dpjit compilation."""
34+
35+
3136class DpexTargetContext (CPUContext ):
3237 def __init__ (self , typingctx , target = DPEX_TARGET_NAME ):
3338 super ().__init__ (typingctx , target )
You can’t perform that action at this time.
0 commit comments