mirror of https://github.com/llvm/torch-mlir
33 lines
749 B
CMake
33 lines
749 B
CMake
include_directories(
|
|
${TORCH_INCLUDE_DIRS}
|
|
${TORCH_INSTALL_PREFIX}/include/TH
|
|
${TORCH_INSTALL_PREFIX}/include/THC/opt/pytorch/pytorch
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
${PYTHON_INCLUDE_DIRS}
|
|
)
|
|
link_directories("${TORCH_INSTALL_PREFIX}/lib")
|
|
add_library(_torch_mlir SHARED
|
|
aten_mlir_bridge.cpp
|
|
aten_mlir_type.cpp
|
|
aten_mlir_type_default.cpp
|
|
device.cpp
|
|
init_python_bindings.cpp
|
|
ir.cpp
|
|
jit.cpp
|
|
mlir_gen.cpp
|
|
tensor.cpp
|
|
tensor_impl.cpp
|
|
torch_util.cpp
|
|
)
|
|
set_target_properties(_torch_mlir PROPERTIES PREFIX "")
|
|
|
|
get_property(mlir_libs GLOBAL PROPERTY MLIR_ALL_LIBS)
|
|
target_link_libraries(_torch_mlir
|
|
NPCOMPATenDialect
|
|
${TORCH_LIBRARIES}
|
|
${mlir_libs}
|
|
${PYTHON_LIBRARIES}
|
|
torch_python
|
|
)
|