Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
harrism committed Sep 26, 2023
1 parent 3bfdd0d commit dcdb388
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 24 deletions.
7 changes: 3 additions & 4 deletions cpp/include/cuspatial/detail/index/construction/phase_1.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,9 @@ inline std::tuple<IndexT, IndexT, std::vector<IndexT>, std::vector<IndexT>> buil

// iterator for the parent level's quad node keys
auto parent_keys = thrust::make_transform_iterator(
keys_begin,
cuda::proclaim_return_type<uint32_t>(
[] __device__(uint32_t const child_key) { return (child_key >> 2); }
));
keys_begin, cuda::proclaim_return_type<uint32_t>([] __device__(uint32_t const child_key) {
return (child_key >> 2);
}));

// iterator for the current level's quad node point and child counts
auto child_nodes = thrust::make_zip_iterator(quad_point_count_begin, quad_child_count_begin);
Expand Down
16 changes: 6 additions & 10 deletions cpp/include/cuspatial/detail/join/quadtree_bbox_filtering.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,14 @@ join_quadtree_and_bounding_boxes(point_quadtree_ref quadtree,
bounding_boxes_first,
// The top-level node indices
detail::make_counting_transform_iterator(
0,
cuda::proclaim_return_type<int32_t>(
[=] __device__(auto i) { return i % num_top_level_leaves; }
)
),
0, cuda::proclaim_return_type<int32_t>([=] __device__(auto i) {
return i % num_top_level_leaves;
})),
// The top-level bbox indices
detail::make_counting_transform_iterator(
0,
cuda::proclaim_return_type<int32_t>(
[=] __device__(auto i) { return i / num_top_level_leaves; }
)
),
0, cuda::proclaim_return_type<int32_t>([=] __device__(auto i) {
return i / num_top_level_leaves;
})),
make_current_level_iter(), // intermediate intersections or parent
// quadrants found during traversal
// found intersecting quadrant and bbox indices for output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ quadtree_point_to_nearest_linestring(LinestringIndexIterator linestring_indices_
auto all_point_indices =
thrust::make_transform_iterator(all_point_linestring_indices_and_distances,
cuda::proclaim_return_type<uint32_t>(
[] __device__(auto const& x) { return thrust::get<0>(x); }
));
[] __device__(auto const& x) { return thrust::get<0>(x); }));

// Allocate vectors for the distances min reduction
auto num_points = std::distance(point_indices_first, point_indices_last);
Expand Down Expand Up @@ -291,8 +290,7 @@ quadtree_point_to_nearest_linestring(LinestringIndexIterator linestring_indices_
}
// Otherwise choose linestring with smallest distance
return d_lhs < d_rhs ? lhs : rhs;
})
);
}));

auto const num_distances = thrust::distance(point_idxs.begin(), point_idxs_end.first);

Expand Down
7 changes: 3 additions & 4 deletions cpp/tests/distance/hausdorff_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,9 @@ void generic_hausdorff_test()
auto zero_iter = thrust::make_constant_iterator<vec_2d>({0, 0});
auto counting_iter = thrust::make_counting_iterator<uint32_t>(0);
auto space_offset_iter = thrust::make_transform_iterator(
counting_iter,
cuda::proclaim_return_type<uint32_t>(
[] __device__(auto idx) { return idx * elements_per_space; }
));
counting_iter, cuda::proclaim_return_type<uint32_t>([] __device__(auto idx) {
return idx * elements_per_space;
}));

auto distances = rmm::device_vector<T>(num_distances);
auto expected = rmm::device_vector<T>(num_distances, 0);
Expand Down
3 changes: 1 addition & 2 deletions cpp/tests/trajectory/trajectory_distances_and_speeds_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ struct TrajectoryDistancesAndSpeedsTest : public ::testing::Test {
expected_speeds.end(),
std::numeric_limits<T>::lowest(),
cuda::proclaim_return_type<T>(
[] __device__(T const& a, T const& b) { return max(abs(a), abs(b)); }
));
[] __device__(T const& a, T const& b) { return max(abs(a), abs(b)); }));

// We expect the floating point error (in ulps) due to be proportional to the number of
// operations to compute the relevant quantity. For distance, this computation is
Expand Down

0 comments on commit dcdb388

Please sign in to comment.