Skip to content

Commit

Permalink
Remove thrust::get<0>() calls on a scalar variable. (#4851)
Browse files Browse the repository at this point in the history
Close Issue #4846

Remove `thrust::get<0>()` calls on integer type variables. This shouldn't compile but this successfully compiles in the current build environment, so this hasn't been detected.

Authors:
  - Seunghwa Kang (https://github.com/seunghwak)

Approvers:
  - Chuck Hastings (https://github.com/ChuckHastings)

URL: #4851
  • Loading branch information
seunghwak authored Jan 14, 2025
1 parent 44d8c39 commit 6b5db94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cpp/src/sampling/neighbor_sampling_impl.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024, NVIDIA CORPORATION.
* Copyright (c) 2022-2025, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -184,7 +184,7 @@ neighbor_sample_impl(raft::handle_t const& handle,

std::vector<size_t> level_sizes{};

for (auto hop = 0; hop < num_hops; hop++) {
for (size_t hop = 0; hop < num_hops; ++hop) {
rmm::device_uvector<vertex_t> level_result_src(0, handle.get_stream());
rmm::device_uvector<vertex_t> level_result_dst(0, handle.get_stream());

Expand Down
8 changes: 3 additions & 5 deletions cpp/src/sampling/sampling_post_processing_impl.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023-2024, NVIDIA CORPORATION.
* Copyright (c) 2023-2025, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -1391,12 +1391,10 @@ compute_vertex_renumber_map(
[offsets = *vertex_type_offsets] __device__(auto lhs, auto rhs) {
auto lhs_v_type = thrust::distance(
offsets.begin() + 1,
thrust::upper_bound(
thrust::seq, offsets.begin() + 1, offsets.end(), thrust::get<0>(lhs)));
thrust::upper_bound(thrust::seq, offsets.begin() + 1, offsets.end(), lhs));
auto rhs_v_type = thrust::distance(
offsets.begin() + 1,
thrust::upper_bound(
thrust::seq, offsets.begin() + 1, offsets.end(), thrust::get<0>(rhs)));
thrust::upper_bound(thrust::seq, offsets.begin() + 1, offsets.end(), rhs));
return lhs_v_type < rhs_v_type;
});
}
Expand Down

0 comments on commit 6b5db94

Please sign in to comment.