Adding Nvidia NVHPC Compiler Collection Support

Describe the feature you would like to be implemented.

Nvidia freely distributes their C/C++/Fortran compilers (also known as nvhpc) which used to be known as PGI Compiler Collection. NVHPC comes with OpenMP/OpenACC (capable of doing GPU offloading), CUDA-Aware MPI as well as a GPU implementation of c++ standard parallel algorithms.

A few days ago I tested Eigen@3.4.0 with NVHPC but unfortunately many tests failed. I browsed the source code and CMake files and found that there were lot's of compiler specific macros. Some of them where related to quite old versions of PGI compiler. In general I think it is doable to fix all bug and make it work.

Would such a feature be useful for other users? Why?

NVHPC compiler collection is very promising from a GPU programming perspective. For example, the collection has some OpenMP 5.1 features already implemented, but not available in llvm. Moreover, NVHPC contains the best implementation of OpenACC. As the name suggests, NVHPC is targeting at HPC and thus Scientific Computing fields which eigen also targets.

Unfortunately NVHPC is not an open-source project but Nvidia claims that the compiler collection is going to be always free to download (similar to CUDA).

Any hints on how to implement the requested feature?

I would start with analyzing compiler macros in the source code and looking for some changes required to be done in CMake.

The best thing would be to add NVHPC to eigen's CI

Additional resources

https://developer.nvidia.com/nvidia-hpc-sdk-downloads

Edited by Ravil