2020-09-25 07:26:29 +08:00
|
|
|
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}
|
2020-11-18 08:04:14 +08:00
|
|
|
${Python3_INCLUDE_DIRS}
|
2020-11-21 09:03:23 +08:00
|
|
|
# TODO: Fix implicit ordering. If PyTorch was build against an external
|
|
|
|
# pybind11, then it will not be in the above search path and must be
|
|
|
|
# resolved here, in the hope that it is the same one we were configured
|
|
|
|
# with (which it should be if installed via pip). This is really fragile,
|
|
|
|
# though, causing cast failures at runtime if we get it wrong. Come up with
|
|
|
|
# a way to strengthen this.
|
|
|
|
${pybind11_INCLUDE_DIR}
|
2020-09-25 07:26:29 +08:00
|
|
|
)
|
|
|
|
link_directories("${TORCH_INSTALL_PREFIX}/lib")
|
2020-11-13 14:27:05 +08:00
|
|
|
add_library(npcomp_torch_builder_bindings
|
2020-09-26 09:13:16 +08:00
|
|
|
acap_dispatch.cpp
|
2020-10-30 08:41:15 +08:00
|
|
|
debug.cpp
|
2020-10-02 09:59:58 +08:00
|
|
|
func_builder.cpp
|
2020-11-21 09:03:23 +08:00
|
|
|
graph_importer.cpp
|
2020-09-29 09:36:00 +08:00
|
|
|
module_builder.cpp
|
2020-09-25 07:26:29 +08:00
|
|
|
python_bindings.cpp
|
|
|
|
)
|
|
|
|
|
2020-11-13 14:27:05 +08:00
|
|
|
target_link_libraries(npcomp_torch_builder_bindings
|
2020-09-25 07:26:29 +08:00
|
|
|
${TORCH_LIBRARIES}
|
2020-11-18 08:04:14 +08:00
|
|
|
${Python3_LIBRARIES}
|
2020-09-25 07:26:29 +08:00
|
|
|
torch_python
|
|
|
|
)
|