1- libclc
2- ------
1+ # libclc
32
43libclc is an open source implementation of the library
54requirements of the OpenCL C programming language, as specified by the
65OpenCL 1.1 Specification. The following sections of the specification
76impose library requirements:
87
9- * 6.1: Supported Data Types
10- * 6.2.3: Explicit Conversions
11- * 6.2.4.2: Reinterpreting Types Using as_type() and as_typen()
12- * 6.9: Preprocessor Directives and Macros
13- * 6.11: Built-in Functions
14- * 9.3: Double Precision Floating-Point
15- * 9.4: 64-bit Atomics
16- * 9.5: Writing to 3D image memory objects
17- * 9.6: Half Precision Floating-Point
8+ * 6.1: Supported Data Types
9+ * 6.2.3: Explicit Conversions
10+ * 6.2.4.2: Reinterpreting Types Using as_type() and as_typen()
11+ * 6.9: Preprocessor Directives and Macros
12+ * 6.11: Built-in Functions
13+ * 9.3: Double Precision Floating-Point
14+ * 9.4: 64-bit Atomics
15+ * 9.5: Writing to 3D image memory objects
16+ * 9.6: Half Precision Floating-Point
1817
1918libclc is intended to be used with the Clang compiler's OpenCL frontend.
2019
@@ -26,44 +25,43 @@ functions.
2625libclc currently supports PTX, AMDGPU, SPIRV and CLSPV targets, but support for
2726more targets is welcome.
2827
29- Compiling and installing
30- ------------------------
28+ ## Compiling and installing
3129
32- (in the following instructions you can use make or ninja)
30+ (in the following instructions you can use ` make ` or ` ninja ` )
3331
3432For an in-tree build, Clang must also be built at the same time:
35-
33+ ```
3634$ cmake <path-to>/llvm-project/llvm/CMakeLists.txt -DLLVM_ENABLE_PROJECTS="libclc;clang" \
3735 -DCMAKE_BUILD_TYPE=Release -G Ninja
3836$ ninja
39-
37+ ```
4038Then install:
41-
39+ ```
4240$ ninja install
43-
44- Note you can use the DESTDIR Makefile variable to do staged installs.
45-
41+ ```
42+ Note you can use the ` DESTDIR ` Makefile variable to do staged installs.
43+ ```
4644$ DESTDIR=/path/for/staged/install ninja install
47-
45+ ```
4846To build out of tree, or in other words, against an existing LLVM build or install:
49-
47+ ```
5048$ cmake <path-to>/llvm-project/libclc/CMakeLists.txt -DCMAKE_BUILD_TYPE=Release \
5149 -G Ninja -DLLVM_DIR=$(<path-to>/llvm-config --cmakedir)
5250$ ninja
53-
51+ ```
5452Then install as before.
5553
5654In both cases this will include all supported targets. You can choose which
5755targets are enabled by passing ` -DLIBCLC_TARGETS_TO_BUILD ` to CMake. The default
58- is " all" .
56+ is ` all ` .
5957
6058In both cases, the LLVM used must include the targets you want libclc support for
61- (AMDGPU and NVPTX are enabled in LLVM by default). Apart from SPIRV where you do
62- not need an LLVM target but you do need the llvm-spirv tool
63- (https://github.com/KhronosGroup/SPIRV-LLVM-Translator) available. Either build
64- this in-tree, or place it in the directory pointed to by `LLVM_TOOLS_BINARY_DIR`.
59+ (` AMDGPU ` and ` NVPTX ` are enabled in LLVM by default). Apart from ` SPIRV ` where you do
60+ not need an LLVM target but you do need the
61+ [ llvm-spirv tool] ( https://github.com/KhronosGroup/SPIRV-LLVM-Translator ) available.
62+ Either build this in-tree, or place it in the directory pointed to by
63+ ` LLVM_TOOLS_BINARY_DIR ` .
6564
66- Website
67- -------
65+ ## Website
6866
6967https://libclc.llvm.org/
0 commit comments