|
| 1 | +# How to Install SYCL |
| 2 | + |
| 3 | +## triSYCL |
| 4 | + |
| 5 | +See https://github.com/triSYCL/triSYCL. This is a header-only implementation, so you can use |
| 6 | +any C++17 compiler (C++14 might be sufficient). You need Boost, while OpenMP or TBB are optional |
| 7 | +for threaded parallelism on the CPU. |
| 8 | + |
| 9 | +## CodePlay ComputeCpp |
| 10 | + |
| 11 | +See https://www.codeplay.com/products/computesuite/computecpp. |
| 12 | + |
| 13 | +## Intel Data Parallel C++ |
| 14 | + |
| 15 | +This comes in two flavors. You can compile the open-source version on GitHub and use `clang++ -fsycl`, |
| 16 | +or you can install oneAPI and use the `dpcpp` driver, which is a wrapper around `clang++ -fsycl`. |
| 17 | + |
| 18 | +### oneAPI Download |
| 19 | + |
| 20 | +See https://software.intel.com/en-us/articles/installation-guide-for-intel-oneapi-toolkits. |
| 21 | + |
| 22 | +### Linux packages |
| 23 | + |
| 24 | +See https://software.intel.com/en-us/articles/oneapi-repo-instructions. |
| 25 | + |
| 26 | +### Build from source |
| 27 | + |
| 28 | +See https://github.com/intel/llvm/blob/sycl/sycl/doc/GetStartedWithSYCLCompiler.md for details. |
| 29 | + |
| 30 | +The following is my automation once the repo is cloned. |
| 31 | + |
| 32 | +```sh |
| 33 | +#!/bin/bash |
| 34 | + |
| 35 | +export SYCL_HOME=$HOME/ISYCL |
| 36 | + |
| 37 | +#cd $SYCL_HOME/llvm && time git checkout usmapi && time git pull |
| 38 | +cd $SYCL_HOME/llvm && time git checkout sycl && time git pull |
| 39 | + |
| 40 | +rm -rf $SYCL_HOME/build |
| 41 | + |
| 42 | +mkdir -p $SYCL_HOME/build && \ |
| 43 | + cd $SYCL_HOME/build && \ |
| 44 | + time cmake \ |
| 45 | + -DCMAKE_INSTALL_PREFIX=/opt/isycl \ |
| 46 | + -DCMAKE_BUILD_TYPE=Release \ |
| 47 | + -DLLVM_ENABLE_PROJECTS="clang;llvm-spirv;sycl" \ |
| 48 | + -DLLVM_EXTERNAL_PROJECTS="llvm-spirv;sycl" \ |
| 49 | + -DLLVM_EXTERNAL_SYCL_SOURCE_DIR=$SYCL_HOME/llvm/sycl \ |
| 50 | + -DLLVM_EXTERNAL_LLVM_SPIRV_SOURCE_DIR=$SYCL_HOME/llvm/llvm-spirv \ |
| 51 | + -DLLVM_TOOL_SYCL_BUILD=ON \ |
| 52 | + -DLLVM_TOOL_LLVM_SPIRV_BUILD=ON \ |
| 53 | + $SYCL_HOME/llvm/llvm && \ |
| 54 | + |
| 55 | +time make -j4 sycl-toolchain |
| 56 | + |
| 57 | +time make -j4 sycl-toolchain install #DESTDIR=/opt/isycl |
| 58 | +``` |
| 59 | + |
| 60 | +## hipSYCL |
| 61 | + |
| 62 | +See https://github.com/illuhad/hipSYCL/tree/master/doc for other options. |
| 63 | + |
| 64 | +### Spack |
| 65 | + |
| 66 | +https://github.com/spack/spack/pull/14051 is not merged yet but this works if you grab the PR. |
| 67 | + |
| 68 | +```sh |
| 69 | +./bin/spack install hipsycl +cuda |
| 70 | +``` |
0 commit comments