[llvm] [mlir][bazel] Define MLIR_CUDA_CONVERSIONS_ENABLED in GPU targets. (PR #83004)

Ingo Müller via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 26 05:51:22 PST 2024


https://github.com/ingomueller-net created https://github.com/llvm/llvm-project/pull/83004

The `BUILD` files of two CUDA-related build targets were missing that definition such that the corresponding MLIR target libraries did not actually work.

>From a32f282cd9926d99e72b152ed323996803b9346f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ingo=20M=C3=BCller?= <ingomueller at google.com>
Date: Mon, 26 Feb 2024 13:46:18 +0000
Subject: [PATCH] [mlir][bazel] Define MLIR_CUDA_CONVERSIONS_ENABLED in GPU
 targets.

The `BUILD` files of two CUDA-related build targets were missing that
definition such that the corresponding MLIR target libraries did not
actually work.
---
 utils/bazel/llvm-project-overlay/mlir/BUILD.bazel | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
index 59ee03d9a3213f..4d1503e69a271b 100644
--- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
@@ -5504,6 +5504,7 @@ cc_library(
         ],
     ),
     hdrs = glob(["include/mlir/Dialect/GPU/Transforms/*.h"]),
+    defines = if_cuda_available(["MLIR_CUDA_CONVERSIONS_ENABLED"]),
     includes = ["include"],
     local_defines = if_cuda_available(["MLIR_GPU_TO_CUBIN_PASS_ENABLE"]),
     deps = [
@@ -6168,6 +6169,9 @@ cc_library(
     srcs = ["lib/Target/LLVM/NVVM/Target.cpp"],
     hdrs = glob(["include/mlir/Target/LLVM/NVVM/*.h"]),
     includes = ["include"],
+    local_defines = [
+        "MLIR_CUDA_CONVERSIONS_ENABLED",
+    ],
     deps = [
         ":GPUDialect",
         ":GPUToLLVMIRTranslation",



More information about the llvm-commits mailing list