2020-04-16 14:38:52 +08:00
|
|
|
# Create shared libcruntime.so since model.so linkage for backend tests
|
|
|
|
# will fail on x86 Linux if cruntime is statically linked.
|
|
|
|
add_library(cruntime SHARED
|
2020-03-19 16:48:09 +08:00
|
|
|
DynMemRef.cpp
|
|
|
|
DynMemRef.h
|
|
|
|
DataType.h)
|
2019-12-22 13:25:02 +08:00
|
|
|
|
2020-06-08 10:18:55 +08:00
|
|
|
add_library(DynMemRefUtils
|
2020-03-19 16:48:09 +08:00
|
|
|
DynMemRef.h
|
2020-06-08 10:18:55 +08:00
|
|
|
DynMemRef.cpp
|
|
|
|
DataType.h)
|
|
|
|
|
|
|
|
add_library(ExecutionSession
|
|
|
|
ExecusionSession.hpp
|
|
|
|
ExecusionSession.cpp)
|
|
|
|
target_link_libraries(ExecutionSession
|
|
|
|
${CMAKE_DL_LIBS})
|
|
|
|
target_include_directories(ExecutionSession PRIVATE
|
|
|
|
${ONNX_MLIR_SRC_ROOT}
|
|
|
|
${ONNX_MLIR_BIN_ROOT}
|
|
|
|
${ONNX_MLIR_SRC_ROOT})
|
|
|
|
set_target_properties(ExecutionSession PROPERTIES
|
|
|
|
POSITION_INDEPENDENT_CODE TRUE)
|
|
|
|
|
|
|
|
pybind11_add_module(PyRuntime
|
|
|
|
PyExecutionSession.cpp
|
|
|
|
PyExecutionSession.hpp)
|
|
|
|
target_link_libraries(PyRuntime PRIVATE
|
|
|
|
${CMAKE_DL_LIBS}
|
|
|
|
ExecutionSession
|
|
|
|
DynMemRefUtils)
|
|
|
|
target_include_directories(PyRuntime PRIVATE
|
|
|
|
${ONNX_MLIR_SRC_ROOT}
|
|
|
|
${ONNX_MLIR_BIN_ROOT}
|
2020-03-17 21:16:33 +08:00
|
|
|
${ONNX_MLIR_SRC_ROOT})
|
2020-06-08 10:18:55 +08:00
|
|
|
|
|
|
|
add_dependencies(PyRuntime cruntime)
|
2020-06-09 02:03:35 +08:00
|
|
|
install(FILES DynMemRef.h DESTINATION include)
|
2020-05-26 16:05:00 +08:00
|
|
|
install(TARGETS cruntime DESTINATION lib)
|