From f7939b66a49a1c39b3ad3ac707ee745d68c13b99 Mon Sep 17 00:00:00 2001 From: brandon-b-miller <53796099+brandon-b-miller@users.noreply.github.com> Date: Thu, 22 Aug 2024 07:10:30 -0500 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Graham Markall <535640+gmarkall@users.noreply.github.com> --- numba_cuda/numba/cuda/cudadrv/driver.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/numba_cuda/numba/cuda/cudadrv/driver.py b/numba_cuda/numba/cuda/cudadrv/driver.py index 483df13..45f3c72 100644 --- a/numba_cuda/numba/cuda/cudadrv/driver.py +++ b/numba_cuda/numba/cuda/cudadrv/driver.py @@ -2640,7 +2640,7 @@ def new(cls, if linker is PyNvJitLinker: return linker(max_registers, lineinfo, cc, lto, additional_flags) - elif additional_flags or lto: + elif additional_flags is not None or lto is not None: raise ValueError("LTO and additional flags require PyNvJitLinker") else: return linker(max_registers, lineinfo, cc) @@ -2706,8 +2706,6 @@ def add_file_guess_ext(self, path_or_code): ) elif ext == '.cu': self.add_cu_file(path_or_code) - elif ext == ".ltoir": - self.add_file(path_or_code, "ltoir") else: kind = FILE_EXTENSION_MAP.get(ext, None) if kind is None: @@ -3087,7 +3085,7 @@ def add_data(self, data, kind, name): return self.add_ptx(data, name) elif kind == FILE_EXTENSION_MAP["o"]: fn = self._linker.add_object - elif kind == "ltoir": + elif kind == FILE_EXTENSION_MAP["ltoir"]: fn = self._linker.add_ltoir else: raise LinkerError(f"Don't know how to link {kind}")