Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tensorrt backend igpu build #96

Merged
merged 5 commits into from
Jul 3, 2024
Merged
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
105 changes: 66 additions & 39 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,53 +122,80 @@ message(STATUS "TRT_VERSION envvar is $ENV{TRT_VERSION}")
#
if("$ENV{TRT_VERSION}" VERSION_LESS 10)
set(SOURCE_DIR "src_trt8")
add_library(
triton-tensorrt-backend SHARED
${SOURCE_DIR}/tensorrt.cc
${SOURCE_DIR}/model_state.cc
${SOURCE_DIR}/tensorrt_model.cc
${SOURCE_DIR}/tensorrt_model.h
${SOURCE_DIR}/instance_state.cc
${SOURCE_DIR}/tensorrt_model_instance.cc
${SOURCE_DIR}/tensorrt_model_instance.h
${SOURCE_DIR}/tensorrt_utils.cc
${SOURCE_DIR}/tensorrt_utils.h
${SOURCE_DIR}/filesystem.h
${SOURCE_DIR}/filesystem.cc
${SOURCE_DIR}/semaphore.h
${SOURCE_DIR}/shared_library.h
${SOURCE_DIR}/shared_library.cc
${SOURCE_DIR}/loader.cc
${SOURCE_DIR}/loader.h
${SOURCE_DIR}/logging.cc
${SOURCE_DIR}/logging.h
${SOURCE_DIR}/output_allocator.cc
${SOURCE_DIR}/output_allocator.h
${SOURCE_DIR}/io_binding_info.cc
${SOURCE_DIR}/io_binding_info.h
)
# Shared library implementing the Triton Backend API
configure_file(${SOURCE_DIR}/libtriton_tensorrt.ldscript libtriton_tensorrt.ldscript COPYONLY)

target_include_directories(
triton-tensorrt-backend
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_DIR}
)
else()
set(SOURCE_DIR "src")
endif()


#
# Shared library implementing the Triton Backend API
#
configure_file(${SOURCE_DIR}/libtriton_tensorrt.ldscript libtriton_tensorrt.ldscript COPYONLY)
add_library(
triton-tensorrt-backend SHARED
${SOURCE_DIR}/tensorrt.cc
${SOURCE_DIR}/model_state.cc
${SOURCE_DIR}/tensorrt_model.cc
${SOURCE_DIR}/tensorrt_model.h
${SOURCE_DIR}/instance_state.cc
${SOURCE_DIR}/tensorrt_model_instance.cc
${SOURCE_DIR}/tensorrt_model_instance.h
${SOURCE_DIR}/shape_tensor.cc
${SOURCE_DIR}/shape_tensor.h
${SOURCE_DIR}/tensorrt_utils.cc
${SOURCE_DIR}/tensorrt_utils.h
${SOURCE_DIR}/filesystem.h
${SOURCE_DIR}/filesystem.cc
${SOURCE_DIR}/semaphore.h
${SOURCE_DIR}/shared_library.h
${SOURCE_DIR}/shared_library.cc
${SOURCE_DIR}/loader.cc
${SOURCE_DIR}/loader.h
${SOURCE_DIR}/logging.cc
${SOURCE_DIR}/logging.h
${SOURCE_DIR}/output_allocator.cc
${SOURCE_DIR}/output_allocator.h
${SOURCE_DIR}/io_binding_info.cc
${SOURCE_DIR}/io_binding_info.h
)
# Shared library implementing the Triton Backend API
configure_file(${SOURCE_DIR}/libtriton_tensorrt.ldscript libtriton_tensorrt.ldscript COPYONLY)

add_library(
triton-tensorrt-backend SHARED
${SOURCE_DIR}/tensorrt.cc
${SOURCE_DIR}/model_state.cc
${SOURCE_DIR}/tensorrt_model.cc
${SOURCE_DIR}/tensorrt_model.h
${SOURCE_DIR}/instance_state.cc
${SOURCE_DIR}/tensorrt_model_instance.cc
${SOURCE_DIR}/tensorrt_model_instance.h
${SOURCE_DIR}/shape_tensor.cc
${SOURCE_DIR}/shape_tensor.h
${SOURCE_DIR}/tensorrt_utils.cc
${SOURCE_DIR}/tensorrt_utils.h
${SOURCE_DIR}/filesystem.h
${SOURCE_DIR}/filesystem.cc
${SOURCE_DIR}/semaphore.h
${SOURCE_DIR}/shared_library.h
${SOURCE_DIR}/shared_library.cc
${SOURCE_DIR}/loader.cc
${SOURCE_DIR}/loader.h
${SOURCE_DIR}/logging.cc
${SOURCE_DIR}/logging.h
${SOURCE_DIR}/output_allocator.cc
${SOURCE_DIR}/output_allocator.h
${SOURCE_DIR}/io_binding_info.cc
${SOURCE_DIR}/io_binding_info.h
)
target_include_directories(
triton-tensorrt-backend
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_DIR}
)
endif()

add_library(
TritonTensorRTBackend::triton-tensorrt-backend ALIAS triton-tensorrt-backend
)

target_include_directories(
triton-tensorrt-backend
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_DIR}
)

target_include_directories(
triton-tensorrt-backend
PRIVATE ${TRITON_TENSORRT_INCLUDE_PATHS}
Expand Down
Loading