designed for various computing architectures

Platform portability with Alpaka

The Alpaka library is a performance-portability programming model designed for various computing architectures, making it easier to develop and optimize C++ applications that run on different hardware. It abstracts the hardware specifics, so developers can write code that is portable across various platforms such as CPUs, GPUs, and other accelerators. Alpaka provides a uniform and flexible interface that helps in managing the complexities associated with different architectures, focusing on parallel computing paradigms. This allows developers to maximize performance without having to tailor their code for specific hardware platforms, enhancing productivity and scalability across diverse computational environments.

The alpaka library is a header-only C++14 abstraction library for accelerator development.

Its aim is to provide performance portability across accelerators through the abstraction (not hiding!) of the underlying levels of parallelism.

It is platform independent and supports the concurrent and cooperative use of multiple devices such as the hosts CPU as well as attached accelerators as for instance CUDA GPUs and Xeon Phis (currently native execution only). A multitude of accelerator back-end variants using CUDA, OpenMP (2.0/4.0), Boost.Fiber, std::thread and also serial execution is provided and can be selected depending on the device. Only one implementation of the user kernel is required by representing them as function objects with a special interface. There is no need to write special CUDA, OpenMP or custom threading code. Accelerator back-ends can be mixed within a device queue. The decision which accelerator back-end executes which kernel can be made at runtime.

The abstraction used is very similar to the CUDA grid-blocks-threads division strategy. Algorithms that should be parallelized have to be divided into a multi-dimensional grid consisting of small uniform work items. These functions are called kernels and are executed in parallel threads. The threads in the grid are organized in blocks. All threads in a block are executed in parallel and can interact via fast shared memory. Blocks are executed independently and can not interact in any way. The block execution order is unspecified and depends on the accelerator in use. By using this abstraction the execution can be optimally adapted to the available hardware.

Dr Andreas Knüpfer

Jan Stephan

Franz Pöschel

Software