User:Gianaccordi/sandbox1

SYCL Safety Critical
In march the Khronos Group announced the creation of the SYCL SC Working Group, with the objective of creating a a high-level heterogeneous computing framework for safety-critical systems. These systems span various fields, including avionics, automotive, industrial, and medical sectors.

The SYCL Safety Critical framework will comply with several industry standards to ensure its reliability and safety. These standards include MISRA C++ 202X, which provides guidelines for the use of C++ in critical systems, RTCA DO-178C / EASA ED-12C , which are standards for software considerations in airborne systems and equipment certification, ISO 26262/21448 , which pertains to the functional safety of road vehicles, IEC 61508, which covers the functional safety of electrical/electronic/programmable electronic safety-related systems,  and IEC 62304,which relates to the lifecycle requirements for medical device software.

Software
Here is a list of software applications examples which are using SYCL:


 * Bioinformatics
 * GROMACS: A molecular dynamics software widely used in bioinformatics and computational chemistry. Starting from its accelerated version in 2021, GROMACS utilizes SYCL 2020 for efficient computation on various hardware accelerators.
 * LiGen: A molecular docking software that utilizes SYCL for accelerating computational tasks related to molecular structure analysis and docking simulations.
 * Autodock: Another molecular docking software that leverages SYCL to accelerate the process of predicting how small molecules bind to a receptor of a known 3D structure.
 * Automotive Industry
 * ISO 26262: The international standard for functional safety of automotive electrical and electronic systems. SYCL is used in automotive applications to accelerate safety-critical computations and simulations, ensuring compliance with stringent safety standards.
 * Cosmology
 * CRK-HACC: A cosmological n-body simulation code that has been ported to SYCL. It uses SYCL to accelerate calculations related to large-scale structure formation and dynamics in the universe.

Comparison with other Tools
The open standards SYCL and OpenCL are similar to the programming models of the proprietary stack CUDA from Nvidia and HIP from the open-source stack ROCm, supported by AMD.

In the Khronos Group realm, OpenCL and Vulkan are the low-level non-single source APIs, providing fine-grained control over hardware resources and operations. OpenCL is widely used for parallel programming across various hardware types, while Vulkan primarily focuses on high-performance graphics and computing tasks.

SYCL, on the other hand, is the high-level single-source C++ embedded domain-specific language (eDSL). It enables developers to write code for heterogeneous computing systems, including CPUs, GPUs, and other accelerators, using a single-source approach. This means that both host and device code can be written in the same C++ source file.

CUDA
By comparison, the single-source C++ embedded domain-specific language version of CUDA, which is named "CUDA Runtime API," is somewhat similar to SYCL. In fact, Intel released a tool called SYCLOMATIC that automatically translated code from CUDA to SYCL. However, there is a less known non-single-source version of CUDA, which is called "CUDA Driver API," similar to OpenCL, and used, for example, by the CUDA Runtime API implementation itself.

SYCL extends the C++ AMP features, relieving the programmer from explicitly transferring data between the host and devices by using buffers and accessors. This is in contrast to CUDA (prior to the introduction of Unified Memory in CUDA 6), where explicit data transfers were required. Starting with SYCL 2020, it is also possible to use USM instead of buffers and accessors, providing a lower-level programming model similar to Unified Memory in CUDA.

SYCL is higher-level than C++ AMP and CUDA since you do not need to build an explicit dependency graph between all the kernels, and it provides you with automatic asynchronous scheduling of the kernels with communication and computation overlap. This is all done by using the concept of accessors without requiring any compiler support.

Unlike C++ AMP and CUDA, SYCL is a pure C++ eDSL without any C++ extension. This allows for a basic CPU implementation that relies on pure runtime without any specific compiler.

Both DPC++ and AdaptiveCpp compilers provide a backend to NVIDIA GPUs, similar to how CUDA does. This allows SYCL code to be compiled and run on NVIDIA hardware, allowing developers to leverage SYCL's high-level abstractions on CUDA-capable GPUs.

ROCm HIP
ROCm HIP targets Nvidia GPU, AMD GPU, and x86 CPU. HIP is a lower-level API that closely resembles CUDA's APIs. For example, AMD released a tool called HIPIFY that can automatically translate CUDA code to HIP. Therefore, many of the points mentioned in the comparison between CUDA and SYCL also apply to the comparison between HIP and SYCL.

ROCm HIP has some similarities to SYCL in the sense that it can target various vendors (AMD and Nvidia) and accelerator types (GPU and CPU). However, SYCL can target a broader range of accelerators and vendors. SYCL supports multiple types of accelerators simultaneously within a single application through the concept of backends. Additionally, SYCL is written in pure C++, whereas HIP, like CUDA, uses some language extensions. These extensions prevent HIP from being compiled with a standard C++ compiler.

Both DPC++ and AdaptiveCpp compilers provide backends for NVIDIA and AMD GPUs, similar to how HIP does. This enables SYCL code to be compiled and executed on hardware from these vendors, offering developers the flexibility to leverage SYCL's high-level abstractions across a diverse range of devices and platforms.

Kokkos
SYCL has many similarities to the Kokkos programming model, including the use of opaque multi-dimensional array objects (SYCL buffers and Kokkos arrays), multi-dimensional ranges for parallel execution, and reductions (added in SYCL 2020). Numerous features in SYCL 2020 were added in response to feedback from the Kokkos community.

SYCL focuses more on heterogeneous systems; thanks to its integration with OpenCL, it can be adopted on a wide range of devices. Kokkos, on the other hand, targets most of the HPC platforms, thus it is more HPC-oriented for performance.

As of 2024, the Kokkos team is developing a SYCL backend, which enables Kokkos to target Intel hardware in addition to the platforms it already supports. This development broadens the applicability of Kokkos and allows for greater flexibility in leveraging different hardware architectures within HPC applications.

Raja
Raja is a library of C++ software abstractions to enable the architecture and programming portability of HPC applications.

Like SYCL, it provides portable code across heterogeneous platforms. However, unlike SYCL, Raja introduces an abstraction layer over other programming models like CUDA, HIP, OpenMP, and others. This allows developers to write their code once and run it on various backends without modifying the core logic. Raja is maintained and developed at Lawrence Livermore National Laboratory (LLNL), whereas SYCL is an open standard maintained by the community.

Similar to Kokkos, Raja is more tailored for HPC use cases, focusing on performance and scalability in high-performance computing environments. In contrast, SYCL supports a broader range of devices, making it more versatile for different types of applications beyond just HPC.

As of 2024, the Raja team is developing a SYCL backend, which will enable Raja to also target Intel hardware. This development will enhance Raja's portability and flexibility, allowing it to leverage SYCL's capabilities and expand its applicability across a wider array of hardware platforms.

OpenMP
OpenMP targets computational offloading to external accelerators, primarily focusing on multi-core architectures and GPUs. SYCL, on the other hand, is oriented towards a broader range of devices due to its integration with OpenCL, which enables support for various types of hardware accelerators.

OpenMP uses a pragma-based approach, where the programmer annotates the code with directives, and the compiler handles the complexity of parallel execution and memory management. This high-level abstraction makes it easier for developers to parallelize their applications without dealing with the intricate details of memory transfers and synchronization.

Both OpenMP and SYCL support C++ and are standardized. OpenMP is standardized by the OpenMP Architecture Review Board (ARB), while SYCL is standardized by the Khronos Group.

OpenMP has wide support from various compilers, like GCC and Clang.

std::par
std::par is part of the C++17 standard and is designed to facilitate the parallel execution of standard algorithms on C++ standard containers. It provides a standard way to take advantage of external accelerators by allowing developers to specify an execution policy for parallel operations, such as,  , and. This enables efficient use of multi-core processors and other parallel hardware without requiring significant changes to the code.

SYCL can be used as a backend for, enabling the execution of standard algorithms on a wide range of external accelerators, including GPUs from Intel, AMD, and NVIDIA, as well as other types of accelerators. By leveraging SYCL's capabilities, developers can write standard C++ code that seamlessly executes on heterogeneous computing environments. This integration allows for greater flexibility and performance optimization across different hardware platforms.

The use of SYCL as a backend for  is compiler-dependent, meaning it requires a compiler that supports both SYCL and the parallel execution policies introduced in C++17. Examples of such compilers include DPC++ and other SYCL-compliant compilers. With these compilers, developers can take advantage of SYCL's abstractions for memory management and parallel execution while still using the familiar C++ standard algorithms and execution policies.