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

test(lidar_centerpoint): added gtest for the cuda related parts of centerpoint #7125

Merged
merged 5 commits into from
May 30, 2024
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
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
Loading