From e3399a2fb557bbdebe564c5bafe5195425236e66 Mon Sep 17 00:00:00 2001 From: Seunghwa Kang Date: Fri, 10 May 2019 12:17:22 -0700 Subject: [PATCH] incorporate a temporary solution till https://github.com/NVlabs/cub/issues/162 is fixed. --- cpp/src/cugraph.cu | 10 +++++++++- cpp/src/pagerank.cu | 8 ++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/cpp/src/cugraph.cu b/cpp/src/cugraph.cu index b80711df2f3..61d1ff2ece1 100644 --- a/cpp/src/cugraph.cu +++ b/cpp/src/cugraph.cu @@ -443,7 +443,11 @@ gdf_error gdf_pagerank_impl (gdf_graph *graph, cudaStream_t stream{nullptr}; ALLOC_TRY((void**)&d_leaf_vector, sizeof(WT) * m, stream); ALLOC_TRY((void**)&d_val, sizeof(WT) * nnz , stream); - ALLOC_TRY((void**)&d_pr, sizeof(WT) * m, stream); +#if 1/* temporary solution till https://github.com/NVlabs/cub/issues/162 is resolved */ + CUDA_TRY(cudaMalloc((void**)&d_pr, sizeof(WT) * m)); +#else + ALLOC_TRY((void**)&d_pr, sizeof(WT) * m, stream); +#endif // The templating for HT_matrix_csc_coo assumes that m, nnz and data are all the same type cugraph::HT_matrix_csc_coo(m, nnz, (int *)graph->transposedAdjList->offsets->data, (int *)graph->transposedAdjList->indices->data, d_val, d_leaf_vector); @@ -467,7 +471,11 @@ gdf_error gdf_pagerank_impl (gdf_graph *graph, cugraph::copy(m, d_pr, (WT*)pagerank->data); ALLOC_FREE_TRY(d_val, stream); +#if 1/* temporary solution till https://github.com/NVlabs/cub/issues/162 is resolved */ + CUDA_TRY(cudaFree(d_pr)); +#else ALLOC_FREE_TRY(d_pr, stream); +#endif ALLOC_FREE_TRY(d_leaf_vector, stream); return GDF_SUCCESS; diff --git a/cpp/src/pagerank.cu b/cpp/src/pagerank.cu index 2c08a970466..5d893f320e9 100644 --- a/cpp/src/pagerank.cu +++ b/cpp/src/pagerank.cu @@ -99,7 +99,11 @@ int pagerank(IndexType n, IndexType e, IndexType *cscPtr, IndexType *cscInd, Val cudaStream_t stream{nullptr}; ALLOC_TRY((void**)&b, sizeof(ValueType) * n, stream); +#if 1/* temporary solution till https://github.com/NVlabs/cub/issues/162 is resolved */ + CUDA_TRY(cudaMalloc((void**)&tmp, sizeof(ValueType) * n)); +#else ALLOC_TRY((void**)&tmp, sizeof(ValueType) * n, stream); +#endif cudaCheckError(); if (!has_guess) { @@ -149,7 +153,11 @@ int pagerank(IndexType n, IndexType e, IndexType *cscPtr, IndexType *cscInd, Val //printv(n,pagerank_vector,0); ALLOC_FREE_TRY(b, stream); +#if 1/* temporary solution till https://github.com/NVlabs/cub/issues/162 is resolved */ + CUDA_TRY(cudaFree(tmp)); +#else ALLOC_FREE_TRY(tmp, stream); +#endif ALLOC_FREE_TRY(cub_d_temp_storage, stream); return converged ? 0 : 1;