[MLIR] [AMDGPU] Use correct flags when building SerializeToHsaco
authorKrzysztof Drewniak <Krzysztof.Drewniak@amd.com>
Mon, 28 Feb 2022 15:56:17 +0000 (15:56 +0000)
committerKrzysztof Drewniak <Krzysztof.Drewniak@amd.com>
Thu, 3 Mar 2022 21:44:26 +0000 (21:44 +0000)
The SerializeToHsaco pass does not depend on ROCm being available on
the build system - it only requires ROCm to be present at runtime.
However, the CMake file that built it tested for
MLIR_ENABLE_ROCM_RUNNER , which implies that ROCm is currently
available and is used to control building ROCm integration tests.

Referencing MLIR_ENABLE_ROCM_RUNNER instead of
MLIR_ENABLE_ROCM_CONVERSIONS in the SerializeToHsaco build therefore
causes problems for clients who wish to build projects that depend on
this pass on a system without an AMD GPU present.

Reviewed By: whchung

Differential Revision: https://reviews.llvm.org/D120663

mlir/lib/Dialect/GPU/CMakeLists.txt

index 788ab6a..56587d4 100644 (file)
@@ -119,7 +119,7 @@ if(MLIR_ENABLE_CUDA_RUNNER)
 
 endif()
 
-if(MLIR_ENABLE_ROCM_RUNNER)
+if(MLIR_ENABLE_ROCM_CONVERSIONS)
   if (NOT ("AMDGPU" IN_LIST LLVM_TARGETS_TO_BUILD))
     message(SEND_ERROR
       "Building mlir with ROCm support requires the AMDGPU backend")