onnxruntime/cmake/external/tvm.cmake
Valery Chernov 3b0aaa9e0e
[TVM EP] support build on Windows (#11851)
* add description of build ORT+TVM EP on Windows

* fix cmake error related to symlink creation on Windows

* add llvm config path to build flags for correct build on Windows

* update TVM_EP.md for llvm_config build arg

* fix warnings skipping during build on Windows

* fix using string or wstring for model path to correct build on Windows (MSVC error)

* fix error in custom logger for correct build on Windows

* implement glob algorithm for Windows

* additional build fixes

* update TVM with export of VM symbols for dll

* description of nasm issue and workaround

* update TVM with export of Executable from VM symbols for dll

* description of installation of ipp-crypto dependencies on Windows

* cmake key for ipp-crypto build

* fix wstring for TVMso EP

* fix ipp-crypto build

* cmake key onnxruntime_TVM_USE_HASH switch off not specific methods, but full hash functionality

* fix absolute path to compiled lib

* update TVM_EP.md, fix lint warnings

* update TVM_EP.md

* small fixes after review

* switch on handshake functionality for Linux workflow

Co-authored-by: Valery Chernov <valery.chernov@deelvin.com>
Co-authored-by: KJlaccHoeUM9l <wotpricol@mail.ru>
2022-07-13 10:48:42 +02:00

42 lines
1.1 KiB
CMake

if (onnxruntime_USE_TVM)
message(STATUS "onnxruntime_USE_TVM: Fetch tvm for TVM EP")
FetchContent_Declare(
tvm
GIT_REPOSITORY https://github.com/apache/tvm.git
GIT_TAG 3425ed846308a456f98404c79f6df1693bed6377
)
FetchContent_GetProperties(tvm)
if(NOT tvm_POPULATED)
FetchContent_Populate(tvm)
if (WIN32)
execute_process(
COMMAND ${CMAKE_COMMAND} -E create_symlink ${tvm_BINARY_DIR}/${CMAKE_BUILD_TYPE} ${tvm_SOURCE_DIR}/build
)
else()
file(CREATE_LINK ${tvm_BINARY_DIR} ${tvm_SOURCE_DIR}/build SYMBOLIC)
endif()
endif()
set(tvm_INCLUDE_DIRS ${tvm_SOURCE_DIR}/include)
endif()
if (onnxruntime_USE_NUPHAR)
message(STATUS "onnxruntime_USE_NUPHAR: Fetch onnxruntime-tvm for NUPHAR EP")
FetchContent_Declare(
tvm
GIT_REPOSITORY https://github.com/microsoft/onnxruntime-tvm.git
GIT_TAG 9ec2b92d180dff8877e402018b97baa574031b8b
)
FetchContent_GetProperties(tvm)
if(NOT tvm_POPULATED)
FetchContent_Populate(tvm)
endif()
set(tvm_INCLUDE_DIRS ${tvm_SOURCE_DIR}/include)
endif()