Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[GPU][MLIR] Fix compilation with MSVC (#39668)

Andrey Pavlenko7b77f0094781
diff --git a/src/plugins/intel_gpu/src/plugin/transformations/mlir/common/converters/reshape.hpp b/src/plugins/intel_gpu/src/plugin/transformations/mlir/common/converters/reshape.hpp
index 8b7b5df8328..af0159f1c79 100644
--- a/src/plugins/intel_gpu/src/plugin/transformations/mlir/common/converters/reshape.hpp
+++ b/src/plugins/intel_gpu/src/plugin/transformations/mlir/common/converters/reshape.hpp
@@ -53,8 +53,9 @@ struct ConvertReshape {
auto loc = createLocation(context.context, node);
auto& builder = context.builder();
const auto input = context.getInputs(node)[0];
- return expand ? tensor::ExpandShapeOp::create(builder, loc, dst_type, input, reassociation)
- : tensor::CollapseShapeOp::create(builder, loc, dst_type, input, reassociation);
+ if (expand)
+ return tensor::ExpandShapeOp::create(builder, loc, dst_type, input, reassociation);
+ return tensor::CollapseShapeOp::create(builder, loc, dst_type, input, reassociation);
}
};
diff --git a/src/plugins/intel_gpu/src/plugin/transformations/mlir/gc_gpu_runtime.cpp b/src/plugins/intel_gpu/src/plugin/transformations/mlir/gc_gpu_runtime.cpp
index 7141cdf60fd..b6bf4e77bd3 100644
--- a/src/plugins/intel_gpu/src/plugin/transformations/mlir/gc_gpu_runtime.cpp
+++ b/src/plugins/intel_gpu/src/plugin/transformations/mlir/gc_gpu_runtime.cpp
@@ -345,7 +345,7 @@ public:
const bool dump = is_debug();
if (dump) {
OPENVINO_MLIR_DEBUG_PRINT("-------------- Source MLIR --------------");
- module->dump();
+ module->print(llvm::errs());
OPENVINO_MLIR_DEBUG_PRINT("-----------------------------------------");
}
diff --git a/src/plugins/intel_gpu/tests/functional/mlir_op/mlir_test_env.hpp b/src/plugins/intel_gpu/tests/functional/mlir_op/mlir_test_env.hpp
index 47533df6554..4e0ec69ff09 100644
--- a/src/plugins/intel_gpu/tests/functional/mlir_op/mlir_test_env.hpp
+++ b/src/plugins/intel_gpu/tests/functional/mlir_op/mlir_test_env.hpp
@@ -25,13 +25,22 @@ struct MlirMatchAllEnv {
// variable is not already set, and only then restore (unset) it later.
if (std::getenv("OV_GPU_MLIR_PATTERNS") == nullptr) {
m_owned = true;
+#ifdef _WIN32
+ _putenv_s("OV_GPU_MLIR_PATTERNS", "*");
+#else
setenv("OV_GPU_MLIR_PATTERNS", "*", /*overwrite=*/1);
+#endif
}
}
~MlirMatchAllEnv() {
if (m_owned) {
+#ifdef _WIN32
+ // An empty value removes the variable on Windows.
+ _putenv_s("OV_GPU_MLIR_PATTERNS", "");
+#else
unsetenv("OV_GPU_MLIR_PATTERNS");
+#endif
}
}