|
1 | 1 | # OpenCL ahead-of-time compilation tool (opencl-aot)
|
2 | 2 |
|
3 |
| -OpenCL ahead-of-time compilation tool (opencl-aot) is a tool which generates device-dependent OpenCL program |
4 |
| -binary from SPIR-V binary primarily for Intel(R) processor devices. |
| 3 | +OpenCL ahead-of-time compilation tool (`opencl-aot`) is a tool which generates |
| 4 | +device-dependent OpenCL program binary from SPIR-V binary primarily for Intel(R) |
| 5 | +processor devices. |
5 | 6 |
|
6 | 7 | ## Prerequisites
|
7 | 8 |
|
8 |
| -To use opencl-aot tool, you must have: |
9 |
| -* OpenCL runtime installed for the target device (see [Install low level runtime](../sycl/doc/GetStartedWithSYCLCompiler.md)) |
| 9 | +To use `opencl-aot` tool, you must have: |
| 10 | + |
| 11 | +* OpenCL runtime installed for the target device (see |
| 12 | + [Install low level runtime](../sycl/doc/GetStartedGuide.md#install-low-level-runtime)) |
10 | 13 | * OpenCL ICD Loader installed with support of OpenCL 2.1 or higher
|
11 | 14 |
|
12 | 15 | ## How to use
|
13 | 16 |
|
14 |
| -opencl-aot tool is integrated with Clang. To use ahead-of-time compilation for SYCL application for |
15 |
| -Intel(R) processor device, run Clang with `-fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice` option. |
16 |
| -To enable optimizations for target CPU architecture, add `-Xsycl-target-backend "-march=<arch>"` option, where `<arch>` |
17 |
| -could be `avx512`, `avx2`, `avx` or `sse4.2`. |
| 17 | +`opencl-aot` tool is integrated with Clang. To use ahead-of-time compilation for |
| 18 | +SYCL application for Intel(R) processor device, run Clang with |
| 19 | +`-fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice` option. |
| 20 | + |
| 21 | +To enable optimizations for target CPU architecture, add |
| 22 | +`-Xsycl-target-backend "-march=<arch>"` option, where `<arch>` could be |
| 23 | +`avx512`, `avx2`, `avx` or `sse4.2`. |
| 24 | + |
| 25 | +To execute `opencl-aot` directly for Intel(R) processor device, run it with |
| 26 | +`<spv> -o=<output> --device=cpu`, where `<spv>` is path to SPIR-V binary file, |
| 27 | +`<output>` is path to created OpenCL program binary file. |
18 | 28 |
|
19 |
| -To execute opencl-aot directly for Intel(R) processor device, run it with `<spv> -o=<output> --device=cpu`, where `<spv>` is |
20 |
| -path to SPIR-V binary file, `<output>` is path to created OpenCL program binary file. |
21 |
| -To generate SPIR-V binary file from OpenCL device kernel code, use Clang to generate LLVM IR and pass it to |
22 |
| -[llvm-spirv](https://github.com/KhronosGroup/SPIRV-LLVM-Translator) tool. For more |
23 |
| -information about generation LLVM IR from OpenCL device kernel code, see |
24 |
| -[OpenCL Features](https://clang.llvm.org/docs/UsersManual.html#opencl-features) of Clang Compiler User's Manual. |
| 29 | +To generate SPIR-V binary file from OpenCL device kernel code, use Clang to |
| 30 | +generate LLVM IR and pass it to |
| 31 | +[llvm-spirv](https://github.com/KhronosGroup/SPIRV-LLVM-Translator) tool. For |
| 32 | +more information about generation LLVM IR from OpenCL device kernel code, see |
| 33 | +[OpenCL Features](https://clang.llvm.org/docs/UsersManual.html#opencl-features) |
| 34 | +of Clang Compiler User's Manual. |
25 | 35 |
|
26 |
| -For more information about opencl-aot tool, execute it with `--help` option. |
| 36 | +For more information about `opencl-aot` tool, execute it with `--help` option. |
0 commit comments