|
11 | 11 |
|
12 | 12 | import numba.core.event as ev
|
13 | 13 | from numba.core import errors, sigutils, types
|
14 |
| -from numba.core.compiler import CompileResult |
| 14 | +from numba.core.compiler import CompileResult, Flags |
15 | 15 | from numba.core.compiler_lock import global_compiler_lock
|
16 | 16 | from numba.core.dispatcher import Dispatcher, _FunctionCompiler
|
17 | 17 | from numba.core.target_extension import dispatcher_registry, target_registry
|
@@ -84,14 +84,15 @@ def _compile_to_spirv(
|
84 | 84 | kernel_fn = kernel_targetctx.prepare_spir_kernel(
|
85 | 85 | kernel_func, kernel_fndesc.argtypes
|
86 | 86 | )
|
| 87 | + # Get the compiler flags that were passed through the target descriptor |
| 88 | + flags = Flags() |
| 89 | + self.targetdescr.options.parse_as_flags(flags, self.targetoptions) |
| 90 | + |
87 | 91 | # If the inline_threshold option was set then set the property in the
|
88 | 92 | # 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 |
| 93 | + inline_threshold = flags.inline_threshold # pylint: disable=E1101 |
| 94 | + kernel_library.inline_threshold = inline_threshold |
| 95 | + |
95 | 96 | # Call finalize on the LLVM module. Finalization will result in
|
96 | 97 | # all linking libraries getting linked together and final optimization
|
97 | 98 | # including inlining of functions if an inlining level is specified.
|
@@ -202,9 +203,6 @@ class KernelDispatcher(Dispatcher):
|
202 | 203 | an executable binary, the dispatcher compiles it to SPIR-V and then caches
|
203 | 204 | that SPIR-V bitcode.
|
204 | 205 |
|
205 |
| - FIXME: Fix issues identified by pylint with this class. |
206 |
| - https://github.com/IntelPython/numba-dpex/issues/1196 |
207 |
| -
|
208 | 206 | """
|
209 | 207 |
|
210 | 208 | targetdescr = dpex_exp_kernel_target
|
|
0 commit comments