From fa61f9b396c1c321c1b10f7a8fd0991d81715cd2 Mon Sep 17 00:00:00 2001 From: jnke2016 Date: Tue, 9 Jan 2024 05:14:22 -0800 Subject: [PATCH] rename to k_truss --- cpp/CMakeLists.txt | 2 +- cpp/include/cugraph/algorithms.hpp | 8 +++--- .../{ktruss_impl.cuh => k_truss_impl.cuh} | 2 +- .../community/{ktruss_sg.cu => k_truss_sg.cu} | 6 ++--- cpp/tests/CMakeLists.txt | 8 +++--- .../{ktruss_test.cpp => k_truss_test.cpp} | 26 +++++++++---------- 6 files changed, 26 insertions(+), 26 deletions(-) rename cpp/src/community/{ktruss_impl.cuh => k_truss_impl.cuh} (99%) rename cpp/src/community/{ktruss_sg.cu => k_truss_sg.cu} (89%) rename cpp/tests/community/{ktruss_test.cpp => k_truss_test.cpp} (86%) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 8e4dfbbf23c..224aad4264a 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -225,7 +225,7 @@ set(CUGRAPH_SOURCES src/community/legacy/ecg.cu src/community/egonet_sg.cu src/community/egonet_mg.cu - src/community/ktruss_sg.cu + src/community/k_truss_sg.cu src/sampling/random_walks.cu src/sampling/random_walks_sg.cu src/sampling/detail/prepare_next_frontier_sg.cu diff --git a/cpp/include/cugraph/algorithms.hpp b/cpp/include/cugraph/algorithms.hpp index 3df099e60ae..961524d56d2 100644 --- a/cpp/include/cugraph/algorithms.hpp +++ b/cpp/include/cugraph/algorithms.hpp @@ -1979,9 +1979,9 @@ void triangle_count(raft::handle_t const& handle, bool do_expensive_check = false); /* - * @brief Compute ktruss. + * @brief Compute k_truss. * - * Extract the ktruss subgraph of a graph + * Extract the k_truss subgraph of a graph * * @tparam vertex_t Type of vertex identifiers. Needs to be an integral type. * @tparam edge_t Type of edge identifiers. Needs to be an integral type. @@ -1993,9 +1993,9 @@ void triangle_count(raft::handle_t const& handle, * @param do_expensive_check A flag to run expensive checks for input arguments (if set to `true`). */ template -void ktruss(raft::handle_t const& handle, +void k_truss(raft::handle_t const& handle, graph_view_t const& graph_view, - edge_t counts, + edge_t k, bool do_expensive_check = false); /** diff --git a/cpp/src/community/ktruss_impl.cuh b/cpp/src/community/k_truss_impl.cuh similarity index 99% rename from cpp/src/community/ktruss_impl.cuh rename to cpp/src/community/k_truss_impl.cuh index c6662c1f043..b0792ef41b0 100644 --- a/cpp/src/community/ktruss_impl.cuh +++ b/cpp/src/community/k_truss_impl.cuh @@ -251,7 +251,7 @@ struct intersection_op_t { } // namespace template -void ktruss(raft::handle_t const& handle, +void k_truss(raft::handle_t const& handle, graph_view_t const& graph_view, edge_t k, bool do_expensive_check) diff --git a/cpp/src/community/ktruss_sg.cu b/cpp/src/community/k_truss_sg.cu similarity index 89% rename from cpp/src/community/ktruss_sg.cu rename to cpp/src/community/k_truss_sg.cu index 2bc6ab5fefa..38d713cf022 100644 --- a/cpp/src/community/ktruss_sg.cu +++ b/cpp/src/community/k_truss_sg.cu @@ -14,17 +14,17 @@ * limitations under the License. */ -#include +#include namespace cugraph { -template void ktruss(raft::handle_t const& handle, +template void k_truss(raft::handle_t const& handle, graph_view_t const& graph_view, int32_t k, bool do_expensive_check); -template void ktruss(raft::handle_t const& handle, +template void k_truss(raft::handle_t const& handle, graph_view_t const& graph_view, int64_t k, bool do_expensive_check); diff --git a/cpp/tests/CMakeLists.txt b/cpp/tests/CMakeLists.txt index d3224df2860..c827582099a 100644 --- a/cpp/tests/CMakeLists.txt +++ b/cpp/tests/CMakeLists.txt @@ -402,6 +402,10 @@ ConfigureTest(CORE_NUMBER_TEST cores/core_number_test.cpp) # - Core Number tests ----------------------------------------------------------------------------- ConfigureTest(K_CORE_TEST cores/k_core_test.cpp) +############################################################################################### +# - K-truss tests -------------------------------------------------------------------------- +ConfigureTest(K_TRUSS_TEST community/k_truss_test.cpp) + ################################################################################################### # - Triangle Count tests -------------------------------------------------------------------------- ConfigureTest(TRIANGLE_COUNT_TEST community/triangle_count_test.cpp) @@ -550,10 +554,6 @@ if(BUILD_CUGRAPH_MG_TESTS) # - MG TRIANGLE COUNT tests ------------------------------------------------------------------- ConfigureTestMG(MG_TRIANGLE_COUNT_TEST community/mg_triangle_count_test.cpp) - ############################################################################################### - # - Ktruss tests -------------------------------------------------------------------------- - ConfigureTest(KTRUSS_TEST community/ktruss_test.cpp) - ############################################################################################### # - MG INDUCED SUBGRAPH tests ----------------------------------------------------------------- ConfigureTestMG(MG_INDUCED_SUBGRAPH_TEST structure/mg_induced_subgraph_test.cu) diff --git a/cpp/tests/community/ktruss_test.cpp b/cpp/tests/community/k_truss_test.cpp similarity index 86% rename from cpp/tests/community/ktruss_test.cpp rename to cpp/tests/community/k_truss_test.cpp index 51d7f949f4c..4559572e617 100644 --- a/cpp/tests/community/ktruss_test.cpp +++ b/cpp/tests/community/k_truss_test.cpp @@ -40,16 +40,16 @@ #include -struct Ktruss_Usecase { +struct KTruss_Usecase { int32_t k{10}; bool check_correctness{true}; }; template -class Tests_Ktruss - : public ::testing::TestWithParam> { +class Tests_KTruss + : public ::testing::TestWithParam> { public: - Tests_Ktruss() {} + Tests_KTruss() {} static void SetUpTestCase() {} static void TearDownTestCase() {} @@ -59,13 +59,13 @@ class Tests_Ktruss template void run_current_test( - std::tuple const& param) + std::tuple const& param) { constexpr bool renumber = false; using weight_t = float; - auto [ktruss_usecase, input_usecase] = param; + auto [k_truss_usecase, input_usecase] = param; raft::handle_t handle{}; HighResTimer hr_timer{}; @@ -91,13 +91,13 @@ class Tests_Ktruss if (cugraph::test::g_perf) { RAFT_CUDA_TRY(cudaDeviceSynchronize()); // for consistent performance measurement - hr_timer.start("Ktruss"); + hr_timer.start("K-truss"); } - cugraph::ktruss( + cugraph::k_truss( handle, graph_view, - ktruss_usecase.k, + k_truss_usecase.k, false); if (cugraph::test::g_perf) { @@ -109,10 +109,10 @@ class Tests_Ktruss } }; -using Tests_Ktruss_File = Tests_Ktruss; +using Tests_KTruss_File = Tests_KTruss; // FIXME: add tests for type combinations -TEST_P(Tests_Ktruss_File, CheckInt32Int32) +TEST_P(Tests_KTruss_File, CheckInt32Int32) { run_current_test(override_File_Usecase_with_cmd_line_arguments(GetParam())); } @@ -120,10 +120,10 @@ TEST_P(Tests_Ktruss_File, CheckInt32Int32) INSTANTIATE_TEST_SUITE_P( file_test, - Tests_Ktruss_File, + Tests_KTruss_File, ::testing::Combine( // enable correctness checks - ::testing::Values(Ktruss_Usecase{2}), + ::testing::Values(KTruss_Usecase{2}), ::testing::Values(cugraph::test::File_Usecase("/home/nfs/jnke/debug_jaccard/cugraph/datasets/dummy.mtx")))); CUGRAPH_TEST_PROGRAM_MAIN()