SELF
SELF copied to clipboard
Feature/openmp
This PR brings in GPU support via OpenMP. This removes the required dependency on HIP/HIPFort. HIPFort has proven challenging to set up with a variety of Fortran compilers which increases the risk of users entering "dependency hell".
OpenMP offloading allows users to simply build CPU only versions quite easily. If GPU offloading (or multi-core CPU offloading!!) is desired, user's will need to use a compiler that supports OpenMP 4.5 for GPU offloading, these include
- ROCm
amdflang
- LLVM
flang
- Nvidia-HPC
nvfortran
- Intel OneAPI (
ifx
) - Cray
xlf
A complete list of compilers can be found here https://www.openmp.org/resources/openmp-compilers-tools/#compilers
This implementation also cuts out a significant amount of code in comparison to the HIPFort version (with or without managed memory). This makes it more tractable, IMO, to focus on adding in additional pre-canned models alongside CLI and options configuration within this repository.
Another side benefit, users who want to build there own models can simply concretize flux, riemann solver, and source terms as type bound procedures of extensions of the various model base types (written strictly in fortran), without having to worry about host/device memory management. OpenMP is fairly straight forward to offload those new models to GPUs if desired.
To hook in BLAS on GPUs, we can use the omp use device pointer
directive to integrate with other packages like hipblas or magma. This would likely come in a future PR that focuses on performance.
Main outcomes
- Reduce dependencies
- Simplify install process for users
- Simplify GPU memory and kernel management
- Reduce LOC