Skip to content

Commit

Permalink
test: added gtest for the cuda related parts of centerpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Kenzo Lobos-Tsunekawa <kenzo.lobos@tier4.jp>
  • Loading branch information
knzo25 committed May 27, 2024
1 parent 583cd85 commit 72271ad
Show file tree
Hide file tree
Showing 8 changed files with 1,242 additions and 0 deletions.
44 changes: 44 additions & 0 deletions perception/lidar_centerpoint/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,50 @@ if(TRT_AVAIL AND CUDA_AVAIL AND CUDNN_AVAIL)
ament_auto_add_gtest(test_nms
test/test_nms.cpp
)
ament_auto_add_gtest(test_voxel_generator
test/test_voxel_generator.cpp
)

add_executable(test_preprocess_kernel
test/test_preprocess_kernel.cpp
lib/utils.cpp
)

target_include_directories(test_preprocess_kernel PUBLIC
${test_preprocess_kernel_SOURCE_DIR}
)

target_link_libraries(test_preprocess_kernel
centerpoint_cuda_lib
gtest
gtest_main
)

ament_add_test(test_preprocess_kernel
GENERATE_RESULT_FOR_RETURN_CODE_ZERO
COMMAND "$<TARGET_FILE:test_preprocess_kernel>"
)

add_executable(test_postprocess_kernel
test/test_postprocess_kernel.cpp
lib/utils.cpp
)

target_include_directories(test_postprocess_kernel PUBLIC
${test_postprocess_kernel_SOURCE_DIR}
)

target_link_libraries(test_postprocess_kernel
centerpoint_cuda_lib
gtest
gtest_main
)

ament_add_test(test_postprocess_kernel
GENERATE_RESULT_FOR_RETURN_CODE_ZERO
COMMAND "$<TARGET_FILE:test_postprocess_kernel>"
)

endif()

else()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ cudaError_t generateVoxels_random_launch(
{
dim3 blocks((points_size + 256 - 1) / 256);
dim3 threads(256);

if (blocks.x == 0) {
return cudaGetLastError();
}

generateVoxels_random_kernel<<<blocks, threads, 0, stream>>>(
points, points_size, min_x_range, max_x_range, min_y_range, max_y_range, min_z_range,
max_z_range, pillar_x_size, pillar_y_size, pillar_z_size, grid_y_size, grid_x_size, mask,
Expand Down
Loading

0 comments on commit 72271ad

Please sign in to comment.