From 6b5db94d9b6ebee41577222d230a36675d3e3ff4 Mon Sep 17 00:00:00 2001 From: Seunghwa Kang <45857425+seunghwak@users.noreply.github.com> Date: Tue, 14 Jan 2025 10:17:43 -0800 Subject: [PATCH] Remove thrust::get<0>() calls on a scalar variable. (#4851) 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: https://github.com/rapidsai/cugraph/pull/4851 --- cpp/src/sampling/neighbor_sampling_impl.hpp | 4 ++-- cpp/src/sampling/sampling_post_processing_impl.cuh | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/cpp/src/sampling/neighbor_sampling_impl.hpp b/cpp/src/sampling/neighbor_sampling_impl.hpp index ed77b330439..4363005500c 100644 --- a/cpp/src/sampling/neighbor_sampling_impl.hpp +++ b/cpp/src/sampling/neighbor_sampling_impl.hpp @@ -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. @@ -184,7 +184,7 @@ neighbor_sample_impl(raft::handle_t const& handle, std::vector level_sizes{}; - for (auto hop = 0; hop < num_hops; hop++) { + for (size_t hop = 0; hop < num_hops; ++hop) { rmm::device_uvector level_result_src(0, handle.get_stream()); rmm::device_uvector level_result_dst(0, handle.get_stream()); diff --git a/cpp/src/sampling/sampling_post_processing_impl.cuh b/cpp/src/sampling/sampling_post_processing_impl.cuh index 4624e6d4a5e..151350dad6d 100644 --- a/cpp/src/sampling/sampling_post_processing_impl.cuh +++ b/cpp/src/sampling/sampling_post_processing_impl.cuh @@ -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. @@ -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; }); }