Skip to content

Commit f4533b4

Browse files
author
Diptorup Deb
committed
WIP address review comments
1 parent 5becde4 commit f4533b4

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

numba_dpex/core/descriptor.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
from numba.core.cpu import CPUTargetOptions
99
from numba.core.descriptors import TargetDescriptor
1010

11+
from numba_dpex import config
12+
1113
from .targets.dpjit_target import DPEX_TARGET_NAME, DpexTargetContext
1214
from .targets.kernel_target import (
1315
DPEX_KERNEL_TARGET_NAME,
@@ -50,7 +52,12 @@ def finalize(self, flags, options):
5052
_inherit_if_not_set(flags, options, "release_gil", False)
5153
_inherit_if_not_set(flags, options, "no_compile", True)
5254
_inherit_if_not_set(flags, options, "use_mlir", False)
53-
_inherit_if_not_set(flags, options, "inline_threshold", 0)
55+
if config.INLINE_THRESHOLD is not None:
56+
_inherit_if_not_set(
57+
flags, options, "inline_threshold", config.INLINE_THRESHOLD
58+
)
59+
else:
60+
_inherit_if_not_set(flags, options, "inline_threshold", 0)
5461
_inherit_if_not_set(
5562
flags, options, "_compilation_mode", CompilationMode.KERNEL
5663
)

numba_dpex/experimental/kernel_dispatcher.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,10 @@ def _compile_to_spirv(
8686
)
8787
# If the inline_threshold option was set then set the property in the
8888
# kernel_library to force inlining ``overload`` calls into a kernel.
89-
try:
90-
kernel_library.inline_threshold = self.targetoptions[
91-
"inline_threshold"
92-
]
93-
except KeyError:
94-
pass
89+
inline_threshold = self.targetoptions.get("inline_threshold")
90+
if inline_threshold is not None:
91+
kernel_library.inline_threshold = inline_threshold
92+
9593
# Call finalize on the LLVM module. Finalization will result in
9694
# all linking libraries getting linked together and final optimization
9795
# including inlining of functions if an inlining level is specified.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-FileCopyrightText: 2023 Intel Corporation
2+
#
3+
# SPDX-License-Identifier: Apache-2.0

0 commit comments

Comments
 (0)