forked from autowarefoundation/autoware.universe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request autowarefoundation#358 from tier4/sync-upstream
chore: sync upstream
- Loading branch information
Showing
48 changed files
with
1,279 additions
and
3,806 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,81 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
cmake_minimum_required(VERSION 3.17) | ||
project(tensorrt_common) | ||
|
||
find_package(autoware_cmake REQUIRED) | ||
autoware_package() | ||
|
||
# TODO(tensorrt_common): Remove once upgrading to TensorRT 8.5 is complete | ||
add_compile_options(-Wno-deprecated-declarations) | ||
find_package(ament_cmake REQUIRED) | ||
find_package(cudnn_cmake_module REQUIRED) | ||
find_package(rclcpp REQUIRED) | ||
find_package(tensorrt_cmake_module REQUIRED) | ||
|
||
find_package(CUDA) | ||
find_package(CUDAToolkit) | ||
find_package(CUDNN) | ||
find_package(TENSORRT) | ||
|
||
if(NOT (${CUDA_FOUND} AND ${CUDNN_FOUND} AND ${TENSORRT_FOUND})) | ||
if(NOT (CUDAToolkit_FOUND AND CUDNN_FOUND AND TENSORRT_FOUND)) | ||
message(WARNING "cuda, cudnn, tensorrt libraries are not found") | ||
return() | ||
endif() | ||
|
||
cuda_add_library(${PROJECT_NAME} SHARED | ||
add_library(${PROJECT_NAME} SHARED | ||
src/tensorrt_common.cpp | ||
) | ||
|
||
ament_target_dependencies(${PROJECT_NAME} | ||
rclcpp | ||
target_link_libraries(${PROJECT_NAME} | ||
CUDA::cudart | ||
rclcpp::rclcpp | ||
stdc++fs | ||
${TENSORRT_LIBRARIES} | ||
) | ||
|
||
target_include_directories(${PROJECT_NAME} | ||
PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
$<INSTALL_INTERFACE:include> | ||
$<INSTALL_INTERFACE:include/${PROJECT_NAME}> | ||
${TENSORRT_INCLUDE_DIRS} | ||
) | ||
|
||
target_link_libraries(${PROJECT_NAME} | ||
${TENSORRT_LIBRARIES} | ||
stdc++fs | ||
set_target_properties(${PROJECT_NAME} | ||
PROPERTIES | ||
CXX_STANDARD 17 | ||
CXX_STANDARD_REQUIRED YES | ||
CXX_EXTENSIONS NO | ||
) | ||
|
||
# TODO(tensorrt_common): Remove -Wno-deprecated-declarations once upgrading to TensorRT 8.5 is complete | ||
target_compile_options(${PROJECT_NAME} PRIVATE | ||
-Wall -Wextra -Wpedantic -Werror -Wno-deprecated-declarations | ||
) | ||
|
||
target_compile_definitions(${PROJECT_NAME} PRIVATE | ||
TENSORRT_VERSION_MAJOR=${TENSORRT_VERSION_MAJOR} | ||
) | ||
|
||
list(APPEND ${PROJECT_NAME}_LIBRARIES "${PROJECT_NAME}") | ||
|
||
if(BUILD_TESTING) | ||
find_package(ament_lint_auto REQUIRED) | ||
|
||
# These don't pass yet, disable them for now | ||
set(ament_cmake_copyright_FOUND TRUE) | ||
set(ament_cmake_flake8_FOUND TRUE) | ||
set(ament_cmake_pep257_FOUND TRUE) | ||
set(ament_cmake_uncrustify_FOUND TRUE) | ||
|
||
ament_lint_auto_find_test_dependencies() | ||
endif() | ||
|
||
ament_export_include_directories(include) | ||
ament_export_dependencies(CUDA) | ||
ament_export_dependencies(cudnn_cmake_module) | ||
ament_export_dependencies(CUDNN) | ||
ament_export_dependencies(tensorrt_cmake_module) | ||
ament_export_dependencies(TENSORRT) | ||
install(TARGETS ${PROJECT_NAME} EXPORT export_${PROJECT_NAME}) | ||
install(DIRECTORY include/ DESTINATION include/${PROJECT_NAME}) | ||
|
||
ament_export_include_directories("include/${PROJECT_NAME}") | ||
ament_export_targets(export_${PROJECT_NAME}) | ||
|
||
ament_export_dependencies( | ||
"CUDA" | ||
"CUDAToolkit" | ||
"cudnn_cmake_module" | ||
"CUDNN" | ||
"rclcpp" | ||
"tensorrt_cmake_module" | ||
"TENSORRT" | ||
) | ||
|
||
ament_auto_package() | ||
ament_package() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.