Commit b19fa875 authored by Nagy Mostafa's avatar Nagy Mostafa Committed by nmostafa

[MLIR] Move MLIR to src/contrib/mlir (#16)

* Move MLIR to src/contrib/mlir
parent ac8df2bb
......@@ -384,6 +384,7 @@ endif()
if (NGRAPH_MLIR_ENABLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNGRAPH_MLIR_ENABLE")
set(NGRAPH_MLIR_SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/contrib/mlir)
endif()
if (NGRAPH_PLAIDML_ENABLE)
......
......@@ -42,7 +42,7 @@
/src/ngraph/pattern/ @jbobba @aprocter
/src/ngraph/runtime/ @rkimballn1 @jbobba
/src/ngraph/runtime/cpu/ @jbobba
/src/ngraph/runtime/mlir/ @nmostafa @dcaballe @jbobba
/src/contrib/mlir/ @nmostafa @dcaballe
/src/ngraph/runtime/cpu/builder/allreduce.*pp @wenzhe-nrv @jbobba @avijit-nervana
/src/ngraph/runtime/dynamic/ @aprocter
/src/ngraph/runtime/gpu/ @rkimballn1
......
......@@ -20,6 +20,11 @@ include_directories(ngraph)
add_subdirectory(resource)
# This must be added before any backend that uses MLIR
if (NGRAPH_MLIR_ENABLE)
add_subdirectory(${NGRAPH_MLIR_SOURCE_DIR})
endif()
add_subdirectory(ngraph)
if (NGRAPH_TOOLS_ENABLE)
......
......@@ -23,6 +23,7 @@ set(SRC
memory_manager.cpp
)
if (NGRAPH_MLIR_ENABLE)
add_library(mlir_backend SHARED ${SRC})
message(STATUS "LLVM Directory: ${LLVM_DIR}")
......
......@@ -20,12 +20,13 @@
#include "ngraph/node_vector.hpp"
#include "ngraph/op/add.hpp"
#include "ngraph/runtime/cpu/op/matmul_bias.hpp"
#include "ngraph/runtime/mlir/dialect/dialect.hpp"
#include "ngraph/runtime/mlir/dialect/ops.hpp"
#include "ngraph/runtime/mlir/dialect/type.hpp"
#include "ngraph/runtime/mlir/lowerer.hpp"
#include "ngraph/type/element_type.hpp"
#include "dialect/dialect.hpp"
#include "dialect/ops.hpp"
#include "dialect/type.hpp"
#include "lowerer.hpp"
#include <llvm/ADT/STLExtras.h>
#include <llvm/IR/Module.h>
#include <llvm/Support/ErrorOr.h>
......
......@@ -25,8 +25,8 @@
#include "mlir/IR/StandardTypes.h"
#include "mlir/Transforms/DialectConversion.h"
#include "ngraph/assertion.hpp"
#include "ngraph/runtime/mlir/dialect/ops.hpp"
#include "ngraph/runtime/mlir/dialect/type.hpp"
#include "dialect/ops.hpp"
#include "dialect/type.hpp"
using namespace ngraph::runtime::cpu;
// anonymous namespace
......
......@@ -16,11 +16,6 @@
add_subdirectory(interpreter)
# This must be added before any backend that uses MLIR
if (NGRAPH_MLIR_ENABLE)
add_subdirectory(mlir)
endif()
# With CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS, when creating cpu_backend.dll, link reports error: library limit of 65535 objects exceeded
if (NGRAPH_CPU_ENABLE)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS FALSE)
......
......@@ -209,7 +209,7 @@ if (NGRAPH_CPU_ENABLE)
# TODO: can we get away without LLVM/MLIR include path.
# Currently mlir backend compiler.hpp include LLVM/MLIR files
get_directory_property(MLIR_LLVM_INCLUDEPATH
DIRECTORY ${CMAKE_SOURCE_DIR}/src/ngraph/runtime/mlir
DIRECTORY ${NGRAPH_MLIR_SOURCE_DIR}
DEFINITION MLIR_LLVM_INCLUDEPATH)
message(STATUS "Building CPU backend with MLIR")
......
......@@ -110,7 +110,7 @@
#include "ngraph/util.hpp"
#ifdef NGRAPH_MLIR_ENABLE
#include "ngraph/runtime/mlir/compiler.hpp"
#include "contrib/mlir/compiler.hpp"
#endif
using namespace std;
......
......@@ -193,7 +193,7 @@
#include "ngraph/runtime/cpu/pass/halide_subgraph_extraction.hpp"
#ifdef NGRAPH_MLIR_ENABLE
#include "ngraph/runtime/mlir/compiler.hpp"
#include "contrib/mlir/compiler.hpp"
#endif
using namespace std;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment