SYCL¶
SYCL is a cross-platform abstraction layer that enables code for heterogeneous processors to be written using C++ with the host and kernel code for an application contained in the same source file. On NERSC systems, only the Intel 2024.1.0 module supports SYCL.
Vector Addition Example¶
sycl-vecadd-buffer.cpp
Makefile
$ module load intel/2024.1.0
$ make
icpx -std=c++17 -fsycl -fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend '--cuda-gpu-arch=sm_80' -o sycl-vecadd-buffer.x sycl-vecadd-buffer.cpp
$ ./sycl-vecadd-buffer.x
sum = 1
oneMKL Example¶
sycl-gemm-usm.cpp
Makefile
$ module load intel/2024.1.0
$ export LD_LIBRARY_PATH=/global/common/software/nersc9/onemkl/experimental-2024-06-20/lib:$LD_LIBRARY_PATH
$ make
icpx -std=c++17 -fsycl -fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend '--cuda-gpu-arch=sm_80' -I/global/common/software/nersc9/onemkl/experimental-2024-06-20/include -L/global/common/software/nersc9/onemkl/experimental-2024-06-20/lib -lonemkl -o sycl-gemm-usm.x sycl-gemm-usm.cpp
$ ./sycl-gemm-usm.x
References¶
- NERSC, ALCF, Codeplay partnership
- DPC++ tutorial
- DPC++ Examples from Intel
- Free ebook on SYCL programming
- SYCL 2020 Specification
- SYCL.tech portal
- Codeplay material
- oneMKL
Support¶
#syclchannel in NERSC Users Slack (login required)- NERSC Help Desk