OP-DSL / OP2-Common

OP2: open-source framework for the execution of unstructured grid applications on clusters of GPUs or multi-core CPUs
https://op-dsl.github.io
Other
98 stars 47 forks source link

Improve CUDA target arcitecture selection #223

Closed bozbez closed 2 years ago

bozbez commented 2 years ago

This replaces the NV_ARCH nested ifs in each of the nvhpc.mk compiler makefiles with a CUDA_GEN variable that is constructed based on the environment NV_ARCH and CUDA_GEN that allows for multiple target architectures to be specified. In addition, since CUDA_GEN is set in compilers.mk, the nested if duplication is eliminated.

With this, the old system of specifying NV_ARCH=Kepler make ... remains supported (with the addition of the Ampere target), and in addition you can now also do, for example, CUDA_GEN=50,60 NV_ARCH=Volta,Ampere make ... and have binaries emitted with PTX code for 50, 60, 70 and 80.

This also allows us to properly support inheriting from CudaPackage in the Spack package, as we can pass the full list of cuda_arch.

gihanmudalige commented 2 years ago

I am ok with this. @reguly anything concerning here ?