Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/actions/build-wheel-for-publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ inputs:
description: "cibuildwheel build selector (e.g., cp310-manylinux_x86_64)"
required: true
cmake_defines:
description: "Feature CMake defines that vary by wheel (e.g. -DUSE_METAL=ON on macOS)"
description: "Feature CMake defines that vary by wheel (e.g. -DTVM_TIRX_USE_METAL=ON on macOS)"
required: false
default: ""
include_cuda_runtime:
Expand Down Expand Up @@ -122,22 +122,22 @@ runs:
# which build without a container.
CIBW_CONTAINER_ENGINE: "docker; create_args: --volume /opt/llvm:/opt/llvm:ro"
# Each per-OS block carries the toolchain location (conda LLVM prefix +
# llvm-config path), the universal static-link policy (USE_LLVM --link-static
# llvm-config path), the universal static-link policy (TVM_TIRX_USE_LLVM --link-static
# and ZLIB_USE_STATIC_LIBS), and the CUDA sidecar. Feature defines that vary by
# wheel (e.g. USE_METAL on macOS) come from the matrix via inputs.cmake_defines.
# wheel (e.g. TVM_TIRX_USE_METAL on macOS) come from the matrix via inputs.cmake_defines.
# One explicit block per build platform (macOS / Linux / Windows); cibuildwheel
# env overrides replace rather than merge, so there is no shared base block.
CIBW_ENVIRONMENT_MACOS: >-
CMAKE_PREFIX_PATH="/opt/llvm"
CMAKE_ARGS="-DUSE_LLVM='/opt/llvm/bin/llvm-config --link-static' -DZLIB_USE_STATIC_LIBS=ON -DCMAKE_PREFIX_PATH=/opt/llvm ${{ inputs.cmake_defines }}"
CMAKE_ARGS="-DTVM_TIRX_USE_LLVM='/opt/llvm/bin/llvm-config --link-static' -DZLIB_USE_STATIC_LIBS=ON -DCMAKE_PREFIX_PATH=/opt/llvm ${{ inputs.cmake_defines }}"
CIBW_ENVIRONMENT_LINUX: >-
CMAKE_PREFIX_PATH="/opt/llvm"
LIBRARY_PATH="/opt/llvm/lib"
CMAKE_ARGS="-DUSE_LLVM='/opt/llvm/bin/llvm-config --link-static' -DZLIB_USE_STATIC_LIBS=ON -DCMAKE_PREFIX_PATH=/opt/llvm ${{ inputs.cmake_defines }} -DTVM_PACKAGE_EXTRA_LIBS=/project/build-wheel-cuda/lib/libtvm_runtime_cuda.so"
CMAKE_ARGS="-DTVM_TIRX_USE_LLVM='/opt/llvm/bin/llvm-config --link-static' -DZLIB_USE_STATIC_LIBS=ON -DCMAKE_PREFIX_PATH=/opt/llvm ${{ inputs.cmake_defines }} -DTVM_TIRX_PACKAGE_EXTRA_LIBS=/project/build-wheel-cuda/lib/libtvm_runtime_cuda.so"
CIBW_ENVIRONMENT_WINDOWS: >-
CMAKE_PREFIX_PATH="C:/opt/llvm/Library"
PATH="C:/opt/llvm/Library/bin;$PATH"
CMAKE_ARGS="-DUSE_LLVM='C:/opt/llvm/Library/bin/llvm-config.exe --link-static' -DZLIB_USE_STATIC_LIBS=ON -DCMAKE_PREFIX_PATH=C:/opt/llvm/Library ${{ inputs.cmake_defines }} -DTVM_PACKAGE_EXTRA_LIBS=${{ env.TVM_CUDA_EXTRA_LIB }}"
CMAKE_ARGS="-DTVM_TIRX_USE_LLVM='C:/opt/llvm/Library/bin/llvm-config.exe --link-static' -DZLIB_USE_STATIC_LIBS=ON -DCMAKE_PREFIX_PATH=C:/opt/llvm/Library ${{ inputs.cmake_defines }} -DTVM_TIRX_PACKAGE_EXTRA_LIBS=${{ env.TVM_CUDA_EXTRA_LIB }}"
# Turns the wheel-specific assertions in
# tirx/tests/python/all-platform-minimal-test/test_validate_runtime_library.py
# ON (they skip unless these are set). Every published wheel is LLVM-enabled,
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ runs:
- name: Install tvm-ffi pip package
shell: bash -l {0}
run: |
pip install -v ./3rdparty/tvm-ffi
pip install -v ./tirx/3rdparty/tvm-ffi
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
run: |
set -euxo pipefail
pip install scikit-build-core
export CMAKE_ARGS="-DUSE_LLVM=ON -DUSE_METAL=ON -DBUILD_TESTING=OFF"
export CMAKE_ARGS="-DTVM_TIRX_USE_LLVM=ON -DTVM_TIRX_USE_METAL=ON -DTVM_TIRX_BUILD_TESTS=OFF"
pip wheel --no-deps -w dist ./tirx -v
export PIP_FIND_LINKS="$(pwd)/dist"
export CMAKE_ARGS="-DBUILD_TESTING=OFF"
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
CMAKE_BUILD_PARALLEL_LEVEL: ${{ steps.env_vars.outputs.cpu_count }}
run: |
pip install scikit-build-core || exit /b 1
set CMAKE_ARGS=-DUSE_LLVM=ON -DBUILD_TESTING=OFF
set CMAKE_ARGS=-DTVM_TIRX_USE_LLVM=ON -DTVM_TIRX_BUILD_TESTS=OFF
pip wheel --no-deps -w dist ./tirx -v || exit /b 1
set PIP_FIND_LINKS=%CD%\dist
set CMAKE_ARGS=-DBUILD_TESTING=OFF
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ jobs:
build: cp310-macosx_arm64
include_cuda_runtime: "0"
artifact_suffix: macos-arm64
cmake_defines: "-DUSE_METAL=ON"
cmake_defines: "-DTVM_TIRX_USE_METAL=ON"
- name: "Windows AMD64 wheel with CUDA runtime"
os: windows-2022
arch: AMD64
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
path = 3rdparty/libflash_attn
url = https://github.com/tlc-pack/libflash_attn
[submodule "3rdparty/tvm-ffi"]
path = 3rdparty/tvm-ffi
path = tirx/3rdparty/tvm-ffi
url = https://github.com/apache/tvm-ffi
145 changes: 116 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,91 @@ if(TVM_BUILD_PYTHON_MODULE)
endif()
if(USE_CLML_GRAPH_EXECUTOR)
if(USE_CLML_GRAPH_EXECUTOR STREQUAL "ON")
set(USE_OPENCL "${CMAKE_CURRENT_SOURCE_DIR}/clml")
set(TVM_TIRX_USE_OPENCL "${CMAKE_CURRENT_SOURCE_DIR}/clml")
else()
set(USE_OPENCL "${USE_CLML_GRAPH_EXECUTOR}")
set(TVM_TIRX_USE_OPENCL "${USE_CLML_GRAPH_EXECUTOR}")
endif()
endif()
if(TVM_USE_INSTALLED_TIRX)
find_package(Python COMPONENTS Interpreter REQUIRED)
if(NOT tvm_tirx_DIR)
execute_process(COMMAND "${Python_EXECUTABLE}" -c
"import importlib.util; from pathlib import Path; print(Path(importlib.util.find_spec('tvm_tirx').origin).parent / 'lib/cmake/tvm_tirx')"
execute_process(COMMAND "${Python_EXECUTABLE}" -m tvm_tirx.config --cmakedir
OUTPUT_VARIABLE tvm_tirx_DIR OUTPUT_STRIP_TRAILING_WHITESPACE
COMMAND_ERROR_IS_FATAL ANY)
endif()
find_package(tvm_tirx CONFIG REQUIRED)
if(NOT TARGET tvm_ffi::shared)
if(NOT tvm_ffi_DIR)
execute_process(COMMAND "${Python_EXECUTABLE}" -m tvm_ffi.config --cmakedir
OUTPUT_VARIABLE tvm_ffi_DIR OUTPUT_STRIP_TRAILING_WHITESPACE
COMMAND_ERROR_IS_FATAL ANY)
endif()
find_package(tvm_ffi CONFIG REQUIRED)
endif()
# Parent extensions use installed sidecars privately. They are not part of
# the public TIRx package target interface.
get_target_property(_tirx_runtime_location tvm_runtime::shared IMPORTED_LOCATION)
get_filename_component(_tirx_libdir "${_tirx_runtime_location}" DIRECTORY)
foreach(_backend cuda rocm opencl vulkan metal)
find_library(_tirx_backend_library NAMES tvm_runtime_${_backend}
PATHS "${_tirx_libdir}" NO_DEFAULT_PATH NO_CACHE)
if(_tirx_backend_library AND NOT TARGET tvm_runtime_${_backend})
add_library(tvm_runtime_${_backend} UNKNOWN IMPORTED)
set_target_properties(tvm_runtime_${_backend} PROPERTIES
IMPORTED_LOCATION "${_tirx_backend_library}")
target_link_libraries(tvm_runtime_${_backend} INTERFACE tvm_runtime::shared tvm_ffi::shared)
endif()
unset(_tirx_backend_library)
endforeach()
foreach(_backend CUDA ROCM)
if(NOT DEFINED TVM_TIRX_USE_${_backend})
string(TOLOWER "${_backend}" _backend_lower)
set(TVM_TIRX_USE_${_backend} OFF)
if(TARGET tvm_runtime_${_backend_lower})
set(TVM_TIRX_USE_${_backend} ON)
endif()
endif()
endforeach()
if(TARGET tvm_runtime_opencl)
if(WIN32)
target_compile_definitions(tvm_runtime_opencl INTERFACE "TVM_OPENCL_DLL=__declspec(dllimport)")
else()
target_compile_definitions(tvm_runtime_opencl INTERFACE
"TVM_OPENCL_DLL=__attribute__((visibility(\"default\")))")
endif()
endif()
if(NOT TVM_TIRX_VERSION STREQUAL "0.1.0a0")
message(FATAL_ERROR "TVM requires apache-tvm-tirx 0.1.0a0")
endif()
else()
if(NOT TVM_OPENCL_HEADERS_ROOT AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/OpenCL-Headers/CL/cl.h")
set(TVM_OPENCL_HEADERS_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/OpenCL-Headers")
endif()
# Keep source-built core libraries beside the parent libraries.
set(_tirx_output_defaults "")
foreach(_kind ARCHIVE LIBRARY RUNTIME)
if(NOT DEFINED CMAKE_${_kind}_OUTPUT_DIRECTORY)
set(CMAKE_${_kind}_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
list(APPEND _tirx_output_defaults ${_kind})
endif()
endforeach()
add_subdirectory(tirx)
if(TARGET tirx_cpptest)
set_target_properties(tirx_cpptest PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
foreach(_config IN LISTS CMAKE_CONFIGURATION_TYPES)
string(TOUPPER "${_config}" _config_upper)
set_target_properties(tirx_cpptest PROPERTIES
RUNTIME_OUTPUT_DIRECTORY_${_config_upper} "${CMAKE_BINARY_DIR}")
endforeach()
endif()
foreach(_kind IN LISTS _tirx_output_defaults)
unset(CMAKE_${_kind}_OUTPUT_DIRECTORY)
endforeach()
endif()
foreach(_utility Utils Summary Linker Library FindCUDA FindROCM FindOpenCL CCache)
foreach(_utility Utils Summary Linker Library CCache)
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/utils/${_utility}.cmake")
endforeach()
foreach(_utility FindCUDA FindROCM FindOpenCL)
include("${TVM_TIRX_CMAKE_DIR}/utils/${_utility}.cmake")
endforeach()
foreach(_collective NCCL RCCL NVSHMEM)
Expand All @@ -66,25 +127,20 @@ endforeach()
if(NOT TARGET tvm_ffi_header)
add_library(tvm_ffi_header ALIAS tvm_ffi::header)
endif()
# Keep existing integration modules' target names usable with an installed core.
foreach(_library tvm_runtime tvm_runtime_static tvm_runtime_cuda tvm_runtime_rocm tvm_runtime_opencl tvm_runtime_vulkan tvm_runtime_metal)
if(NOT TARGET ${_library} AND TARGET tvm_tirx::${_library})
add_library(${_library} ALIAS tvm_tirx::${_library})
endif()
endforeach()
set(BUILD_FOR_ANDROID "${TVM_TIRX_BUILD_FOR_ANDROID}")
# Existing parent integration modules use the unqualified runtime target.
if(NOT TARGET tvm_runtime)
add_library(tvm_runtime ALIAS tvm_runtime::shared)
endif()
set(BUILD_FOR_ANDROID "${ANDROID}")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CUDA_STANDARD 20)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
tvm_option(USE_CUDA "Build with CUDA" "${TVM_TIRX_USE_CUDA}")
tvm_option(USE_NCCL "Build with NCCL" OFF)
tvm_option(USE_ROCM "Build with ROCM" "${TVM_TIRX_USE_ROCM}")
tvm_option(USE_RCCL "Build with RCCL" OFF)
tvm_option(USE_RPC "Build with RPC" ON)
tvm_option(USE_THREADS "Build with thread support" ON)
tvm_option(TVM_LOG_BEFORE_THROW "Whether log before throw, for debugging purposes" OFF)
tvm_option(USE_MSVC_MT "Build with MT" OFF)
tvm_option(INSTALL_DEV "Install compiler infrastructure" OFF)
Expand Down Expand Up @@ -173,7 +229,9 @@ tvm_file_glob(GLOB_RECURSE COMPILER_SRCS
add_library(tvm_runtime_extra SHARED)
add_library(tvm_runtime_extra_defs INTERFACE)
target_link_libraries(tvm_runtime_extra_defs INTERFACE
tvm_tirx::tvm_runtime tvm_tirx::private_headers tvm_ffi::header)
tvm_runtime::shared tvm_ffi::shared)
target_include_directories(tvm_runtime_extra_defs SYSTEM INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/tirx/3rdparty/compiler-rt")
target_compile_definitions(tvm_runtime_extra_defs INTERFACE TVM_RUNTIME_EXTRA_EXPORTS TVM_FFI_EXPORTS)
if(HIDE_PRIVATE_SYMBOLS AND NOT MSVC)
target_compile_options(tvm_runtime_extra_defs INTERFACE -fvisibility=hidden)
Expand All @@ -188,11 +246,11 @@ if(USE_RPC)
target_link_libraries(tvm_runtime_extra PRIVATE ws2_32)
endif()
endif()
if(USE_CUDA)
if(NOT TARGET tvm_tirx::tvm_runtime_cuda)
if(TVM_TIRX_USE_CUDA)
if(NOT TARGET tvm_runtime_cuda)
message(FATAL_ERROR "Parent CUDA support requires a CUDA-enabled core")
endif()
find_cuda(${USE_CUDA} ${USE_CUDNN})
find_cuda(${TVM_TIRX_USE_CUDA} ${USE_CUDNN})
enable_language(CUDA)
if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
set(CMAKE_CUDA_ARCHITECTURES native)
Expand All @@ -201,11 +259,15 @@ if(USE_CUDA)
tvm_file_glob(GLOB _vm_cuda_sources src/runtime/vm/cuda/*.cc)
target_sources(tvm_runtime_extra PRIVATE ${_vm_cuda_sources})
endif()
if(USE_ROCM)
if(NOT TARGET tvm_tirx::tvm_runtime_rocm)
if(TVM_TIRX_USE_ROCM)
if(NOT TARGET tvm_runtime_rocm)
message(FATAL_ERROR "Parent ROCm support requires a ROCm-enabled core")
endif()
find_rocm(${USE_ROCM})
if("${TVM_TIRX_USE_ROCM}" MATCHES ${IS_TRUE_PATTERN} AND IS_DIRECTORY "${TVM_TIRX_ROCM_PATH}")
find_rocm("${TVM_TIRX_ROCM_PATH}")
else()
find_rocm(${TVM_TIRX_USE_ROCM})
endif()
include_directories(SYSTEM ${ROCM_INCLUDE_DIRS})
add_compile_definitions(__HIP_PLATFORM_HCC__=1 __HIP_PLATFORM_AMD__=1)
endif()
Expand All @@ -227,8 +289,13 @@ include(cmake/modules/contrib/NNAPI.cmake)
include(cmake/modules/contrib/ExampleNPU.cmake)
include(cmake/modules/contrib/vllm.cmake)
if(USE_CLML_GRAPH_EXECUTOR)
target_link_libraries(tvm_clml_objs PRIVATE tvm_tirx::tvm_runtime_opencl)
target_link_libraries(tvm_runtime_extra PRIVATE tvm_tirx::tvm_runtime_opencl)
target_link_libraries(tvm_clml_objs PRIVATE tvm_runtime_opencl)
target_link_libraries(tvm_runtime_extra PRIVATE tvm_runtime_opencl)
endif()
if(TARGET tvm_clml_objs)
# CLML shares OpenCL implementation types; these are source inputs, not an
# installed core interface. The parent sdist carries their bounded closure.
target_include_directories(tvm_clml_objs PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/tirx/src")
endif()
# Retain the upstream runtime-extra assembly module and its target composition.
include(cmake/modules/RuntimeExtra.cmake)
Expand All @@ -238,8 +305,10 @@ if(HIDE_PRIVATE_SYMBOLS AND NOT MSVC)
target_compile_options(tvm_compiler PRIVATE -fvisibility=hidden)
endif()
target_compile_definitions(tvm_compiler PRIVATE TVM_EXPORTS TVM_FFI_EXPORTS)
target_link_libraries(tvm_compiler PUBLIC tvm_tirx::tvm_tirx tvm_runtime_extra)
target_link_libraries(tvm_compiler PRIVATE tvm_tirx::private_headers ${TVM_LINKER_LIBS})
target_link_libraries(tvm_compiler PUBLIC tvm_tirx::shared tvm_ffi::shared tvm_runtime_extra)
target_link_libraries(tvm_compiler PRIVATE ${TVM_LINKER_LIBS})
target_include_directories(tvm_compiler SYSTEM PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/tirx/3rdparty/compiler-rt")
foreach(_target tvm_compiler tvm_runtime_extra)
target_include_directories(${_target} PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
Expand Down Expand Up @@ -274,11 +343,11 @@ if(TARGET cpptest AND TARGET tirx_cpptest)
add_dependencies(cpptest tirx_cpptest)
endif()
add_custom_target(runtime DEPENDS tvm_runtime_extra)
add_dependencies(runtime tvm_tirx::tvm_runtime)
add_dependencies(runtime tvm_runtime::shared)
set(TVM_RUNTIME_BACKEND_LIBS tvm_runtime_extra)
foreach(_backend cuda opencl vulkan metal rocm)
if(TARGET tvm_tirx::tvm_runtime_${_backend})
list(APPEND TVM_RUNTIME_BACKEND_LIBS tvm_tirx::tvm_runtime_${_backend})
if(TARGET tvm_runtime_${_backend})
list(APPEND TVM_RUNTIME_BACKEND_LIBS tvm_runtime_${_backend})
endif()
endforeach()
if(USE_CPP_RPC)
Expand All @@ -290,6 +359,24 @@ endif()
if(USE_IOS_RPC)
add_subdirectory(apps/ios_rpc)
endif()
# The parent owns installation of the core when it embeds the source build.
if(NOT TVM_USE_INSTALLED_TIRX)
set(_core_install_targets tvm_tirx tvm_runtime tvm_runtime_static)
foreach(_backend cuda opencl vulkan metal rocm)
if(TARGET tvm_runtime_${_backend})
list(APPEND _core_install_targets tvm_runtime_${_backend})
endif()
endforeach()
install(TARGETS ${_core_install_targets}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY tirx/include/ DESTINATION include FILES_MATCHING PATTERN "*.h")
install(FILES tirx/cmake/tvm_tirx-config.cmake tirx/python/tvm_tirx/config.py
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/tvm_tirx")
install(DIRECTORY tirx/cmake/utils/
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/tvm_tirx/utils" FILES_MATCHING PATTERN "Find*.cmake")
endif()
install(TARGETS tvm_compiler tvm_runtime_extra
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand Down
4 changes: 2 additions & 2 deletions apps/android_rpc/app/src/main/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ LOCAL_SRC_FILES := org_apache_tvm_native_c_api.cc
LOCAL_LDFLAGS := -L$(SYSROOT)/usr/lib/ -llog

LOCAL_C_INCLUDES := $(ROOT_PATH)/include $(ROOT_PATH)/tirx/include \
$(ROOT_PATH)/3rdparty/tvm-ffi/include \
$(ROOT_PATH)/3rdparty/tvm-ffi/3rdparty/dlpack/include \
$(ROOT_PATH)/tirx/3rdparty/tvm-ffi/include \
$(ROOT_PATH)/tirx/3rdparty/tvm-ffi/3rdparty/dlpack/include \
$(ROOT_PATH)/3rdparty/OpenCL-Headers

LOCAL_MODULE = tvm4j_runtime_packed
Expand Down
25 changes: 14 additions & 11 deletions apps/android_rpc/app/src/main/jni/tvm_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,19 @@
#define TVM_LOG_CUSTOMIZE 1
#define TVM_FFI_USE_LIBBACKTRACE 0

#include "../3rdparty/tvm-ffi/src/ffi/backtrace.cc"
#include "../3rdparty/tvm-ffi/src/ffi/container.cc"
#include "../3rdparty/tvm-ffi/src/ffi/dtype.cc"
#include "../3rdparty/tvm-ffi/src/ffi/error.cc"
#include "../3rdparty/tvm-ffi/src/ffi/extra/library_module.cc"
#include "../3rdparty/tvm-ffi/src/ffi/extra/library_module_dynamic_lib.cc"
#include "../3rdparty/tvm-ffi/src/ffi/extra/library_module_system_lib.cc"
#include "../3rdparty/tvm-ffi/src/ffi/extra/module.cc"
#include "../3rdparty/tvm-ffi/src/ffi/function.cc"
#include "../3rdparty/tvm-ffi/src/ffi/object.cc"
#include "../3rdparty/tvm-ffi/src/ffi/tensor.cc"
// FFI registration precedes the runtime implementation.
// clang-format off
#include "../tirx/3rdparty/tvm-ffi/src/ffi/backtrace.cc"
#include "../tirx/3rdparty/tvm-ffi/src/ffi/container.cc"
#include "../tirx/3rdparty/tvm-ffi/src/ffi/dtype.cc"
#include "../tirx/3rdparty/tvm-ffi/src/ffi/error.cc"
#include "../tirx/3rdparty/tvm-ffi/src/ffi/extra/library_module.cc"
#include "../tirx/3rdparty/tvm-ffi/src/ffi/extra/library_module_dynamic_lib.cc"
#include "../tirx/3rdparty/tvm-ffi/src/ffi/extra/library_module_system_lib.cc"
#include "../tirx/3rdparty/tvm-ffi/src/ffi/extra/module.cc"
#include "../tirx/3rdparty/tvm-ffi/src/ffi/function.cc"
#include "../tirx/3rdparty/tvm-ffi/src/ffi/object.cc"
#include "../tirx/3rdparty/tvm-ffi/src/ffi/tensor.cc"
#include "../src/runtime/registry.cc"
#include "../src/runtime/rpc/rpc_channel.cc"
#include "../src/runtime/rpc/rpc_endpoint.cc"
Expand All @@ -63,6 +65,7 @@
#include "../tirx/src/runtime/threading_backend.cc"
#include "../tirx/src/runtime/timer.cc"
#include "../tirx/src/runtime/workspace_pool.cc"
// clang-format on

#ifdef TVM_OPENCL_RUNTIME
#include "../src/runtime/opencl/opencl_device_api.cc"
Expand Down
4 changes: 2 additions & 2 deletions apps/cpp_rpc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if (OS)
endif()
endif()

if(USE_OPENCL)
if(TARGET tvm_runtime_opencl)
if (ANDROID_ABI)
if(DEFINED ENV{ANDROID_NDK_MAJOR})
if($ENV{ANDROID_NDK_MAJOR} VERSION_LESS "23")
Expand All @@ -47,7 +47,7 @@ target_include_directories(
PUBLIC "../../include"
)

target_link_libraries(tvm_rpc PUBLIC tvm_ffi_header)
target_link_libraries(tvm_rpc PUBLIC tvm_ffi::shared)

if(NOT MSVC AND NOT APPLE)
list(APPEND TVM_RPC_LINKER_LIBS tvm_runtime "-Wl,--no-as-needed" ${TVM_RUNTIME_BACKEND_LIBS} "-Wl,--as-needed")
Expand Down
Loading
Loading