diff --git a/pystencils/opencl/spirv.py b/pystencils/opencl/spirv.py index 366e61d4d06610fecc517834a398d3d25f88524c..774f197043cfaba193e2b216093a89442213008b 100644 --- a/pystencils/opencl/spirv.py +++ b/pystencils/opencl/spirv.py @@ -24,6 +24,13 @@ def _opencl_to_spriv(opencl_code, clspv (https://github.com/google/clspv) ...takes a while to compile + --cl-std=<value> + =CL1.0 + =CL1.1 + =CL1.2 + =CL2.0 + =CLC++ + For OpenCL SPIRV (loaded by OpenCL runtime): Tools: @@ -74,6 +81,7 @@ def _opencl_to_spriv(opencl_code, *OCL_FAST_MATH_FLAGS, *(['-cl-single-precision-constant'] if silence_warnings else []), cl_file, + f'-cl-std=CL{opencl_version}', '-I', get_pystencils_include_path(), '-O3', *(['-w'] if silence_warnings else []), @@ -83,7 +91,7 @@ def _opencl_to_spriv(opencl_code, assert opencl_version == '1.2', 'clspv supports a subset of OpenCL 1.2' else: if code_as_c_array: - raise("Output as C-array only supported with clspv") + raise("Output as C-array only supported with clang") clang = get_clang_command() llvm_spirv = shutil.which('llvm-spirv')