From 6dc2ab95663b2d12a8088802dc8d88e333d62707 Mon Sep 17 00:00:00 2001 From: Krzysztof Drewniak Date: Thu, 13 Jul 2023 18:56:35 +0000 Subject: [PATCH] [mlir] Don't make the ROCm conversions depend on the execution engine During a conversion to MLIR_ENABLE_EXECUTION_ENGINE from checking for the native target, the ROCm conversion passes (--serialize-to-hsaco) were mistakenly flagged for being disabled if the execution ending is not being built. These passes use LLVM to build binaries for AMD GPUs, and so require that backend to be enabled. However, they do not produce native code, nor do they interact with the JIT or any of the execution engine support libraries. When building MLIR into a compiler library that's intended to produce GPU binaries, we want to build only the AMDGPU backend and have the binary serialization passes available. This change makes that possible. It looks like the CUDA path might currently require a native target, it's hard to tell, so this commit leaves that if statement untouched. Reviewed By: fmorac Differential Revision: https://reviews.llvm.org/D155227 --- mlir/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt index f31403aebb22..c91e9cd93dc8 100644 --- a/mlir/CMakeLists.txt +++ b/mlir/CMakeLists.txt @@ -107,7 +107,7 @@ add_definitions(-DMLIR_CUDA_CONVERSIONS_ENABLED=${MLIR_ENABLE_CUDA_CONVERSIONS}) # Build the ROCm conversions and run according tests if the AMDGPU backend # is available. -if ("AMDGPU" IN_LIST LLVM_TARGETS_TO_BUILD AND MLIR_ENABLE_EXECUTION_ENGINE) +if ("AMDGPU" IN_LIST LLVM_TARGETS_TO_BUILD) set(MLIR_ENABLE_ROCM_CONVERSIONS 1) else() set(MLIR_ENABLE_ROCM_CONVERSIONS 0)