SYCL from Khronos Group and Integration with Intel oneAPI

kazi haque
5 min readMay 24, 2022

--

— cross-platform abstraction layer that enables code for heterogeneous processors

As promised in my last article, in this one we are going to discuss about SYCL, regarding “What it’s about”, “How to implement” and other interesting topics, please give it a read and explore!

Overview:

SYCL (pronounced ‘sickle’) is a royalty-free, cross-platform abstraction layer that enables code for heterogeneous processors to be written using standard ISO C++ with the host and kernel code for an application contained in the same source file.

  • SYCL is an alternative to single-vendor proprietary accelerator programming languages
  • Allows code reuse across hardware targets (CPU, GPU, FPGA) and supports custom tuning for a specific platform
  • SYCL is a Khronos standard that adds data parallelism and heterogeneous programming to familiar and standard ISO C++

Why ? How does it make our life easier?

As developers, we’ve continuously worked on dedicated architectures to accelerate our applications. Each device may require specific optimization procedures for top performance. This situation typically exposes us to various programming languages and vendor-specific libraries. As a result, developing applications across architectures is challenging :(

But if we care about performance and efficiency, we need to regularly reuse our code on new hardware as it becomes available. We must ensure we don’t leave any transistors, resistors, or semiconductors behind.

To achieve high performance and efficiency, we need a unified and simplified programming model enabling us to select the optimal hardware for the task at hand. We need a high-level, open standard, heterogeneous programming language that’s both built on evolutions of standards and extensible. It must boost developer productivity while providing consistent performance across architectures. The oneAPI specification addresses these challenges.

SYCL Implementations in Development (Fig 1.1)

SYCL implementations are available from an increasing number of vendors, including adding support for diverse acceleration API back-ends in addition to OpenCL.

Fig 1.1

Now let's explore the Integration of Intel with SYCL :

The oneAPI specification includes Data Parallel C++ (DPC++), oneAPI’s implementation of the Khronos SYCL standard. It also includes specific libraries and a hardware abstraction layer. Additionally, Intel oneAPI toolkits provide implementations of the specification by providing compilers, optimized libraries, the Intel® DPC++ Compatibility Tool(DPCT), and advanced analysis and debug tools.

Intel® oneAPI DPC++/C++ Compiler
A Standards-Based, Cross-architecture Compiler

Future-Ready Programming Model Provides Freedom of Choice
What You Can Do

  • Compile ISO C++ and SYCL* (from the Khronos* Group)
  • Reuse code across hardware targets, including CPUs, GPUs, and FPGAs.
    Avoid proprietary lock-in with a cross-industry, open, standards-based unified programming model.

Features:

Cross-Architecture Compiling (Fig 2.1):

  • Development Productivity: Targets CPUs and accelerators through single-source code while permitting custom tuning.
  • Language Standards Support: Is built to the latest standards, including C++ 17 and SYCL**, and initial support for C++ 20, to ensure portability and support of features like generic lambda expressions and variable templates.
  • Industry Standards Support: Supports a subset of OpenMP 4.5, 5.0, and 5.1 for GPU offload**
  • Trusted Technology: Uses well-proven LLVM compiler technology as well as Intel’s history of compiler leadership

**Available in the Intel oneAPI DPC++/C++ Compiler only.

Fig (2.1)

FPGA Emulation and Compilation (Fig 2.2):

  • Enables experienced FPGA developers to target accelerations workloads to field-programmable platforms
  • Is included with the compiler
Fig (2.2)

Now, let’s go into a bit of detail about,

Intel® oneAPI DPC++ Library
-
Speed Up DPC++ (SYCL*) Kernels on CPUs, GPUs, and FPGAs

High-Productivity APIs for Heterogeneous Computing

The Intel® oneAPI DPC++ Library (oneDPL) is a companion to the Intel® oneAPI DPC++/C++ Compiler and provides an alternative for C++ developers who create heterogeneous applications and solutions. Its APIs are based on familiar standards — C++ STL, Parallel STL (PSTL), Boost. Compute, and SYCL* — to maximize productivity and performance across CPUs, GPUs, and FPGAs.

  • Allows explicit use of the C++ STL API within accelerated DPC++ kernels
  • Streamline cross-architecture programming with Boost.Compute and PSTL algorithm extensions
  • Increase the successful application of parallel algorithms with custom iterators

Now, you can use the Intel® oneAPI DPC++ Library by downloading:

a. As part of toolkit
oneDPL is included as part of the Intel® oneAPI Base Toolkit, which is a core set of tools and libraries for developing high-performance, data-centric applications across diverse architectures.
Click here to download

b. As the Stand-Alone Version
A stand-alone download of oneDPL is available. You can download binaries from Intel or choose your preferred repository.
Click here to download

c. Develop in the Free Intel® Cloud
Get what you need to build and optimize your oneAPI projects for free. With an Intel® DevCloud account, you get 120 days of access to the latest Intel® hardware — CPUs, GPUs, FPGAs — and Intel® oneAPI tools and frameworks. No software downloads. No configuration steps. No installations.
For this you need to have registered in the Intel Dev Cloud, if you have still not done it, please follow my article to know how to get yourself registered or click here to get the access.

Great, now hope you have got a clear idea about SYCL, Integration of SYCL with Intel oneAPI through The Intel® oneAPI DPC++ Library and its features, in the next article , we will do a complete Walkthrough a SYCL based code with an example and also will discuss about how to migrate code CUDA code to SYCL using Real-world examples, stay tuned!

Agin a reminder of an exciting Blogathon contest going on with great knowledge share of resources and exciting prizes too! Please visit and share your blogs.

About me:

I am an Intel Certified Instructor for one oneAPI track along with oneAPI Innovator. Please explore the below links for my bio and feel free to reach me in case of any queries.

--

--