Skip to content

Commit cc4593f

Browse files
author
Diptorup Deb
committed
Set the inlining_threshold in PassManagerBuilder conditionally.
- The PassManagerBuilder's inlining_threshold property is set only when inline_threshold is g.t. 0. Doing otherwise, *i.e.*, setting the pmb.inlining_threshold to 0 will lead to at minimum `alwaysinline` pass to run.
1 parent a1c3691 commit cc4593f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

numba_dpex/core/codegen.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,13 @@ def _optimize_final_module(self):
7070
)
7171

7272
pmb.disable_unit_at_a_time = False
73-
pmb.inlining_threshold = self.inline_threshold
73+
74+
# The PassManagerBuilder's inlining_threshold property is set only when
75+
# inline_threshold is g.t. 0. Doing otherwise, *i.e.*, setting the
76+
# pmb.inlining_threshold to 0 will lead to at minimum `alwaysinline`
77+
# pass to run.
78+
if self.inline_threshold > 0:
79+
pmb.inlining_threshold = self.inline_threshold
7480

7581
pmb.disable_unroll_loops = True
7682
pmb.loop_vectorize = False

0 commit comments

Comments
 (0)