2020-10-03 05:57:35 +08:00
|
|
|
# TODO: This is copied from frontends/pytorch/csrc/c10_dispatch/CMakeLists.txt
|
|
|
|
# What is the idiomatic way of sharing this in 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")
|
|
|
|
|
|
|
|
|
|
|
|
set(LLVM_LINK_COMPONENTS
|
|
|
|
Core
|
|
|
|
Support
|
|
|
|
nativecodegen
|
|
|
|
)
|
|
|
|
|
2020-10-09 09:29:59 +08:00
|
|
|
add_npcomp_executable(mnist-playground
|
2020-10-03 05:57:35 +08:00
|
|
|
mnist-playground.cpp
|
|
|
|
)
|
|
|
|
llvm_update_compile_flags(mnist-playground)
|
|
|
|
get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
|
|
|
|
get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
|
|
|
|
target_link_libraries(mnist-playground PRIVATE
|
2020-10-09 09:29:59 +08:00
|
|
|
# Shared library deps first ensure we get most of what we need from libraries.
|
|
|
|
NPCOMP
|
|
|
|
MLIR
|
|
|
|
|
2020-10-03 05:57:35 +08:00
|
|
|
MLIRAnalysis
|
|
|
|
MLIREDSC
|
|
|
|
MLIRExecutionEngine
|
|
|
|
MLIRIR
|
|
|
|
MLIRJitRunner
|
|
|
|
MLIRLLVMIR
|
|
|
|
MLIRParser
|
|
|
|
MLIRTargetLLVMIR
|
|
|
|
MLIRSupport
|
|
|
|
NPCOMPInitAll
|
2020-10-08 07:11:41 +08:00
|
|
|
NPCOMPRefBackendJITHelpers
|
2020-10-03 05:57:35 +08:00
|
|
|
${conversion_libs}
|
|
|
|
${dialect_libs}
|
|
|
|
${TORCH_LIBRARIES}
|
|
|
|
)
|
|
|
|
add_dependencies(mnist-playground
|
|
|
|
NPCOMPCompilerRuntimeShlib
|
|
|
|
)
|