Skip to content

Commit

Permalink
Check LLVM offload only contains one architecture
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Hahn <hahnse@ornl.gov>
  • Loading branch information
quantumsteve committed Sep 30, 2021
1 parent 058e446 commit afd2294
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMake/ClangCompilers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ if(QMC_OMP)
set(OPENMP_OFFLOAD_COMPILE_OPTIONS "-fopenmp-targets=${OFFLOAD_TARGET}")

if(NOT DEFINED OFFLOAD_ARCH AND OFFLOAD_TARGET MATCHES "nvptx64" AND DEFINED CMAKE_CUDA_ARCHITECTURES)
list(LENGTH CMAKE_CUDA_ARCHITECTURES NUMBER_CUDA_ARCHITECTURES)
if(NOT NUMBER_CUDA_ARCHITECTURES EQUAL "1")
message(FATAL_ERROR "LLVM does not support offload to multiple architectures!")
endif()
set(OFFLOAD_ARCH sm_${CMAKE_CUDA_ARCHITECTURES})
endif()

Expand Down

0 comments on commit afd2294

Please sign in to comment.