Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ option(ONNX_MLIR_BUILD_TESTS "Build ONNX-MLIR test executables. If OFF, just gen
option(ONNX_MLIR_CCACHE_BUILD "Set to ON for a ccache enabled build." OFF)
option(ONNX_MLIR_ENABLE_STABLEHLO "Enable StableHLO support." ON)
option(ONNX_MLIR_ENABLE_WERROR "Enable warnings as errors." OFF)
option(ONNX_MLIR_ENABLE_OMP "Enable OpenMP support." ON)
option(ONNX_MLIR_SUPPRESS_THIRD_PARTY_WARNINGS "Suppress warning in third_party code." ON)
option(ONNX_MLIR_ENABLE_JAVA "Set to ON for building the Java runtime, tools, and tests" ON)
option(ONNX_MLIR_ENABLE_PYRUNTIME_LIGHT "Set to ON for building Python driver of running the compiled model without llvm-project." OFF)
Expand Down
1 change: 1 addition & 0 deletions docs/BuildOnWindows.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ call cmake %root_dir%\onnx-mlir -G "Ninja" ^
-DLLVM_EXTERNAL_LIT=%lit_path% ^
-DLLVM_LIT_ARGS=-v ^
-DMLIR_DIR=%root_dir%\llvm-project\build\lib\cmake\mlir ^
-DONNX_MLIR_ENABLE_OMP=OFF ^
-DONNX_MLIR_ENABLE_STABLEHLO=OFF ^
-DONNX_MLIR_ENABLE_WERROR=ON

Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ add_dependencies(OMCompilerUtils cruntime)
if (ONNX_MLIR_ENABLE_JNI)
add_dependencies(OMCompilerUtils jniruntime)
endif()
if (TARGET omp)
if ((TARGET omp) AND (ONNX_MLIR_ENABLE_OMP))
add_dependencies(OMCompilerUtils ompruntime)
endif()

Expand Down
4 changes: 4 additions & 0 deletions src/Conversion/ONNXToKrnl/Math/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@

using namespace mlir;

#if !defined(M_PI)
#define M_PI 3.14159265358979323846
#endif

namespace onnx_mlir {

//===----------------------------------------------------------------------===//
Expand Down
10 changes: 10 additions & 0 deletions src/Dialect/ONNX/Transforms/ConstProp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1099,9 +1099,19 @@ Value ConstPropNonZero(
//===----------------------------------------------------------------------===//
// Pattern definition.
//===----------------------------------------------------------------------===//
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning( \
disable : 4927) // Disable warning: illegal conversion; more than one
// user-defined conversion has been implicitly applied
#endif

#include "src/Dialect/ONNX/Transforms/ONNXConstProp.inc"

#if defined(_MSC_VER)
#pragma warning(pop)
#endif

//===----------------------------------------------------------------------===//
// Code to perform constant propagation for split.
// Not done with tablegen which doesn't support variadic results.
Expand Down
2 changes: 1 addition & 1 deletion src/Runtime/omp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: Apache-2.0

# Only if LLVM is built with openmp enabled
if(TARGET omp)
if((TARGET omp) AND (ONNX_MLIR_ENABLE_OMP))
set(OMP_TOPDIR ${CMAKE_CURRENT_BINARY_DIR})
set_directory_properties(PROPERTIES EP_BASE ${OMP_TOPDIR})

Expand Down
2 changes: 1 addition & 1 deletion src/onnx-mlir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ int main(int argc, char *argv[]) {
// Add the short inputFilename to the first compile phase printout so that we
// may better determine which compilation we are dealing with.
std::filesystem::path p(inputFilename);
std::string modelShortName = p.filename();
std::string modelShortName = p.filename().string();
// Configure compile phase information.
SET_TOTAL_COMPILE_PHASE(emissionTarget);
std::string msg =
Expand Down
1 change: 1 addition & 0 deletions utils/build-onnx-mlir.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ call cmake %root_dir%\onnx-mlir -G "Ninja" ^
-DLLVM_EXTERNAL_LIT=%lit_path% ^
-DLLVM_LIT_ARGS=-v ^
-DMLIR_DIR=%root_dir%\llvm-project\build\lib\cmake\mlir ^
-DONNX_MLIR_ENABLE_OMP=OFF ^
-DONNX_MLIR_ENABLE_STABLEHLO=OFF ^
-DONNX_MLIR_ENABLE_WERROR=ON

Expand Down
Loading