Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug louvain reverted fix #1766

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 16 additions & 1 deletion cpp/src/community/louvain.cu
Expand Up @@ -28,6 +28,21 @@ namespace cugraph {

namespace detail {

template <typename vertex_t, typename edge_t, typename weight_t, bool multi_gpu>
void check_clustering(graph_view_t<vertex_t, edge_t, weight_t, false, multi_gpu> const& graph_view,
vertex_t* clustering)
{
if (graph_view.get_number_of_local_vertices() > 0)
CUGRAPH_EXPECTS(clustering != nullptr, "Invalid input argument: clustering is null");
}

template <typename vertex_t, typename edge_t, typename weight_t>
void check_clustering(legacy::GraphCSRView<vertex_t, edge_t, weight_t> const& graph_view,
vertex_t* clustering)
{
CUGRAPH_EXPECTS(clustering != nullptr, "Invalid input argument: clustering is null");
}

template <typename vertex_t, typename edge_t, typename weight_t>
std::pair<std::unique_ptr<Dendrogram<vertex_t>>, weight_t> louvain(
raft::handle_t const& handle,
Expand Down Expand Up @@ -127,7 +142,7 @@ std::pair<size_t, typename graph_view_t::weight_type> louvain(
using vertex_t = typename graph_view_t::vertex_type;
using weight_t = typename graph_view_t::weight_type;

CUGRAPH_EXPECTS(clustering != nullptr, "Invalid input argument: clustering is null");
detail::check_clustering(graph_view, clustering);

std::unique_ptr<Dendrogram<vertex_t>> dendrogram;
weight_t modularity;
Expand Down