SYCL has a lot of interesting advantages compared to plain OpenCL or other approaches:
SYCL is an open standard from Khronos with a working committee (you can contribute!) and we can expect several implementations (commercial or open source) on many platforms soon, ranging from GPU, APU, FPGA, DSP... down to plain CPU;
it offers a single-source C++ programming model that allows taking advantage of the modern C++14/C++17 superpower, unifying both the host and accelerator sides. For example it is possible to write generic accelerated functions on the accelerators in a terse way by using (variadic) templates, meta-programming and generic variadic lambda expressions. This allows to build templated libraries such as Eigen or TensorFlow in a seamless way;
SYCL abstracts and leverages the concepts behind OpenCL and provides higher-level concepts such as tasks (or command group in OpenCL SYCL jargon) that allow the runtime to take advantage of a more task graph-oriented view of the computations. This allows lazy data transfers between accelerators and host or to use platform capabilities such as OpenCL 2 SVM or HSA for sharing data between host and accelerators;
the entry cost of the technology is zero since, after all, an existing OpenCL or C++ program is a valid SYCL program;
the exit cost is low since it is pure C++ without any extension or
#pragma
, by opposition to C++AMP or OpenMP for example. Retargeting the SYCL classes and functions to use other frameworks such as OpenMP 4 or C++AMP is feasible without rewriting a new compiler for example;easier debugging
- since all memory accesses to array parameters in kernels go through accessors, all the memory bound checks can be done in them if needed;
- since there is a pure host mode, the kernel code can be run also on
the host and debugged using the usual tools and use any system (such
<cstdio>
or<iostream>
...) or data libraries (for nice data visualization); - since the kernel code is C++ code even when run on an accelerator, instrumenting the code by using special array classes or overloading some operators allows deep intrusive debugging or code analysis without changing the algorithmic parts of the code;
SYCL is high-level standard modern C++ without any extension, that means that you can use your usual compiler and the host part can use at the same time some cool and common extensions such as OpenMP, OpenHMPP, OpenACC,... or libraries such as MPI or PGAS Coarray++, be linked with other parts written in other languages (Fortran...). Thus SYCL is already Exascale-ready!
even if SYCL hides the OpenCL world by default, it inherits from all the OpenCL world:
- same interoperability as the OpenCL underlying platform: Vulkan, OpenGL, DirectX...
- access to all the underlying basic OpenCL objects behind the SYCL abstraction for interoperability and hard-core optimization;
- construction of SYCL objects from basic OpenCL objects to add some SYCL parts to an existing OpenCL application;
- so it provides a continuum from higher-level programming à la
C++AMP or OpenMP 4 down to low-level OpenCL, according to the
optimization needs, from using simple OpenCL intrinsics or vector
operation from the
cl::sycl
namespace down to providing a real OpenCL kernel to be executed without requiring all the verbose usual OpenCL host API.
This OpenCL seamless integration plus the gradual optimization features are perhaps the most compelling arguments for SYCL because it allows high-level programming simplicity without giving-up hard-core performance when needed;
since the SYCL task graph execution model is asynchronous, this can be used by side effect to overcome some underlying OpenCL implementation limitations. For example, some OpenCL stacks may have only in-order execution queues or even synchronous (blocking) ND-range enqueue, or some weird constrained mapping between OpenCL programmer level queue(s) and the hardware queues.
In this case, a SYCL implementation can deal with this, relying for example on multiple host CPU threads, multiple thread-local-storage (TLS) queues, its own scheduler, etc. atop the limited OpenCL stack to provide computation and communication overlap in a natural pain-free fashion. This relieves the programmer to reorganize her application to work around these limitation, which can be quite a cumbersome work.
For introduction material on the interest of DSEL in this area, look for example at these articles:
- Domain-specific Languages and Code Synthesis Using Haskell, Andy Gill. May 6, 2014 in ACM Queue and Communications of the ACM.
- Design Exploration through Code-generating DSLs, Bo Joel Svensson, Mary Sheeran and Ryan Newton. May 15, 2014 in ACM Queue and Communications of the ACM.
Some other known implementations:
- Codeplay has a ComputeCpp product implementing SYCL based on OpenCL SPIR with Clang/LLVM https://www.codeplay.com/products/computesuite/computecpp
- SYCL-GTX https://github.com/ProGTX/sycl-gtx
By reverse chronological order:
- Some talks at SuperComputing SC17 (November 2017) around SYCL with slides and videos: https://www.khronos.org/news/events/supercomputing-2017
- SYCL C++ and OpenCL interoperability experimentation with triSYCL. Anastasios Doumoulakis, Ronan Keryell & Kenneth O'Brien. Distributed & Heterogeneous Programming for C/C++ workshop (DHPCC++ 2017), collocated with IWOCL'17, Toronto, Canada. May 16, 2017.
- Post-modern C++17 abstractions for heterogeneous computing with Khronos OpenCL SYCL. Ronan Keryell. Dublin C++ User Group Meetup, Dublin, Ireland. April 10, 2017.
- Post-modern C++17 abstractions for heterogeneous computing with Khronos OpenCL SYCL. Ronan Keryell. Paris C++ User Group Meetup, Paris, France. January 19, 2017.
- Khronos Group SYCL standard --- triSYCL Open Source Implementation, Ronan Keryell (Xilinx & Khronos OpenCL SYCL Working Group Member). November, 2016, Presentation at SuperComputing 2016, Salt Lake City, USA.
- P0367R0: Accessors — wrapper classes to qualify accesses, Ronan Keryell (Xilinx) & Joël Falcou (NumScale). November, 2016, Presentation at ISO C++ committee, Issaquah, WA, USA.
- Experiments with triSYCL: poor (wo)man shared virtual memory. Ronan Keryell. SYCL 2016 - 1st SYCL Programming Workshop, collocated with PPoPP'16, Barcelona, Spain. March 13, 2016.
- Khronos's OpenCL SYCL to support Heterogeneous Devices for C++. Proposal for the C++ committee SG14 in Jacksonville, Florida, USA February 12, 2016.
- SYCL presentation at SG14 C++ committee teleconference, Andrew Richards (CEO Codeplay & Chair SYCL Working group). February 3, 2016.
- Post-modern C++ abstractions for FPGA & heterogeneous computing with OpenCL SYCL & SPIR-V, Ronan Keryell. ANL REFORM 2016: Workshop on FPGAs for scientific simulation and data analytics, Argone National Labs. January 22, 2016.
- From modern FPGA to high-level post-modern C++ abstractions for heterogeneous computing with OpenCL SYCL & SPIR-V, Ronan Keryell. HiPEAC WRC 2016: Workshop on Reconfigurable Computing. Prague, January 19, 2016.
- HiPEAC 2016 tutorial on SYCL: Khronos SYCL for OpenCL. HiPEAC 2016, Prague, January 18, 2016.
- A Tutorial on Khronos SYCL for OpenCL at IWOCL 2015. Stanford, May 12, 2015.
- Modern C++, OpenCL SYCL & OpenCL CL2.hpp, Ronan Keryell (AMD & Khronos OpenCL SYCL Working Group Member). November 18, 2014, Presentation at SuperComputing 2014, OpenCL BoF, New Orleans, USA.
- Implementing the OpenCL SYCL Shared Source C++ Programming Model using Clang/LLVM, Gordon Brown. November 17, 2014, Workshop on the LLVM Compiler Infrastructure in HPC, SuperComputing 2014
- SYCL Specification --- SYCL integrates OpenCL devices with modern C++, Khronos OpenCL Working Group — SYCL subgroup. Editors: Lee Howes and Maria Rovatsou. Version 1.2, Revision 2014-09-16.
- OpenCL 2.0, OpenCL SYCL & OpenMP 4, open standards for heterogeneous parallel programming, Ronan Keryell (AMD & Khronos OpenCL Working Group Member). July 3, 2014, Presentation at the Meetup of the High Performance Computing & Supercomputing Group of Paris.
- OpenCL 2.0, OpenCL SYCL & OpenMP 4, open standards for heterogeneous parallel programming, Ronan Keryell (AMD & Khronos OpenCL Working Group Member). July 2, 2014, Presentation at Forum Ter@tec: Calcul scientifique & Open Source : pratiques industrielles des logiciels libres.
- The Future of Accelerator Programming in C++, Sebastian Schaetz, May 18, 2014. Presentation at C++Now 2014.
- SYCL : Abstraction Layer for Leveraging C++ and OpenCL, Maria Rovatsou (Codeplay & Khronos OpenCL Working Group Member). May 12-13, 2014, IWOCL 2014.
- Building the OpenCL ecosystem - SYCL for OpenCL, Lee Howes (Senior Staff Engineer at Qualcomm & Khronos OpenCL Working Group Member). April 21, 2014, HPC & GPU Supercomputing Group of Silicon Valley.
- SYCL 1.2: Unofficial High-Level Overview, AJ Guillon (Khronos OpenCL Working Group Member). March 19, 2014. Video.
- SYCL for OpenCL, Andrew Richards (CEO Codeplay & Chair SYCL Working group). March 19, 2014, GDC 2014.
- Fusing GPU kernels within a novel single-source C++ API, Ralph Potter, Paul Keir, Jan Lucas, Maurico Alvarez-Mesa, Ben Juurlink and Andrew Richards. January 20, 2014, LPGPU Workshop on Power-Efficient GPU and Many-core Computing (PEGPUM 2014).
- Fusing GPU kernels within a novel single-source C++ API, Ralph Potter, Paul Keir, Jan Lucas, Mauricio Alvarez-Mesa, Ben Juurlink, Andrew Richards. November 18, 2013, Intel Compiler, Architecture and Tools Conference.
There are also many interesting articles in the publication list from Codeplay.
CLHPP: The OpenCL C++ wrapper from Khronos around host API
C++ ISO/IEC JTC1/SC22/WG21 WG21 committee
the SG14 subgroup on low Latency, real time requirements, performance, efficiency, heterogeneous computing, where SYCL is one of the candidates;
C++ Parallelism TS https://github.com/cplusplus/parallelism-ts
SYCL Parallel STL is an implementation of the Parallel STL of C++17 based on SYCL;
C++ Concurrency TS https://github.com/cplusplus/concurrency_ts
OpenMP is a
#pragma
-based standard to express different kind of parallelism with accelerators supported since version 4.0;OpenACC is a
#pragma
-based extension targetting accelerators;Coriander, a CUDA compiler and runtime for OpenCL https://github.com/hughperkins/coriander
GOOPAX is a product providing a C++11 framework for single-source OpenCL;
PACXX is a higher-level C++ compiler and framework for accelerators;
Intel SPMD Program Compiler https://ispc.github.io/
Intel Lab's iHRC https://github.com/IntelLabs/iHRC