File tree Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -87,3 +87,11 @@ def __getattr__(name):
87
87
# Flag to turn on the ConstantSizeStaticLocalMemoryPass in the kernel pipeline.
88
88
# The pass is turned off by default.
89
89
STATIC_LOCAL_MEM_PASS = _readenv ("NUMBA_DPEX_STATIC_LOCAL_MEM_PASS" , int , 0 )
90
+
91
+ DPEX_OPT = _readenv ("NUMBA_DPEX_OPT" , int , 2 )
92
+
93
+ if DPEX_OPT :
94
+ logging .warning (
95
+ "Setting NUMBA_DPEX_OPT greater than 2 known to cause issues related "
96
+ + "to very aggressive optimizations that leads to broken code"
97
+ )
Original file line number Diff line number Diff line change @@ -31,11 +31,12 @@ def _optimize_final_module(self):
31
31
# Run some lightweight optimization to simplify the module.
32
32
pmb = ll .PassManagerBuilder ()
33
33
34
- # Make optimization level depending on config.OPT variable
35
- pmb .opt_level = config .OPT
34
+ # Make optimization level depending on config.DPEX_OPT variable
35
+ pmb .opt_level = config .DPEX_OPT
36
36
37
37
pmb .disable_unit_at_a_time = False
38
- pmb .inlining_threshold = 2
38
+ # TODO: investigate why it causes issues
39
+ # pmb.inlining_threshold = 2
39
40
pmb .disable_unroll_loops = True
40
41
pmb .loop_vectorize = False
41
42
pmb .slp_vectorize = False
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ def __init__(
94
94
self ._kernel_bundle_cache = NullCache ()
95
95
self ._cache_hits = 0
96
96
97
- if debug_flags or config .OPT == 0 :
97
+ if debug_flags or config .DPEX_OPT == 0 :
98
98
# if debug is ON we need to pass additional
99
99
# flags to igc.
100
100
self ._create_sycl_kernel_bundle_flags = ["-g" , "-cl-opt-disable" ]
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ def _compile_kernel_parfor(
80
80
)
81
81
82
82
dpctl_create_program_from_spirv_flags = []
83
- if debug or config .OPT == 0 :
83
+ if debug or config .DPEX_OPT == 0 :
84
84
# if debug is ON we need to pass additional flags to igc.
85
85
dpctl_create_program_from_spirv_flags = ["-g" , "-cl-opt-disable" ]
86
86
You can’t perform that action at this time.
0 commit comments