Skip to content

Commit 85bfcf3

Browse files
committed
feat(autoware_camera_streampetr): CUDA 12.0+ build compatibility
Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
1 parent 898718b commit 85bfcf3

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

perception/autoware_camera_streampetr/CMakeLists.txt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,17 @@ if(TRT_AVAIL AND CUDA_AVAIL)
7272
list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_86,code=sm_86")
7373
list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_87,code=sm_87")
7474
list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_89,code=sm_89")
75-
if(CUDA_VERSION VERSION_LESS "13.0")
76-
list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_101,code=sm_101")
77-
else() # CUDA 13.0 renamed SM101 to SM110
78-
list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_110,code=sm_110")
75+
if(CUDA_VERSION VERSION_GREATER_EQUAL "12.8")
76+
if(CUDA_VERSION VERSION_LESS "13.0")
77+
list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_101,code=sm_101")
78+
else() # CUDA 13.0 renamed SM101 to SM110
79+
list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_110,code=sm_110")
80+
endif()
81+
list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_120,code=sm_120")
82+
list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_120,code=compute_120")
83+
else()
84+
list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_89,code=compute_89")
7985
endif()
80-
list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_120,code=sm_120")
81-
list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_120,code=compute_120")
8286

8387
cuda_add_library(${PROJECT_NAME}_cuda_lib SHARED
8488
lib/postprocess/circle_nms_kernel.cu

0 commit comments

Comments
 (0)