diff options
author | Philip Pfaffe <philip.pfaffe@gmail.com> | 2018-06-07 21:10:49 +0000 |
---|---|---|
committer | Philip Pfaffe <philip.pfaffe@gmail.com> | 2018-06-07 21:10:49 +0000 |
commit | 777c595e75bf53f0be82672ca02e4e0f2dad95e1 (patch) | |
tree | 8687fcb86e1a8371cdf4442d2847ea704ebe4899 /polly | |
parent | 00f85f93442a8663fc75a94efa36af0d487ee5f2 (diff) |
Back out of GPU Codegen if NVPTX is not available
Summary:
When enabling GPU codegen in polly, CMake will fail if NVPTX is not a target
supported by the LLVM polly is being built against. In that case, GPU codegen
should be switched off.
Reviewers: Meinersbur, grosser, bollu
Reviewed By: Meinersbur
Subscribers: mgorny, bollu, pollydev, llvm-commits
Differential Revision: https://reviews.llvm.org/D47888
Diffstat (limited to 'polly')
-rw-r--r-- | polly/CMakeLists.txt | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/polly/CMakeLists.txt b/polly/CMakeLists.txt index af0263b7810..d2556b5b92f 100644 --- a/polly/CMakeLists.txt +++ b/polly/CMakeLists.txt @@ -97,14 +97,17 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${POLLY_SOURCE_DIR}/cmake") SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) option(POLLY_ENABLE_GPGPU_CODEGEN "Enable GPGPU code generation feature" OFF) +set(GPU_CODEGEN FALSE) if (POLLY_ENABLE_GPGPU_CODEGEN) # Do not require CUDA/OpenCL, as GPU code generation test cases can be run # without a CUDA/OpenCL library. - FIND_PACKAGE(CUDA) - FIND_PACKAGE(OpenCL) - set(GPU_CODEGEN TRUE) -else(POLLY_ENABLE_GPGPU_CODEGEN) - set(GPU_CODEGEN FALSE) + if ("NVPTX" IN_LIST LLVM_TARGETS_TO_BUILD) + FIND_PACKAGE(CUDA) + FIND_PACKAGE(OpenCL) + set(GPU_CODEGEN TRUE) + else() + message(WARNING "The LLVM NVPTX target is required for GPU code generation") + endif() endif(POLLY_ENABLE_GPGPU_CODEGEN) |