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 10
10
11
11
from numba_dpex .core import config
12
12
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
+ )
14
18
from .targets .kernel_target import (
15
19
DPEX_KERNEL_TARGET_NAME ,
16
20
CompilationMode ,
@@ -110,7 +114,7 @@ def _toplevel_target_context(self):
110
114
@cached_property
111
115
def _toplevel_typing_context (self ):
112
116
# Lazily-initialized top-level typing context, for all threads
113
- return typing . Context ()
117
+ return DpexTypingContext ()
114
118
115
119
@property
116
120
def target_context (self ):
Original file line number Diff line number Diff line change 7
7
8
8
from functools import cached_property
9
9
10
+ from numba .core import typing
10
11
from numba .core .compiler_lock import global_compiler_lock
11
12
from numba .core .cpu import CPUContext
12
13
from numba .core .imputils import Registry
@@ -28,6 +29,10 @@ class Dpex(CPU):
28
29
dpex_function_registry = Registry ()
29
30
30
31
32
+ class DpexTypingContext (typing .Context ):
33
+ """Custom typing context to support dpjit compilation."""
34
+
35
+
31
36
class DpexTargetContext (CPUContext ):
32
37
def __init__ (self , typingctx , target = DPEX_TARGET_NAME ):
33
38
super ().__init__ (typingctx , target )
You can’t perform that action at this time.
0 commit comments