Skip to content

Commit 6e27dd4

Browse files
[mlir][gpu] Replace MLIR_GPU_TO_HSACO_PASS_ENABLE by more generic one. (#84001)
This is another follow-up of #83004. The PR replaces the macro `MLIR_GPU_TO_HSACO_PASS_ENABLE` with the more generic macro `MLIR_ENABLE_ROCM_CONVERSIONS`. Until now, the former has been defined if and only if the latter evaluated to true in CMake. However, the former was not defined when the latter evaluated to false, in which case a warning was raised if compiled with `-Wundef`. Using a single macro relies on the `#cmakedefine01` mechanism that ensures the macro is always set to either 0 or 1.
1 parent aced81c commit 6e27dd4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mlir/lib/Dialect/GPU/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ if(MLIR_ENABLE_ROCM_CONVERSIONS)
110110
target_compile_definitions(obj.MLIRGPUTransforms
111111
PRIVATE
112112
__DEFAULT_ROCM_PATH__="${DEFAULT_ROCM_PATH}"
113-
MLIR_GPU_TO_HSACO_PASS_ENABLE=1
114113
)
115114

116115
target_link_libraries(MLIRGPUTransforms

mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14+
#include "mlir/Config/mlir-config.h"
1415
#include "mlir/Dialect/GPU/Transforms/Passes.h"
1516
#include "mlir/IR/Location.h"
1617
#include "mlir/IR/MLIRContext.h"
1718

18-
#if MLIR_GPU_TO_HSACO_PASS_ENABLE
19+
#if MLIR_ENABLE_ROCM_CONVERSIONS
1920
#include "mlir/ExecutionEngine/OptUtils.h"
2021
#include "mlir/Pass/Pass.h"
2122
#include "mlir/Support/FileUtilities.h"
@@ -454,6 +455,6 @@ std::unique_ptr<Pass> mlir::createGpuSerializeToHsacoPass(StringRef triple,
454455
optLevel);
455456
}
456457

457-
#else // MLIR_GPU_TO_HSACO_PASS_ENABLE
458+
#else // MLIR_ENABLE_ROCM_CONVERSIONS
458459
void mlir::registerGpuSerializeToHsacoPass() {}
459-
#endif // MLIR_GPU_TO_HSACO_PASS_ENABLE
460+
#endif // MLIR_ENABLE_ROCM_CONVERSIONS

0 commit comments

Comments
 (0)