| commit | 202fef97b35219bb408bbf059b52a07ec5d7b8f8 | [log] [tgz] |
|---|---|---|
| author | Fraser Cormack <fraser@codeplay.com> | Thu Mar 20 11:40:09 2025 +0000 |
| committer | Copybara-Service <copybara-worker@google.com> | Thu Mar 20 04:46:05 2025 -0700 |
| tree | d3cbfe060f8a4ea846e893ff522cd73ca2009125 | |
| parent | 1d28d44b7668705567d5877f8e84a1be699b95de [diff] |
[libclc] Update license headers (#132070) This commit bulk-updates the libclc license headers to the current Apache-2.0 WITH LLVM-exception license in situations where they were previously attributed to AMD - and occasionally under an additional single individual contributor - under an MIT license. AMD signed the LLVM relicensing agreement and so agreed for their past contributions under the new LLVM license. The LLVM project also has had a long-standing, unwritten, policy of not adding copyright notices to source code. This policy was recently written up [1]. This commit therefore also removes these copyright notices at the same time. Note that there are outstanding copyright notices attributed to others - and many files missing copyright headers - which will be dealt with in future work. [1] https://llvm.org/docs/DeveloperPolicy.html#embedded-copyright-or-contributed-by-statements GitOrigin-RevId: 82912fd6200b4f99d3f1b42dc6c08af27c1cba4f
libclc is an open source implementation of the library requirements of the OpenCL C programming language, as specified by the OpenCL 1.1 Specification. The following sections of the specification impose library requirements:
libclc is intended to be used with the Clang compiler's OpenCL frontend.
libclc is designed to be portable and extensible. To this end, it provides generic implementations of most library requirements, allowing the target to override the generic implementation at the granularity of individual functions.
libclc currently supports PTX, AMDGPU, SPIRV and CLSPV targets, but support for more targets is welcome.
(in the following instructions you can use make or ninja)
For an in-tree build, Clang must also be built at the same time:
$ cmake <path-to>/llvm-project/llvm/CMakeLists.txt -DLLVM_ENABLE_PROJECTS="libclc;clang" \
-DCMAKE_BUILD_TYPE=Release -G Ninja
$ ninja
Then install:
$ ninja install
Note you can use the DESTDIR Makefile variable to do staged installs.
$ DESTDIR=/path/for/staged/install ninja install
To build out of tree, or in other words, against an existing LLVM build or install:
$ cmake <path-to>/llvm-project/libclc/CMakeLists.txt -DCMAKE_BUILD_TYPE=Release \ -G Ninja -DLLVM_DIR=$(<path-to>/llvm-config --cmakedir) $ ninja
Then install as before.
In both cases this will include all supported targets. You can choose which targets are enabled by passing -DLIBCLC_TARGETS_TO_BUILD to CMake. The default is all.
In both cases, the LLVM used must include the targets you want libclc support for (AMDGPU and NVPTX are enabled in LLVM by default). Apart from SPIRV where you do not need an LLVM target but you do need the llvm-spirv tool available. Either build this in-tree, or place it in the directory pointed to by LLVM_TOOLS_BINARY_DIR.