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
18 changes: 9 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,9 @@ tvm_file_glob(GLOB RUNTIME_SRCS
src/runtime/*.cc
src/runtime/vm/*.cc
src/runtime/memory/*.cc
src/runtime/minrpc/*.cc
src/runtime/rpc/minrpc/*.cc
)
# Note: src/runtime/disco/** moves to libtvm_runtime_extra.
# Note: src/runtime/extra/disco/** moves to libtvm_runtime_extra.
# Note: src/runtime/{cuda,vulkan,opencl,metal,rocm,hexagon}/* move to per-backend DSOs.
set(TVM_RUNTIME_EXT_OBJS "")

Expand Down Expand Up @@ -455,14 +455,14 @@ include(cmake/modules/Git.cmake)

# ---- libtvm_runtime_extra assembly ----
# Disco core sources.
tvm_file_glob(GLOB _disco_core_srcs src/runtime/disco/*.cc)
tvm_file_glob(GLOB _disco_core_srcs src/runtime/extra/disco/*.cc)
add_library(tvm_disco_objs OBJECT ${_disco_core_srcs})
target_link_libraries(tvm_disco_objs PRIVATE tvm_runtime_extra_defs)
target_link_libraries(tvm_runtime_extra PRIVATE tvm_disco_objs)

# Distributed disco (disabled for Hexagon cross-compile).
if(NOT BUILD_FOR_HEXAGON)
tvm_file_glob(GLOB _disco_dist_srcs src/runtime/disco/distributed/*.cc)
tvm_file_glob(GLOB _disco_dist_srcs src/runtime/extra/disco/distributed/*.cc)
add_library(tvm_disco_distributed_objs OBJECT ${_disco_dist_srcs})
target_link_libraries(tvm_disco_distributed_objs PRIVATE tvm_runtime_extra_defs)
target_link_libraries(tvm_runtime_extra PRIVATE tvm_disco_distributed_objs)
Expand All @@ -472,8 +472,8 @@ endif()
if(USE_CUDA AND USE_NCCL)
find_nccl(${USE_NCCL})
include_directories(SYSTEM ${NCCL_INCLUDE_DIR})
tvm_file_glob(GLOB _nccl_srcs src/runtime/disco/nccl/*.cc src/runtime/disco/cuda_ipc/*.cc 3rdparty/tensorrt_llm/*.cu)
set_source_files_properties(src/runtime/disco/nccl/nccl.cc PROPERTIES COMPILE_DEFINITIONS "TVM_NCCL_RCCL_SWITCH=0")
tvm_file_glob(GLOB _nccl_srcs src/runtime/extra/disco/nccl/*.cc src/runtime/extra/disco/cuda_ipc/*.cc 3rdparty/tensorrt_llm/*.cu)
set_source_files_properties(src/runtime/extra/disco/nccl/nccl.cc PROPERTIES COMPILE_DEFINITIONS "TVM_NCCL_RCCL_SWITCH=0")
add_library(tvm_nccl_objs OBJECT ${_nccl_srcs})
target_link_libraries(tvm_nccl_objs PRIVATE tvm_runtime_extra_defs)
find_library(LIBRT rt)
Expand All @@ -488,7 +488,7 @@ if(USE_CUDA AND USE_NVSHMEM)
endif()
set(CMAKE_CUDA_SEPARABLE_COMPILATION ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
tvm_file_glob(GLOB _nvshmem_srcs src/runtime/contrib/nvshmem/*.cc src/runtime/contrib/nvshmem/*.cu)
tvm_file_glob(GLOB _nvshmem_srcs src/runtime/extra/contrib/nvshmem/*.cc src/runtime/extra/contrib/nvshmem/*.cu)
add_library(tvm_nvshmem_objs OBJECT ${_nvshmem_srcs})
target_link_libraries(tvm_nvshmem_objs PRIVATE tvm_runtime_extra_defs)
target_include_directories(tvm_nvshmem_objs PUBLIC ${NVSHMEM_INCLUDE_DIR})
Expand All @@ -502,8 +502,8 @@ endif()
if(USE_ROCM AND USE_RCCL)
find_rccl(${USE_RCCL})
include_directories(SYSTEM ${RCCL_INCLUDE_DIR})
tvm_file_glob(GLOB _rccl_srcs src/runtime/disco/nccl/*.cc)
set_source_files_properties(src/runtime/disco/nccl/nccl.cc PROPERTIES COMPILE_DEFINITIONS "TVM_NCCL_RCCL_SWITCH=1")
tvm_file_glob(GLOB _rccl_srcs src/runtime/extra/disco/nccl/*.cc)
set_source_files_properties(src/runtime/extra/disco/nccl/nccl.cc PROPERTIES COMPILE_DEFINITIONS "TVM_NCCL_RCCL_SWITCH=1")
add_library(tvm_rccl_objs OBJECT ${_rccl_srcs})
target_link_libraries(tvm_rccl_objs PRIVATE tvm_runtime_extra_defs)
target_link_libraries(tvm_runtime_extra PRIVATE tvm_rccl_objs rccl)
Expand Down
6 changes: 2 additions & 4 deletions apps/android_rpc/app/src/main/jni/tvm_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#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/extra/testing.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"
Expand All @@ -49,7 +48,6 @@
#include "../src/runtime/file_utils.cc"
#include "../src/runtime/logging.cc"
#include "../src/runtime/memory/memory_manager.cc"
#include "../src/runtime/minrpc/minrpc_logger.cc"
#include "../src/runtime/registry.cc"
#include "../src/runtime/rpc/rpc_channel.cc"
#include "../src/runtime/rpc/rpc_endpoint.cc"
Expand Down Expand Up @@ -85,11 +83,11 @@
#endif

#ifdef USE_SORT
#include "../src/runtime/contrib/sort/sort.cc"
#include "../src/runtime/extra/contrib/sort/sort.cc"
#endif

#ifdef USE_RANDOM
#include "../src/runtime/contrib/random/random.cc"
#include "../src/runtime/extra/contrib/random/random.cc"
#endif

#include <android/log.h>
Expand Down
12 changes: 6 additions & 6 deletions cmake/modules/CUDA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ if(USE_CUDA AND USE_CUDNN)
include_directories(SYSTEM ${CUDA_CUDNN_INCLUDE_DIRS})
tvm_file_glob(GLOB CUDNN_RELAX_CONTRIB_SRC src/relax/backend/contrib/cudnn/*.cc)
list(APPEND COMPILER_SRCS ${CUDNN_RELAX_CONTRIB_SRC})
tvm_file_glob(GLOB CONTRIB_CUDNN_SRCS src/runtime/contrib/cudnn/*.cc)
tvm_file_glob(GLOB CONTRIB_CUDNN_SRCS src/runtime/extra/contrib/cudnn/*.cc)
add_library(tvm_cudnn_objs OBJECT ${CONTRIB_CUDNN_SRCS})
target_link_libraries(tvm_cudnn_objs PRIVATE tvm_runtime_extra_defs)
target_link_libraries(tvm_runtime_extra PRIVATE tvm_cudnn_objs ${CUDA_CUDNN_LIBRARY})
Expand All @@ -115,7 +115,7 @@ if(USE_CUDA AND USE_CUDNN_FRONTEND)
if(NOT CUDNN_FRONTEND_HEADER)
message(FATAL_ERROR "Cannot find cudnn_frontend.h, please set USE_CUDNN_FRONTEND to the path of the cuDNN frontend header")
endif()
tvm_file_glob(GLOB CONTRIB_CUDNN_FRONTEND_SRCS src/runtime/contrib/cudnn/cudnn_frontend/*.cc)
tvm_file_glob(GLOB CONTRIB_CUDNN_FRONTEND_SRCS src/runtime/extra/contrib/cudnn/cudnn_frontend/*.cc)
set_source_files_properties(${CONTRIB_CUDNN_SRCS} PROPERTIES COMPILE_DEFINITIONS TVM_USE_CUDNN_FRONTEND=1)
add_library(tvm_cudnn_frontend_objs OBJECT ${CONTRIB_CUDNN_FRONTEND_SRCS})
target_link_libraries(tvm_cudnn_frontend_objs PRIVATE tvm_runtime_extra_defs)
Expand All @@ -126,7 +126,7 @@ if(USE_CUDA AND USE_CUBLAS)
message(STATUS "Build with cuBLAS support")
tvm_file_glob(GLOB CUBLAS_CONTRIB_SRC src/relax/backend/contrib/cublas/*.cc)
list(APPEND COMPILER_SRCS ${CUBLAS_CONTRIB_SRC})
tvm_file_glob(GLOB CONTRIB_CUBLAS_SRCS src/runtime/contrib/cublas/*.cc)
tvm_file_glob(GLOB CONTRIB_CUBLAS_SRCS src/runtime/extra/contrib/cublas/*.cc)
add_library(tvm_cublas_objs OBJECT ${CONTRIB_CUBLAS_SRCS})
target_link_libraries(tvm_cublas_objs PRIVATE tvm_runtime_extra_defs)
target_link_libraries(tvm_runtime_extra PRIVATE tvm_cublas_objs ${CUDA_CUBLAS_LIBRARY})
Expand All @@ -137,7 +137,7 @@ endif(USE_CUDA AND USE_CUBLAS)

if(USE_CUDA AND USE_THRUST)
message(STATUS "Build with Thrust support")
tvm_file_glob(GLOB CONTRIB_THRUST_SRC src/runtime/contrib/thrust/*.cu)
tvm_file_glob(GLOB CONTRIB_THRUST_SRC src/runtime/extra/contrib/thrust/*.cu)
add_library(tvm_thrust_objs OBJECT ${CONTRIB_THRUST_SRC})
target_link_libraries(tvm_thrust_objs PRIVATE tvm_runtime_extra_defs)
target_compile_options(tvm_thrust_objs PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--expt-extended-lambda>)
Expand All @@ -151,8 +151,8 @@ endif(USE_CUDA AND USE_THRUST)
if(USE_CUDA AND USE_CURAND)
message(STATUS "Build with cuRAND support")
message(STATUS "${CUDA_CURAND_LIBRARY}")
tvm_file_glob(GLOB CONTRIB_CURAND_SRC_CC src/runtime/contrib/curand/*.cc)
tvm_file_glob(GLOB CONTRIB_CURAND_SRC_CU src/runtime/contrib/curand/*.cu)
tvm_file_glob(GLOB CONTRIB_CURAND_SRC_CC src/runtime/extra/contrib/curand/*.cc)
tvm_file_glob(GLOB CONTRIB_CURAND_SRC_CU src/runtime/extra/contrib/curand/*.cu)
add_library(tvm_curand_objs OBJECT ${CONTRIB_CURAND_SRC_CC} ${CONTRIB_CURAND_SRC_CU})
target_link_libraries(tvm_curand_objs PRIVATE tvm_runtime_extra_defs)
target_link_libraries(tvm_runtime_extra PRIVATE tvm_curand_objs ${CUDA_CURAND_LIBRARY})
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/Hexagon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ if(USE_HEXAGON_RPC)

# Include the generic RPC code into the TVM runtime.
list(APPEND RUNTIME_HEXAGON_SRCS
"${TVMRT_SOURCE_DIR}/minrpc/minrpc_server.h"
"${TVMRT_SOURCE_DIR}/minrpc/rpc_reference.h"
"${TVMRT_SOURCE_DIR}/rpc/minrpc/minrpc_server.h"
"${TVMRT_SOURCE_DIR}/rpc/minrpc/rpc_reference.h"
"${TVMRT_SOURCE_DIR}/rpc/rpc_module.cc"
"${TVMRT_SOURCE_DIR}/rpc/rpc_endpoint.cc"
"${TVMRT_SOURCE_DIR}/rpc/rpc_session.cc"
Expand Down
6 changes: 3 additions & 3 deletions cmake/modules/ROCM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if(USE_ROCM AND USE_HIPBLAS)
message(STATUS "Build with HIPBLAS support")
tvm_file_glob(GLOB HIPBLAS_CONTRIB_SRC src/relax/backend/contrib/hipblas/*.cc)
list(APPEND COMPILER_SRCS ${HIPBLAS_CONTRIB_SRC})
tvm_file_glob(GLOB HIPBLAS_CONTRIB_SRCS src/runtime/contrib/hipblas/*.cc)
tvm_file_glob(GLOB HIPBLAS_CONTRIB_SRCS src/runtime/extra/contrib/hipblas/*.cc)
add_library(tvm_hipblas_objs OBJECT ${HIPBLAS_CONTRIB_SRCS})
target_link_libraries(tvm_hipblas_objs PRIVATE tvm_runtime_extra_defs)
target_link_libraries(tvm_runtime_extra PRIVATE tvm_hipblas_objs ${ROCM_HIPBLAS_LIBRARY})
Expand All @@ -84,8 +84,8 @@ if(USE_ROCM AND USE_THRUST)

find_package(rocprim REQUIRED)
find_package(rocthrust REQUIRED)
set_source_files_properties(src/runtime/contrib/thrust/thrust.cu PROPERTIES LANGUAGE CXX)
add_library(tvm_rocthrust_objs OBJECT src/runtime/contrib/thrust/thrust.cu)
set_source_files_properties(src/runtime/extra/contrib/thrust/thrust.cu PROPERTIES LANGUAGE CXX)
add_library(tvm_rocthrust_objs OBJECT src/runtime/extra/contrib/thrust/thrust.cu)
target_link_libraries(tvm_rocthrust_objs PRIVATE tvm_runtime_extra_defs)
target_link_libraries(tvm_runtime_extra PRIVATE tvm_rocthrust_objs roc::rocthrust)
endif(USE_ROCM AND USE_THRUST)
2 changes: 1 addition & 1 deletion cmake/modules/contrib/AMX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.

if(USE_AMX)
file(GLOB AMX_RUNTIME_CONFIG src/runtime/contrib/amx/amx_config.cc)
file(GLOB AMX_RUNTIME_CONFIG src/runtime/extra/contrib/amx/amx_config.cc)
list(APPEND COMPILER_SRCS ${AMX_RUNTIME_CONFIG})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=sapphirerapids")
message(STATUS "Build with Intel AMX support...")
Expand Down
8 changes: 4 additions & 4 deletions cmake/modules/contrib/BLAS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

if(USE_BLAS STREQUAL "openblas")
find_library(BLAS_LIBRARY openblas)
add_library(tvm_blas_objs OBJECT src/runtime/contrib/cblas/cblas.cc)
add_library(tvm_blas_objs OBJECT src/runtime/extra/contrib/cblas/cblas.cc)
target_link_libraries(tvm_blas_objs PRIVATE tvm_runtime_extra_defs)
target_link_libraries(tvm_runtime_extra PRIVATE tvm_blas_objs ${BLAS_LIBRARY})
message(STATUS "Using BLAS library " ${BLAS_LIBRARY})
Expand All @@ -28,14 +28,14 @@ if(USE_BLAS STREQUAL "openblas")
endif()
elseif(USE_BLAS STREQUAL "atlas" OR USE_BLAS STREQUAL "blas")
find_library(BLAS_LIBRARY cblas)
add_library(tvm_blas_objs OBJECT src/runtime/contrib/cblas/cblas.cc)
add_library(tvm_blas_objs OBJECT src/runtime/extra/contrib/cblas/cblas.cc)
target_link_libraries(tvm_blas_objs PRIVATE tvm_runtime_extra_defs)
target_link_libraries(tvm_runtime_extra PRIVATE tvm_blas_objs ${BLAS_LIBRARY})
message(STATUS "Use BLAS library " ${BLAS_LIBRARY})
elseif(USE_BLAS STREQUAL "apple")
find_library(BLAS_LIBRARY Accelerate)
include_directories(SYSTEM ${BLAS_LIBRARY}/Versions/Current/Frameworks/vecLib.framework/Versions/Current/Headers/)
add_library(tvm_blas_objs OBJECT src/runtime/contrib/cblas/cblas.cc)
add_library(tvm_blas_objs OBJECT src/runtime/extra/contrib/cblas/cblas.cc)
target_link_libraries(tvm_blas_objs PRIVATE tvm_runtime_extra_defs)
target_link_libraries(tvm_runtime_extra PRIVATE tvm_blas_objs ${BLAS_LIBRARY})
message(STATUS "Use BLAS library " ${BLAS_LIBRARY})
Expand Down Expand Up @@ -66,7 +66,7 @@ if(USE_MKL OR USE_MKL_PATH)
find_library(BLAS_LIBRARY_MKL NAMES mkl_rt HINTS ${USE_MKL}/lib/ ${USE_MKL}/lib/intel64_win)
endif()
include_directories(SYSTEM ${USE_MKL}/include)
add_library(tvm_mkl_objs OBJECT src/runtime/contrib/cblas/mkl.cc)
add_library(tvm_mkl_objs OBJECT src/runtime/extra/contrib/cblas/mkl.cc)
target_link_libraries(tvm_mkl_objs PRIVATE tvm_runtime_extra_defs)
target_link_libraries(tvm_runtime_extra PRIVATE tvm_mkl_objs ${BLAS_LIBRARY_MKL})
add_definitions(-DUSE_MKL_BLAS=1)
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/contrib/CLML.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

if(USE_CLML)
file(GLOB CLML_RELAX_CONTRIB_SRC src/relax/backend/contrib/clml/*.cc)
file(GLOB CLML_RUNTIME_MODULE src/runtime/contrib/clml/clml_runtime.cc)
file(GLOB CLML_RUNTIME_MODULE src/runtime/extra/contrib/clml/clml_runtime.cc)
include_directories(SYSTEM "3rdparty/OpenCL-Headers")
list(APPEND COMPILER_SRCS ${CLML_RELAX_CONTRIB_SRC})
if(NOT USE_CLML_GRAPH_EXECUTOR)
Expand Down Expand Up @@ -49,7 +49,7 @@ if(USE_CLML_GRAPH_EXECUTOR)
set(CLML_PATH ${USE_CLML_GRAPH_EXECUTOR})
endif()

file(GLOB CLML_CONTRIB_SRC src/runtime/contrib/clml/*)
file(GLOB CLML_CONTRIB_SRC src/runtime/extra/contrib/clml/*)

# CMake needs to find clml library, include and support directories
# in the path specified by CLML_PATH.
Expand Down
16 changes: 8 additions & 8 deletions cmake/modules/contrib/CUTLASS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if(USE_CUDA AND USE_CUTLASS)
target_link_libraries(fpA_intB_gemm_tvm PRIVATE tvm_ffi_header)

set(CUTLASS_FPA_INTB_RUNTIME_SRCS "")
list(APPEND CUTLASS_FPA_INTB_RUNTIME_SRCS src/runtime/contrib/cutlass/weight_preprocess.cc)
list(APPEND CUTLASS_FPA_INTB_RUNTIME_SRCS src/runtime/extra/contrib/cutlass/weight_preprocess.cc)
add_library(fpA_intB_cutlass_objs OBJECT ${CUTLASS_FPA_INTB_RUNTIME_SRCS})
target_link_libraries(fpA_intB_cutlass_objs PRIVATE tvm_runtime_extra_defs)
target_include_directories(fpA_intB_cutlass_objs PRIVATE
Expand All @@ -54,15 +54,15 @@ if(USE_CUDA AND USE_CUTLASS)
set(TVM_CUTLASS_RUNTIME_SRCS "")

if(CMAKE_CUDA_ARCHITECTURES MATCHES "90a")
list(APPEND TVM_CUTLASS_RUNTIME_SRCS src/runtime/contrib/cutlass/fp16_group_gemm_sm90.cu)
list(APPEND TVM_CUTLASS_RUNTIME_SRCS src/runtime/contrib/cutlass/fp8_group_gemm_sm90.cu)
list(APPEND TVM_CUTLASS_RUNTIME_SRCS src/runtime/contrib/cutlass/fp8_gemm.cu)
list(APPEND TVM_CUTLASS_RUNTIME_SRCS src/runtime/contrib/cutlass/fp8_groupwise_scaled_gemm_sm90.cu)
list(APPEND TVM_CUTLASS_RUNTIME_SRCS src/runtime/extra/contrib/cutlass/fp16_group_gemm_sm90.cu)
list(APPEND TVM_CUTLASS_RUNTIME_SRCS src/runtime/extra/contrib/cutlass/fp8_group_gemm_sm90.cu)
list(APPEND TVM_CUTLASS_RUNTIME_SRCS src/runtime/extra/contrib/cutlass/fp8_gemm.cu)
list(APPEND TVM_CUTLASS_RUNTIME_SRCS src/runtime/extra/contrib/cutlass/fp8_groupwise_scaled_gemm_sm90.cu)
endif()
if(CMAKE_CUDA_ARCHITECTURES MATCHES "100a")
list(APPEND TVM_CUTLASS_RUNTIME_SRCS src/runtime/contrib/cutlass/fp16_group_gemm_sm100.cu)
list(APPEND TVM_CUTLASS_RUNTIME_SRCS src/runtime/contrib/cutlass/fp8_groupwise_scaled_gemm_sm100.cu)
list(APPEND TVM_CUTLASS_RUNTIME_SRCS src/runtime/contrib/cutlass/fp8_groupwise_scaled_group_gemm_sm100.cu)
list(APPEND TVM_CUTLASS_RUNTIME_SRCS src/runtime/extra/contrib/cutlass/fp16_group_gemm_sm100.cu)
list(APPEND TVM_CUTLASS_RUNTIME_SRCS src/runtime/extra/contrib/cutlass/fp8_groupwise_scaled_gemm_sm100.cu)
list(APPEND TVM_CUTLASS_RUNTIME_SRCS src/runtime/extra/contrib/cutlass/fp8_groupwise_scaled_group_gemm_sm100.cu)
endif()
if(TVM_CUTLASS_RUNTIME_SRCS)
add_library(tvm_cutlass_objs OBJECT ${TVM_CUTLASS_RUNTIME_SRCS})
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/contrib/CoreML.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if(USE_COREML)
message(STATUS "Build with contrib.coreml")
find_library(FOUNDATION_LIB Foundation)
find_library(COREML_LIB Coreml)
tvm_file_glob(GLOB COREML_CONTRIB_SRC src/runtime/contrib/coreml/*.mm)
tvm_file_glob(GLOB COREML_CONTRIB_SRC src/runtime/extra/contrib/coreml/*.mm)
add_library(tvm_coreml_objs OBJECT ${COREML_CONTRIB_SRC})
target_link_libraries(tvm_coreml_objs PRIVATE tvm_runtime_extra_defs)
target_link_libraries(tvm_runtime_extra PRIVATE tvm_coreml_objs ${FOUNDATION_LIB} ${COREML_LIB})
Expand Down
22 changes: 11 additions & 11 deletions cmake/modules/contrib/DNNL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ if(IS_DIRECTORY ${USE_DNNL})
tvm_file_glob(GLOB DNNL_CONTRIB_SRC src/relax/backend/contrib/dnnl/*.cc)
list(APPEND COMPILER_SRCS ${DNNL_CONTRIB_SRC})

tvm_file_glob(GLOB DNNL_CONTRIB_SRC src/runtime/contrib/dnnl/dnnl_json_runtime.cc
src/runtime/contrib/dnnl/dnnl_utils.cc
src/runtime/contrib/dnnl/dnnl.cc
src/runtime/contrib/cblas/dnnl_blas.cc)
tvm_file_glob(GLOB DNNL_CONTRIB_SRC src/runtime/extra/contrib/dnnl/dnnl_json_runtime.cc
src/runtime/extra/contrib/dnnl/dnnl_utils.cc
src/runtime/extra/contrib/dnnl/dnnl.cc
src/runtime/extra/contrib/cblas/dnnl_blas.cc)
add_library(tvm_dnnl_objs OBJECT ${DNNL_CONTRIB_SRC})
target_link_libraries(tvm_dnnl_objs PRIVATE tvm_runtime_extra_defs)
target_link_libraries(tvm_runtime_extra PRIVATE tvm_dnnl_objs ${EXTERN_LIBRARY_DNNL})
Expand All @@ -39,19 +39,19 @@ elseif((USE_DNNL STREQUAL "ON") OR (USE_DNNL STREQUAL "JSON"))
list(APPEND COMPILER_SRCS ${DNNL_CONTRIB_SRC})

find_library(EXTERN_LIBRARY_DNNL dnnl)
tvm_file_glob(GLOB DNNL_CONTRIB_SRC src/runtime/contrib/dnnl/dnnl_json_runtime.cc
src/runtime/contrib/dnnl/dnnl_utils.cc
src/runtime/contrib/dnnl/dnnl.cc
src/runtime/contrib/cblas/dnnl_blas.cc)
tvm_file_glob(GLOB DNNL_CONTRIB_SRC src/runtime/extra/contrib/dnnl/dnnl_json_runtime.cc
src/runtime/extra/contrib/dnnl/dnnl_utils.cc
src/runtime/extra/contrib/dnnl/dnnl.cc
src/runtime/extra/contrib/cblas/dnnl_blas.cc)
add_library(tvm_dnnl_objs OBJECT ${DNNL_CONTRIB_SRC})
target_link_libraries(tvm_dnnl_objs PRIVATE tvm_runtime_extra_defs)
target_link_libraries(tvm_runtime_extra PRIVATE tvm_dnnl_objs ${EXTERN_LIBRARY_DNNL})
message(STATUS "Build with DNNL JSON runtime: " ${EXTERN_LIBRARY_DNNL})
elseif(USE_DNNL STREQUAL "C_SRC")
find_library(EXTERN_LIBRARY_DNNL dnnl)
tvm_file_glob(GLOB DNNL_CONTRIB_SRC src/runtime/contrib/dnnl/dnnl.cc
src/runtime/contrib/dnnl/dnnl_utils.cc
src/runtime/contrib/cblas/dnnl_blas.cc)
tvm_file_glob(GLOB DNNL_CONTRIB_SRC src/runtime/extra/contrib/dnnl/dnnl.cc
src/runtime/extra/contrib/dnnl/dnnl_utils.cc
src/runtime/extra/contrib/cblas/dnnl_blas.cc)
add_library(tvm_dnnl_objs OBJECT ${DNNL_CONTRIB_SRC})
target_link_libraries(tvm_dnnl_objs PRIVATE tvm_runtime_extra_defs)
target_link_libraries(tvm_runtime_extra PRIVATE tvm_dnnl_objs ${EXTERN_LIBRARY_DNNL})
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/contrib/ExampleNPU.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if(USE_EXAMPLE_NPU_CODEGEN)
tvm_file_glob(GLOB COMPILER_EXAMPLE_NPU_SRCS src/relax/backend/contrib/example_npu/*.cc)
list(APPEND COMPILER_SRCS ${COMPILER_EXAMPLE_NPU_SRCS})

tvm_file_glob(GLOB RUNTIME_EXAMPLE_NPU_SRCS src/runtime/contrib/example_npu/*.cc)
tvm_file_glob(GLOB RUNTIME_EXAMPLE_NPU_SRCS src/runtime/extra/contrib/example_npu/*.cc)
if(NOT USE_EXAMPLE_NPU_RUNTIME)
list(APPEND COMPILER_SRCS ${RUNTIME_EXAMPLE_NPU_SRCS})
endif()
Expand All @@ -32,7 +32,7 @@ endif()
if(USE_EXAMPLE_NPU_RUNTIME)
message(STATUS "Build with Example NPU runtime")

tvm_file_glob(GLOB RUNTIME_EXAMPLE_NPU_SRCS src/runtime/contrib/example_npu/*.cc)
tvm_file_glob(GLOB RUNTIME_EXAMPLE_NPU_SRCS src/runtime/extra/contrib/example_npu/*.cc)
add_library(tvm_example_npu_objs OBJECT ${RUNTIME_EXAMPLE_NPU_SRCS})
target_link_libraries(tvm_example_npu_objs PRIVATE tvm_runtime_extra_defs)
target_link_libraries(tvm_runtime_extra PRIVATE tvm_example_npu_objs)
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/contrib/NNAPI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if(USE_NNAPI_CODEGEN)
message(STATUS "Build with NNAPI codegen")

tvm_file_glob(GLOB COMPILER_NNAPI_SRCS src/relax/backend/contrib/nnapi/*.cc)
tvm_file_glob(GLOB RUNTIME_NNAPI_SRCS src/runtime/contrib/nnapi/*.cc)
tvm_file_glob(GLOB RUNTIME_NNAPI_SRCS src/runtime/extra/contrib/nnapi/*.cc)
list(APPEND COMPILER_SRCS ${COMPILER_NNAPI_SRCS})
if(NOT USE_NNAPI_RUNTIME)
list(APPEND COMPILER_SRCS ${RUNTIME_NNAPI_SRCS})
Expand All @@ -31,7 +31,7 @@ endif()
if(USE_NNAPI_RUNTIME)
message(STATUS "Build with NNAPI runtime")

tvm_file_glob(GLOB RUNTIME_NNAPI_SRCS src/runtime/contrib/nnapi/*.cc)
tvm_file_glob(GLOB RUNTIME_NNAPI_SRCS src/runtime/extra/contrib/nnapi/*.cc)
add_library(tvm_nnapi_objs OBJECT ${RUNTIME_NNAPI_SRCS})
target_link_libraries(tvm_nnapi_objs PRIVATE tvm_runtime_extra_defs)
target_link_libraries(tvm_runtime_extra PRIVATE tvm_nnapi_objs neuralnetworks log)
Expand Down
Loading
Loading