Skip to content

Commit

Permalink
Fix compilation issue (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Yang authored Jun 30, 2020
1 parent 309a851 commit a4f4d7e
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions graphblas/backend/cuda/reduce.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,40 +154,6 @@ Info reduceInner(T* val,
return GrB_SUCCESS;
}

// Sparse matrix variant
template <typename T, typename a,
typename BinaryOpT, typename MonoidT>
Info reduceInner(T* val,
BinaryOpT accum,
MonoidT op,
const SparseMatrix<a>* A,
Descriptor* desc) {
if (desc->struconly()) {
*val = A->nvals_;
} else {
T* d_val = reinterpret_cast<T*>(desc->d_buffer_);
desc->resize(sizeof(T), "buffer");
size_t temp_storage_bytes = 0;

if (A->nvals_ == 0)
return GrB_INVALID_OBJECT;

if (!desc->split())
CUDA_CALL(cub::DeviceReduce::Reduce(NULL, temp_storage_bytes,
A->d_csrVal_, d_val, A->nvals_, op, op.identity()));
else
temp_storage_bytes = desc->d_temp_size_;

desc->resize(temp_storage_bytes, "temp");
CUDA_CALL(cub::DeviceReduce::Reduce(desc->d_temp_, temp_storage_bytes,
A->d_csrVal_, d_val, A->nvals_, op, op.identity()));

CUDA_CALL(cudaMemcpy(val, d_val, sizeof(T), cudaMemcpyDeviceToHost));
}

return GrB_SUCCESS;
}

} // namespace backend
} // namespace graphblas

Expand Down

0 comments on commit a4f4d7e

Please sign in to comment.