SYCL for C++, i.e. in a data-parallel and explicit fashion. Similar to CUDA but open and cross-platform.SYCL is an open industry and cross-platform programming standard for C++ in a data-parallel and explicit fashion. Different to OpenMP, SYCL provides for more control over the code, data movements, allocations and so forth that are actually executed on the GPU. There is no SYCL for C or Fortran.
The SYCL implementation for Intel GPUs is provided by oneAPI. On the PVC partition, SYCL code can be compiled with the icpx compiler from the intel environment module(s).
Migration of existing CUDA codes to SYCL can be assisted using the DPC++ Compatibility Tool. The dpct binary is available via the intel/... environment modules.
Note that SYCL codes can also be executed on Nvidia (and AMD) GPUs.
Minimal SYCL C++ Code Example:
The code below originates from https://intel.github.io/llvm-docs/GetStartedGuide.html or https://github.com/intel/llvm/blob/sycl/sycl/doc/GetStartedGuide.md.
Compile the code for an Intel GPU with
icpx -fsycl minimal-sycl-code.cpp -o pvc.exe
and then run it via:
SYCL_PI_TRACE=1 ./pvc.exe
The environment variable SYCL_PI_TRACEadds SYCL debug information, e.g. the name of the used offload device.
The same code could be executed on a Nvidia GPU by loading thecudaenvironment module, recompiling via
icpx -fsycl -fsycl-targets=nvptx64-nvidia-cuda minimal-sycl-code.cpp -o a100.exe
and running
ONEAPI_DEVICE_SELECTOR=cuda:* SYCL_PI_TRACE=1 ./a100.exe
module add intel