UoB-HPC / BabelStream

STREAM, for lots of devices written in many programming models
Other
313 stars 109 forks source link

correctly build offload for default OMP_FLAGS_OFFLOAD_* settings #181

Open milthorpe opened 6 months ago

milthorpe commented 6 months ago

For OpenMP target offload, there are a few default OMP_FLAGS_OFFLOAD_<COMPILER?>_<VENDOR? settings, which may work for some systems e.g. OLCF Frontier. However, setting this flag tuple doesn't currently set OMP_TARGET_GPU, so the application doesn't actually compile for offload. This fix defines OMP_TARGET_GPU whenever OMP_FLAGS_OFFLOAD_<COMPILER?>_<VENDOR? is defined. With this fix, BabelStream correctly builds for OLCF Frontier with:

module load amd/5.4.0
cmake -Bbuild -H. -DCMAKE_CXX_COMPILER=amdclang++ -DMODEL=omp -DOFFLOAD=AMD:gfx90a