This is a header-only library for enabling single source code (C++) to target heterogeneous platforms (CPU, GPU). The project is still in early R&D phase.
- (CPU) OpenMP
- (GPU) CUDA
The project requires LLVM/Clang to build the sources. Recommendation:
spack install llvm@14.0.0 +all_targets +cuda cuda_arch=<XY>| Dependency | OpenMP backend | CUDA backend | Tests |
|---|---|---|---|
| vecmem library | x | x | x |
| OpenMP 5.0 (enabled by default with LLVM14) | x | ||
| CUDA 11.5.0 | x | ||
| GoogleTest | x |
vecpar uses nestoroprysk/FunctionComposition for supporting the algorithm chaining functionality.
Get the code
git clone --recurse-submodules https://github.com/wr-hamburg/vecpar.gitTo build the code
cmake -S <source_dir> -B <build_directory>cmake --build <build_directory> \
-DVECPAR_BUILD_OMP_BACKEND=On \
-DVECPAR_BUILD_CUDA_BACKEND=On To enable the automated tests, set also -DVECPAR_BUILD_TESTS=On.
By default, all build options are enabled.
To compile for aarch64, set CC/CXX environment variables to appropriate aarch64 compilers.
To install the library
cmake --install <build_directory>vecpar supports vecmem::vectors as input and/or output for all operations.
vecmem::jagged_vectors are supported for a restricted subset (marked with x):
| Abstraction | Jagged_vector as input(s) |
Jagged_vector as output |
|---|---|---|
| map | x | x |
| filter | ||
| reduce | ||
| map-filter | x | |
| map-reduce | x |