Skip to content

Commit 1cf024a

Browse files
authored
[SYCL][DOC] Update CUDA docs with Windows support details (#4796)
This patch updates the compiler and runtime docs and getting started docs with details of CUDA's support for Windows. It explains the motivation and usage of re-mangled `libspirv-nvptx64--nvidiacl.bc` variants. Links to url for installing CUDA on Windows OS. Clearly states that there should be no dependencies on Linux system.
1 parent 554b79c commit 1cf024a

File tree

2 files changed

+31
-8
lines changed

2 files changed

+31
-8
lines changed

sycl/doc/CompilerAndRuntimeDesign.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,12 @@ passed to `-fsycl-targets`.
538538
Unlike other AOT targets, the bitcode module linked from intermediate compiled
539539
objects never goes through SPIR-V. Instead it is passed directly in bitcode form
540540
down to the NVPTX Back End. All produced bitcode depends on two libraries,
541-
`libdevice.bc` (provided by the CUDA SDK) and `libspirv-nvptx64--nvidiacl.bc`
542-
(built by the libclc project).
541+
`libdevice.bc` (provided by the CUDA SDK) and `libspirv-nvptx64--nvidiacl.bc` variants
542+
(built by the libclc project). `libspirv-nvptx64--nvidiacl.bc` is not used directly.
543+
Instead it is used to generate remangled variants
544+
`remangled-l64-signed_char.libspirv-nvptx64--nvidiacl.bc` and
545+
`remangled-l32-signed_char.libspirv-nvptx64--nvidiacl.bc` to handle primitive type
546+
differences between Linux and Windows.
543547

544548
##### Device code post-link step for CUDA
545549

@@ -568,6 +572,19 @@ path in SYCL kernels.
568572

569573
##### NVPTX Builtins
570574

575+
Builtins are implemented in OpenCL C within libclc. OpenCL C treats `long`
576+
types as 64 bit and has no `long long` types while Windows DPC++ treats `long`
577+
types like 32-bit integers and `long long` types like 64-bit integers.
578+
Differences between the primitive types can cause applications to use
579+
incompatible libclc built-ins. A remangler creates multiple libspriv files
580+
with different remangled function names to support both Windows and Linux.
581+
When building a SYCL application targeting the CUDA backend the driver
582+
will link the device code with
583+
`remangled-l32-signed_char.libspirv-nvptx64--nvidiacl.bc` if the host target is
584+
Windows or it will link the device code with
585+
`remangled-l64-signed_char.libspirv-nvptx64--nvidiacl.bc` if the host target is
586+
Linux.
587+
571588
When the SYCL compiler is in device mode and targeting the NVPTX backend, the
572589
compiler exposes NVPTX builtins supported by clang.
573590

sycl/doc/GetStartedGuide.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,18 +148,24 @@ python %DPCPP_HOME%\llvm\buildbot\compile.py
148148

149149
There is experimental support for DPC++ for CUDA devices.
150150

151-
To enable support for CUDA devices, follow the instructions for the Linux
152-
DPC++ toolchain, but add the `--cuda` flag to `configure.py`
151+
To enable support for CUDA devices, follow the instructions for the Linux or
152+
Windows DPC++ toolchain, but add the `--cuda` flag to `configure.py`. Note,
153+
the CUDA backend has experimental Windows support, windows subsystem for
154+
linux (WSL) is not needed to build and run the CUDA backend.
153155

154156
Enabling this flag requires an installation of
155157
[CUDA 10.2](https://developer.nvidia.com/cuda-10.2-download-archive) on
156158
the system, refer to
157-
[NVIDIA CUDA Installation Guide for Linux](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html).
159+
[NVIDIA CUDA Installation Guide for Linux](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html)
160+
or
161+
[NVIDIA CUDA Installation Guide for Windows](https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html)
158162

159163
Currently, the only combination tested is Ubuntu 18.04 with CUDA 10.2 using
160-
a Titan RTX GPU (SM 71), but it should work on any GPU compatible with SM 50 or
161-
above. The default SM for the NVIDIA CUDA backend is 5.0. Users can specify
162-
lower values, but some features may not be supported.
164+
a Titan RTX GPU (SM 71). The CUDA backend should work on Windows or Linux
165+
operating systems with any GPU compatible with SM 50 or above. The default
166+
SM for the NVIDIA CUDA backend is 5.0. Users can specify lower values,
167+
but some features may not be supported. Windows CUDA support is experimental
168+
as it is not currently tested on the CI.
163169

164170
**Non-standard CUDA location**
165171

0 commit comments

Comments
 (0)