Fix intrinsic matching to include vector variants for llvm.maxnum.* and llvm.minnum.* (#1577)
Support for LLVM intrinsics llvm.minnum.* and llvm.maxnum.* was added in upstream commit 25d1bf77023e67a5920b47a8c787e6aed1a23d34, but was only set to match float operations.
Co-authored-by: Devon McKee devon.mckee@sarc.samsung.com Co-authored-by: Devon McKee devon.mckee@samsung.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
clspv
Clspv is a compiler for OpenCL C targeting Vulkan compute shaders.
It consists of:
Clspv depends on external projects:
Legal
Clspv is licensed under the terms of the Apache 2.0 license. The AUTHORS file lists the copyright owners, while individual credit is given in the CONTRIBUTORS file. To contribute, see CONTRIBUTING.md.
Materials in projects Clspv depends on are licensed under their own terms.
Clspv is not an official Google product.
Status
Clspv has passed OpenCL3.0 conformance with:
The input language is OpenCL C version 1.2. Read the OpenCL C on Vulkan Specification for more information on the support and the mapping into Vulkan compute shaders.
Examples
Compile a set of kernels into a SPIR-V binary module:
Emit the binary as a C initializer list, for easy embedding of a shader in in a C or C++ program source:
Predefine some preprocessor symbols:
Use OpenCL compiler options:
Show help:
Compiler-explorer
clspv is available in compiler-explorer among the
OpenCL Ccompilers.It is built daily by the compiler-explorer infrastructure.
Build
Tools
You will need:
Getting sources for dependencies
Clspv depends on the sources for other projects, at specific commits. Run the following command to download those dependencies, and place them in the
third_partydirectory:Building
Then, create a build directory:
Then configure and build the code:
This will build the
clspvcommand line compiler and place it in locationbin/clspvunder the build directory.Using Ninja to build, and other build options
We recommend you use the [Ninja][Ninja] build tool if it’s available. To do so, replace the last two commands with:
Other useful configuration options (the first
cmakecommand):-DCMAKE_BUILD_TYPE=RelWithDebInfo: Build in release mode, with debugging information. Default is a debug build.See the CMake documentation for more generic options.
Test
To run the test suite from within the build directory:
Or if you are using Ninja:
[libclc] https://libclc.llvm.org [LLVM]: //mirrors/clspv/tree/main/http:/llvm.org [Ninja]: //mirrors/clspv/tree/main/https:/ninja-build.org [SPIRV-Headers]: https://github.com/KhronosGroup/SPIRV-Headers [SPIRV-Tools]: https://github.com/KhronosGroup/SPIRV-Tools