2026-02-14

SYCL

Table of Contents

It is an standard by Khronos group. It extends C++ language, and defines DPC++

Compiler implmentations are provided by

  1. Intel oneAPI
  2. adaptiveCPP
  3. Other (noeSYCL, triSYCL (from AMD), …)

ipcx (intel's compiler) can target intel's CPU and GPUs. Using extension packs we can target Nividia and AMD gpus too. The MAC metals target are now discontinued by ipcx.

Intel had stopped shipping binary for the nvidia and amd extensions. They must now be built from source. See instructions here intel.com.

Current standard is 2020. Intel's oneAPI 2025.3 implements that standard.

1. Hello World

#include <sycl/sycl.hpp>
#include <iostream>

int main() {
    // 1. Create a queue to offload work to a device (auto-selects best available)
    sycl::queue q;

    // 2. Output the device being used
    std::cout << "Running on: "
            << q.get_device().get_info<sycl::info::device::name>()
            << "\n";

    // 3. Submit a task to the queue
    q.submit([&](sycl::handler& h) {
        // Create a stream to print from the device
        sycl::stream out(1024, 128, h);

        h.single_task([=]() {
            out << "Hello World from SYCL device!\n";
        });
    }).wait(); // Wait for the device to finish before exiting

    return 0;
}

Compile it as follows using Intel's compiler:

source /opt/intel/oneapi/setvars.sh
icpx -fsycl hello_world.cpp -o hello_world_intel
icpx -fsycl -fsycl-targets=nvptx64-nvidia-cuda  hello_world.cpp -o hello_world_cuda

Output from hello_world_intel:

Running on: Intel(R) Xeon(R) Silver 4210R CPU @ 2.40GHz
Hello World from SYCL device!

Output from hello_world_cuda:

Running on: Quadro RTX 4000
Hello World from SYCL device!


You can send your feedback, queries here