diff --git a/cpp/tests/community/leiden_test.cpp b/cpp/tests/community/leiden_test.cpp index bc58354bde..fc92709ac0 100644 --- a/cpp/tests/community/leiden_test.cpp +++ b/cpp/tests/community/leiden_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023-2024, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2023-2025, NVIDIA CORPORATION. All rights reserved. * * NVIDIA CORPORATION and its licensors retain all intellectual property * and proprietary rights in and to this software, related documentation @@ -128,16 +128,17 @@ class Tests_Leiden : public ::testing::TestWithParam(handle, clustering_v); unique_clustering_v = cugraph::test::unique(handle, std::move(unique_clustering_v)); - auto expected_unique_clustering_v = cugraph::test::sequence( - handle, unique_clustering_v.size(), size_t{1}, int32_t{0}); - + auto expected_unique_clustering_v = + cugraph::test::sequence(handle, unique_clustering_v.size(), size_t{1}, int32_t{0}); + auto h_unique_clustering_v = cugraph::test::to_host(handle, unique_clustering_v); - auto h_expected_unique_clustering_v = cugraph::test::to_host(handle, expected_unique_clustering_v); + auto h_expected_unique_clustering_v = + cugraph::test::to_host(handle, expected_unique_clustering_v); ASSERT_TRUE(std::equal(h_unique_clustering_v.begin(), h_unique_clustering_v.end(), diff --git a/cpp/tests/community/mg_leiden_test.cpp b/cpp/tests/community/mg_leiden_test.cpp index e22a2cb00e..bef32e711e 100644 --- a/cpp/tests/community/mg_leiden_test.cpp +++ b/cpp/tests/community/mg_leiden_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2024, NVIDIA CORPORATION. + * Copyright (c) 2021-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. @@ -189,15 +189,14 @@ class Tests_MGLeiden // Check numbering vertex_t num_vertices = mg_graph_view.local_vertex_partition_range_size(); rmm::device_uvector clustering_v(num_vertices, handle_->get_stream()); - cugraph::leiden( - *handle_, - rng_state, - mg_graph_view, - mg_edge_weight_view, - clustering_v.data(), - leiden_usecase.max_level_, - leiden_usecase.resolution_); - + cugraph::leiden(*handle_, + rng_state, + mg_graph_view, + mg_edge_weight_view, + clustering_v.data(), + leiden_usecase.max_level_, + leiden_usecase.resolution_); + // Ensure each rank has consecutive labels auto unique_clustering_v = cugraph::test::sort(*handle_, clustering_v); @@ -208,8 +207,9 @@ class Tests_MGLeiden auto expected_unique_clustering_v = cugraph::test::sequence( *handle_, unique_clustering_v.size(), size_t{1}, h_unique_clustering_v[0]); - - auto h_expected_unique_clustering_v = cugraph::test::to_host(*handle_, expected_unique_clustering_v); + + auto h_expected_unique_clustering_v = + cugraph::test::to_host(*handle_, expected_unique_clustering_v); ASSERT_TRUE(std::equal(h_unique_clustering_v.begin(), h_unique_clustering_v.end(), @@ -220,14 +220,13 @@ class Tests_MGLeiden auto cluster_ids_size_per_rank = cugraph::host_scalar_allgather( handle_->get_comms(), h_unique_clustering_v.size(), handle_->get_stream()); - assert( - h_unique_clustering_v.back() == (cluster_ids_size_per_rank[handle_->get_comms().get_rank - 1])); + assert(h_unique_clustering_v.back() == + (cluster_ids_size_per_rank[handle_->get_comms().get_rank - 1])); - // Necessary condition for the culster IDs to be globally numbered consecutively and coupled with - // the first check, it is sufficient. - EXPECT_EQ( - h_unique_clustering_v.back(), - cluster_ids_size_per_rank[handle_->get_comms().get_rank()] - 1) + // Necessary condition for the culster IDs to be globally numbered consecutively and coupled + // with the first check, it is sufficient. + EXPECT_EQ(h_unique_clustering_v.back(), + cluster_ids_size_per_rank[handle_->get_comms().get_rank()] - 1) << "Returned cluster IDs are not globally numbered consecutively"; }