15
15
from __future__ import annotations
16
16
17
17
import dataclasses
18
+ import warnings
18
19
from typing import Callable , Optional , cast
19
20
20
21
import dace
@@ -68,7 +69,22 @@ def __call__(
68
69
69
70
# ITIR parameters
70
71
column_axis : Optional [Dimension ] = inp .kwargs .get ("column_axis" , None )
71
- offset_provider = inp .kwargs ["offset_provider" ]
72
+ offset_provider : dict [str , common .Dimension | common .Connectivity ] = inp .kwargs [
73
+ "offset_provider"
74
+ ]
75
+ runtime_lift_mode : Optional [LiftMode ] = inp .kwargs .get ("lift_mode" , None )
76
+
77
+ # TODO(tehrengruber): Remove `lift_mode` from call interface. It has been implicitly added
78
+ # to the interface of all (or at least all of concern) backends, but instead should be
79
+ # configured in the backend itself (like it is here), until then we respect the argument
80
+ # here and warn the user if it differs from the one configured.
81
+ lift_mode = runtime_lift_mode or self .lift_mode
82
+ if runtime_lift_mode and runtime_lift_mode != self .lift_mode :
83
+ warnings .warn (
84
+ f"DaCe Backend was configured for LiftMode `{ self .lift_mode !s} `, but "
85
+ f"overriden to be { runtime_lift_mode !s} at runtime." ,
86
+ stacklevel = 2 ,
87
+ )
72
88
73
89
sdfg = build_sdfg_from_itir (
74
90
program ,
@@ -77,7 +93,7 @@ def __call__(
77
93
auto_optimize = self .auto_optimize ,
78
94
on_gpu = on_gpu ,
79
95
column_axis = column_axis ,
80
- lift_mode = self . lift_mode ,
96
+ lift_mode = lift_mode ,
81
97
load_sdfg_from_file = False ,
82
98
save_sdfg = False ,
83
99
use_field_canonical_representation = self .use_field_canonical_representation ,
0 commit comments