diff --git a/numba_dpex/spirv_generator.py b/numba_dpex/spirv_generator.py index e258b65bd3..65cbbcef50 100644 --- a/numba_dpex/spirv_generator.py +++ b/numba_dpex/spirv_generator.py @@ -75,6 +75,8 @@ def generate(self, llvm_spirv_args, ipath, opath): if config.DEBUG: llvm_spirv_flags.append("--spirv-debug-info-version=ocl-100") + if not config.NATIVE_FP_ATOMICS: + llvm_spirv_args = ["--spirv-max-version", "1.1"] + llvm_spirv_args llvm_spirv_tool = self._llvm_spirv() if config.DEBUG: @@ -94,7 +96,7 @@ def _llvm_spirv(): # use llvm-spirv from dpcpp package. # assume dpcpp from .../bin folder. # assume llvm-spirv from .../bin-llvm folder. - dpcpp_path = shutil.which("dpcpp") + dpcpp_path = shutil.which("icx") if dpcpp_path is not None: bin_llvm = os.path.dirname(dpcpp_path) + "/../bin-llvm/" bin_llvm = os.path.normpath(bin_llvm) diff --git a/setup.py b/setup.py index 046a284fdc..7962f16a28 100644 --- a/setup.py +++ b/setup.py @@ -116,9 +116,11 @@ def spirv_compile(): ] spirv_args = [ _llvm_spirv(), + "--spirv-max-version", + "1.1", + "numba_dpex/ocl/atomics/atomic_ops.bc", "-o", "numba_dpex/ocl/atomics/atomic_ops.spir", - "numba_dpex/ocl/atomics/atomic_ops.bc", ] subprocess.check_call( clang_args, @@ -140,15 +142,14 @@ def _llvm_spirv(): result = None - if result is None: - # use llvm-spirv from dpcpp package. - # assume dpcpp from .../bin folder. - # assume llvm-spirv from .../bin-llvm folder. - dpcpp_path = shutil.which("dpcpp") - if dpcpp_path is not None: - bin_llvm = os.path.dirname(dpcpp_path) + "/../bin-llvm/" - bin_llvm = os.path.normpath(bin_llvm) - result = shutil.which("llvm-spirv", path=bin_llvm) + # use llvm-spirv from dpcpp package. + # assume dpcpp from .../bin folder. + # assume llvm-spirv from .../bin-llvm folder. + dpcpp_path = shutil.which("icx") + if dpcpp_path is not None: + bin_llvm = os.path.dirname(dpcpp_path) + "/../bin-llvm/" + bin_llvm = os.path.normpath(bin_llvm) + result = shutil.which("llvm-spirv", path=bin_llvm) if result is None: result = "llvm-spirv"