Skip to content

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

--8<-- "docs/development/programming-models/sycl/main.cpp"

Makefile

--8<-- "docs/development/programming-models/sycl/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

--8<-- "docs/development/programming-models/sycl/sycl-gemm-usm.cpp"

Makefile

--8<-- "docs/development/programming-models/sycl/Makefile.gemm"
$ 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

Support