Compiler Explorer Developer Tool Adds SYCL 2020 Support
Matt Godbolt’s Compiler Explorer has been updated to make testing, analyzing, and comparing compiled SYCL code faster and easier
First introduced in 2014 by the Khronos Group®, SYCL™ is a C++ based heterogeneous parallel programming framework for accelerating high performance computing (HPC), machine learning, embedded computing, and compute-intensive desktop applications on a wide range of processor architectures, including CPUs, GPUs, FPGAs, and tensor accelerators. SYCL 2020 launched in February 2021 to bring a new level of expressiveness and simplicity to developers programming heterogeneous parallel processors using modern C++, and further accelerating the deployment of SYCL on multiple platforms, including the use of diverse acceleration API backends in addition to OpenCL™.
Compiler Explorer is a free and open-source website that lets developers edit excerpts of their source code and interactively inspect, compare, analyze and tune the code generated by multiple compilers. Compiler Explorer has supported 38 programming languages including C, C++, D, Rust, Haskell, ispc, and Java. Now, through the addition of support for SYCL, developers can use Compiler Explorer to review application source code using the complete SYCL 2020 standard and analyze compiler optimizations, encouraging the use of SYCL in both production and educational environments.
For example, SYCL developers can use the Intel DPC++ compiler to build their SYCL programs and Compiler Explorer to inspect both the compiled host and intermediate device code for kernels, providing a powerful way to inspect how performance-sensitive kernels are being optimized by the compiler.
Dr. Tom Deakin, Lecturer (equiv. Assistant Professor) in Advanced Computer Systems at the University of Bristol, UK, said: “Compiler Explorer is a tool we tell all our CS students about in their first year. It helps them to see through the “compiler magic” and get a handle on how the programs they write are turned into the stuff that runs on processors - something that all heterogeneous programmers need to know! It’s great that SYCL is now available in Compiler Explorer too.”
The SYCL Working Group at Khronos has a development pipeline to further enhance support for SYCL in Compiler Explorer, in addition to the specific SYCL tag:
- Generate SPIR-V code for SYCL kernels
- Enable code generation from multiple SYCL implementations, including DPC++, ComputeCpp, and hipSYCL, enabling users to check for program correctness and search for cross-platform optimization opportunities
- Increase support for generating a wider range of device code, to showcase SYCL’s ability to support a wide and diverse range of heterogeneous devices and accelerators
Check out an example of a SYCL program in Compiler Explorer from Codeplay: https://godbolt.org/z/ab9sfvEra
The result of three years of work, SYCL 2020 aligns closely with ISO C++17 to simplify porting of standard C++ applications. Backwards compatible with previous SYCL versions, SYCL 2020 provides significant new functionality for improved programmability, smaller code size, and faster performance – and is consequently being widely adopted in desktop and supercomputer markets as well as for use in embedded systems.
The SYCL ecosystem is enjoying strong developer momentum, and now has over a dozen implementations including ComputeCPP, hipSYCL, DPC++ and oneAPI, and triSYCL. The SYCL Working Group within Khronos has recently seen a doubling in the number of members actively participating in SYCL development and maintenance. It is easy to build SYCL on any device and there are currently nearly 150 active SYCL projects ranging from benchmarks, frameworks, compilers (including clang/LLVM), runtimes, libraries, tools, and scientific applications. A complete repository of tools can be found at https://sycl.tech/
SYCL is evolving to meet market needs, and over time will align even more closely with ISO C++. The SYCL Working Group will also expand conformance testing, improve the SYCL SDK out-of-the-box experience, and make it easy to use any online SYCL Compiler. In 2022, Khronos created the SYCL Safety Critical Exploratory Forum to investigate the market need for an API that leverages SYCL in safety-critical markets such as automotive, avionics, medical, and industrial. The recommendations from that study are expected soon.