1
- libclc
2
- ------
1
+ # libclc
3
2
4
3
libclc is an open source implementation of the library
5
4
requirements of the OpenCL C programming language, as specified by the
6
5
OpenCL 1.1 Specification. The following sections of the specification
7
6
impose library requirements:
8
7
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
18
17
19
18
libclc is intended to be used with the Clang compiler's OpenCL frontend.
20
19
@@ -26,44 +25,43 @@ functions.
26
25
libclc currently supports PTX, AMDGPU, SPIRV and CLSPV targets, but support for
27
26
more targets is welcome.
28
27
29
- Compiling and installing
30
- ------------------------
28
+ ## Compiling and installing
31
29
32
- (in the following instructions you can use make or ninja)
30
+ (in the following instructions you can use ` make ` or ` ninja ` )
33
31
34
32
For an in-tree build, Clang must also be built at the same time:
35
-
33
+ ```
36
34
$ cmake <path-to>/llvm-project/llvm/CMakeLists.txt -DLLVM_ENABLE_PROJECTS="libclc;clang" \
37
35
-DCMAKE_BUILD_TYPE=Release -G Ninja
38
36
$ ninja
39
-
37
+ ```
40
38
Then install:
41
-
39
+ ```
42
40
$ 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
+ ```
46
44
$ DESTDIR=/path/for/staged/install ninja install
47
-
45
+ ```
48
46
To build out of tree, or in other words, against an existing LLVM build or install:
49
-
47
+ ```
50
48
$ cmake <path-to>/llvm-project/libclc/CMakeLists.txt -DCMAKE_BUILD_TYPE=Release \
51
49
-G Ninja -DLLVM_DIR=$(<path-to>/llvm-config --cmakedir)
52
50
$ ninja
53
-
51
+ ```
54
52
Then install as before.
55
53
56
54
In both cases this will include all supported targets. You can choose which
57
55
targets are enabled by passing ` -DLIBCLC_TARGETS_TO_BUILD ` to CMake. The default
58
- is " all" .
56
+ is ` all ` .
59
57
60
58
In 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 ` .
65
64
66
- Website
67
- -------
65
+ ## Website
68
66
69
67
https://libclc.llvm.org/
0 commit comments