diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel --- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel @@ -4088,22 +4088,26 @@ ] + if_cuda_available([ "@cuda//:cuda_headers", "@cuda//:libcuda", - ]) + ]), ) write_file( name = "SerializeToCubin_stub_cc", out = "SerializeToCubin_stub.cc", content = [ -""" + """ #include "mlir/Dialect/GPU/Transforms/Passes.h" // Provide a weak registration stub in case the real SerializeToCubin is not // linked in. +#if defined(_MSC_VER) +void mlir::registerGpuSerializeToCubinPass() {} +#else __attribute__((weak)) void mlir::registerGpuSerializeToCubinPass() {} -""" - ] +#endif +""", + ], ) cc_library( @@ -7113,8 +7117,8 @@ ":OpenMPDialect", ":Pass", ":QuantOps", - ":SerializeToCubin", ":SCFToGPU", + ":SerializeToCubin", ":Support", ":Transforms", "//llvm:AllTargetsCodeGens",