Skip to content

Commit 2cf077c

Browse files
committed
[SYCL][DOC] update docs to reflect devicelib change
describe the use of buildbot scripts in GetStartedGuide.md * use configure.py and compile.py * describe common flags * remove unacessible opencl-aot flags (->enabled by default) * add cross reference to buildbot configuration script * set DPCPP_HOME to ~/sycl_workspace in unix Signed-off-by: hiaselhans <[email protected]>
1 parent 5fc7ae1 commit 2cf077c

File tree

1 file changed

+35
-49
lines changed

1 file changed

+35
-49
lines changed

sycl/doc/GetStartedGuide.md

Lines changed: 35 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,16 @@ Throughout this document `DPCPP_HOME` denotes the path to the local directory
3636
created as DPC++ workspace. It might be useful to create an environment variable
3737
with the same name.
3838

39+
3940
**Linux**
4041

4142
```bash
42-
export DPCPP_HOME=/export/home/sycl_workspace
43-
mkdir $DPCPP_HOME
43+
export DPCPP_HOME=~/sycl_workspace
44+
mkdir -p $DPCPP_HOME/build
45+
cd $DPCPP_HOME
46+
47+
git clone https://github.com/intel/llvm -b sycl
48+
cd $DPCPP_HOME/build
4449
```
4550

4651
**Windows (64-bit)**
@@ -55,55 +60,49 @@ Open a developer command prompt using one of two methods:
5560
```bat
5661
set DPCPP_HOME=%USERPROFILE%\sycl_workspace
5762
mkdir %DPCPP_HOME%
63+
cd %DPCPP_HOME%
64+
65+
git clone https://github.com/intel/llvm -b sycl
66+
mkdir %DPCPP_HOME%\build
67+
cd %DPCPP_HOME%\build
5868
```
5969

6070
# Build DPC++ toolchain
6171

62-
**Linux**
63-
```bash
64-
cd $DPCPP_HOME
65-
git clone https://github.com/intel/llvm -b sycl
66-
mkdir $DPCPP_HOME/build
67-
cd $DPCPP_HOME/build
72+
The easiest way to get started is to use the buildbot [configure](../../buildbot/configure.py)
73+
and [compile](../../buildbot/configure.py) scripts.
6874

69-
cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" \
70-
-DLLVM_EXTERNAL_PROJECTS="llvm-spirv;sycl" \
71-
-DLLVM_ENABLE_PROJECTS="clang;llvm-spirv;sycl" \
72-
-DLLVM_EXTERNAL_SYCL_SOURCE_DIR=$DPCPP_HOME/llvm/sycl \
73-
-DLLVM_EXTERNAL_LLVM_SPIRV_SOURCE_DIR=$DPCPP_HOME/llvm/llvm-spirv \
74-
$DPCPP_HOME/llvm/llvm
75+
In case you want to configure Cmake manually the up-to-date reference for variables is in these files.
7576

76-
make -j`nproc` sycl-toolchain
77+
**Linux**
78+
79+
```bash
80+
python $DPCPP_HOME/llvm/buildbot/configure.py -s $DPCPP_HOME/llvm -o $DPCPP_HOME/build -t release
81+
python $DPCPP_HOME/llvm/buildbot/compile.py -s $DPCPP_HOME/llvm -o $DPCPP_HOME/build
7782
```
7883

79-
**Windows (64-bit)**
84+
**Windows**
85+
8086
```bat
81-
cd %DPCPP_HOME%
82-
git clone https://github.com/intel/llvm -b sycl
83-
mkdir %DPCPP_HOME%\build
84-
cd %DPCPP_HOME%\build
87+
python %DPCPP_HOME%\llvm\buildbot\configure.py -s %DPCPP_HOME%\llvm -o %DPCPP_HOME%\build -t release
88+
python %DPCPP_HOME%\llvm\buildbot\compile.py -s %DPCPP_HOME%\llvm -o %DPCPP_HOME%\build
89+
```
8590

86-
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" ^
87-
-DLLVM_EXTERNAL_PROJECTS="llvm-spirv;sycl" ^
88-
-DLLVM_ENABLE_PROJECTS="clang;llvm-spirv;sycl" ^
89-
-DLLVM_EXTERNAL_SYCL_SOURCE_DIR="%DPCPP_HOME%\llvm\sycl" ^
90-
-DLLVM_EXTERNAL_LLVM_SPIRV_SOURCE_DIR="%DPCPP_HOME%\llvm\llvm-spirv" ^
91-
-DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl ^
92-
"%DPCPP_HOME%\llvm\llvm"
91+
**Options**
9392

94-
ninja sycl-toolchain
95-
```
93+
You can use the following flags with `configure.py`:
9694

97-
To use ahead-of-time compilation for the Intel&reg; processors, additionally
98-
build opencl-aot target:
95+
* `--no-ocl` -> Download OpenCL deps via cmake (can be useful in case of troubles)
96+
* `--cuda` -> use the cuda backend (see [Nvidia CUDA](#build-dpc-toolchain-with-support-for-nvidia-cuda))
97+
* `--shared-libs` -> Build shared libraries
98+
* `-t` -> Build type (debug or release)
9999

100-
1. add ```opencl-aot``` to ```-DLLVM_EXTERNAL_PROJECTS``` and
101-
```-DLLVM_ENABLE_PROJECTS``` variables above
102-
2. add ```opencl-aot``` to
103-
```make``` (for Linux) or ```ninja``` (for Windows) commands above
104100

101+
Ahead-of-time compilation for the Intel&reg; processors is enabled by default.
105102
For more, see [opencl-aot documentation](../../opencl-aot/README.md).
106103

104+
**Deployment**
105+
107106
TODO: add instructions how to deploy built DPC++ toolchain.
108107

109108
## Build DPC++ toolchain with libc++ library
@@ -124,20 +123,7 @@ should be used.
124123
There is experimental support for DPC++ for CUDA devices.
125124

126125
To enable support for CUDA devices, follow the instructions for the Linux
127-
DPC++ toolchain, but replace the cmake command with the following one:
128-
129-
130-
```
131-
cmake -DCMAKE_BUILD_TYPE=Release \
132-
-DLLVM_EXTERNAL_PROJECTS="llvm-spirv;sycl" \
133-
-DLLVM_EXTERNAL_SYCL_SOURCE_DIR=$DPCPP_HOME/llvm/sycl \
134-
-DLLVM_EXTERNAL_LLVM_SPIRV_SOURCE_DIR=$DPCPP_HOME/llvm/llvm-spirv \
135-
-DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda/ \
136-
-DLLVM_ENABLE_PROJECTS="clang;llvm-spirv;sycl;libclc" \
137-
-DSYCL_BUILD_PI_CUDA=ON \
138-
-DLLVM_TARGETS_TO_BUILD="X86;NVPTX" \
139-
-DLIBCLC_TARGETS_TO_BUILD="nvptx64--;nvptx64--nvidiacl"
140-
```
126+
DPC++ toolchain, but add the `--cuda` flag to `configure.py`
141127

142128
Enabling this flag requires an installation of
143129
[CUDA 10.1](https://developer.nvidia.com/cuda-10.1-download-archive-update2) on the system,

0 commit comments

Comments
 (0)