← 全部工具

adaptivecpp

热度 85 更新于 开发与构建

SYCL and C++ standard parallelism for CPUs and GPUs

homebrewauto-collected

安装

Homebrew
brew install adaptivecpp

通过 Homebrew 安装。

AdaptiveCpp (formerly known as hipSYCL / Open SYCL)

(Note: Documentation and code may in some places still use the older name hipSYCL / Open SYCL)

AdaptiveCpp is the independent, community-driven modern platform for C++-based heterogeneous programming models targeting CPUs and GPUs from all major vendors. AdaptiveCpp lets applications adapt themselves to all the hardware found in the system. This includes use cases where a single binary needs to be able to target all supported hardware, or utilize hardware from different vendors simultaneously.

It currently supports the following programming models:

  • SYCL: At its core is a highly competitive and flexible SYCL implementation that supports many compilation flows.
  • C++ standard parallelism: Additionally, AdaptiveCpp features experimental support for offloading C++ algorithms from the parallel STL. See here for details on which algorithms can be offloaded. AdaptiveCpp is currently the only solution capable of demonstrating C++ standard parallelism performance across NVIDIA, AMD and Intel GPUs, and in most cases outperforms vendor compilers.
  • PCUDA (portable CUDA), a dialect of the CUDA/HIP programming model is currently in an experimental support state. See here for details. AdaptiveCpp PCUDA allows for CUDA or HIP code to be compiled to a single binary that can offload kernels to CPUs, NVIDIA GPUs, AMD GPUs and Intel GPUs.

AdaptiveCpp supports CPUs (including x86, arm and other LLVM-supported architectures) as well as GPUs from Intel, NVIDIA, AMD, and Apple. This includes the ability to generate a single binary that can offload to all supported devices.

AdaptiveCpp's compilation flows include

  • A powerful, generic LLVM JIT compiler. This is AdaptiveCpp's default, most portable and usually most performant compilation flow. It is also the world's only SYCL compiler that only needs to parse the source code a single time across both host and device compilation.
  • Compilation flows focused on providing interoperability at source code level with vendor programming models (including e.g. the ability to mix-and-match CUDA and SYCL in the same source file)
  • Library-only compilation flows focused on deployment simplicity. These compilation flows allow utilizing third-party compilers, with AdaptiveCpp merely acting as a library.

A full list of its compilation capabilities can be found here.

Because a program compiled with AdaptiveCpp appears just like any other program written in vendor-supported programming models (like CUDA or HIP) to vendor-provided software, vendor tools such as profilers or debuggers also work with AdaptiveCpp.

An illustration on how the project fits into the SYCL ecosystem can be found (here).

Performance & benchmarking

See the AdaptiveCpp performance guide.

Installing and using AdaptiveCpp

  • Building & Installing

In order to compile software with AdaptiveCpp, use acpp. acpp can be used like a regular compiler, i.e. you can use acpp -o test test.cpp to compile your application called test.cpp with AdaptiveCpp.

acpp accepts both command line arguments and environment variables to configure its behavior (e.g., to select the target to compile for). See acpp --help for a comprehensive list of options.

For details and instructions on using AdaptiveCpp in CMake projects, please see the documentation on using AdaptiveCpp.