diff --git a/CHANGELOG.md b/CHANGELOG.md index 54ebe43d92..8ac973ba44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,12 @@ # RAFT 0.16.0 (Date TBD) +## New Features + ## Improvements - PR #59: Adding csrgemm2 to cusparse_wrappers.h +## Bug Fixes +- PR #56: Fix compiler warnings. # RAFT 0.15.0 (Date TBD) diff --git a/cpp/include/raft/mr/buffer_base.hpp b/cpp/include/raft/mr/buffer_base.hpp index f1d74d4b24..9c8c5b2a76 100644 --- a/cpp/include/raft/mr/buffer_base.hpp +++ b/cpp/include/raft/mr/buffer_base.hpp @@ -57,9 +57,9 @@ class buffer_base { */ buffer_base(std::shared_ptr allocator, cudaStream_t stream, size_type n = 0) - : size_(n), + : data_(nullptr), + size_(n), capacity_(n), - data_(nullptr), stream_(stream), allocator_(std::move(allocator)) { if (capacity_ > 0) { diff --git a/cpp/include/raft/mr/device/allocator.hpp b/cpp/include/raft/mr/device/allocator.hpp index be6ea6fc67..eabf5c28e2 100644 --- a/cpp/include/raft/mr/device/allocator.hpp +++ b/cpp/include/raft/mr/device/allocator.hpp @@ -17,7 +17,7 @@ #pragma once #include -#include +#include namespace raft { namespace mr { @@ -37,12 +37,12 @@ class allocator : public base_allocator {}; class default_allocator : public allocator { public: void* allocate(std::size_t n, cudaStream_t stream) override { - void* ptr = rmm::mr::get_default_resource()->allocate(n, stream); + void* ptr = rmm::mr::get_current_device_resource()->allocate(n, stream); return ptr; } void deallocate(void* p, std::size_t n, cudaStream_t stream) override { - rmm::mr::get_default_resource()->deallocate(p, n, stream); + rmm::mr::get_current_device_resource()->deallocate(p, n, stream); } }; // class default_allocator diff --git a/cpp/include/raft/sparse/cusparse_wrappers.h b/cpp/include/raft/sparse/cusparse_wrappers.h index 2e350176e6..3a113d785c 100644 --- a/cpp/include/raft/sparse/cusparse_wrappers.h +++ b/cpp/include/raft/sparse/cusparse_wrappers.h @@ -124,16 +124,22 @@ inline cusparseStatus_t cusparsegthr(cusparseHandle_t handle, int nnz, const double* vals, double* vals_sorted, int* d_P, cudaStream_t stream) { CUSPARSE_CHECK(cusparseSetStream(handle, stream)); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" return cusparseDgthr(handle, nnz, vals, vals_sorted, d_P, CUSPARSE_INDEX_BASE_ZERO); +#pragma GCC diagnostic pop } template <> inline cusparseStatus_t cusparsegthr(cusparseHandle_t handle, int nnz, const float* vals, float* vals_sorted, int* d_P, cudaStream_t stream) { CUSPARSE_CHECK(cusparseSetStream(handle, stream)); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" return cusparseSgthr(handle, nnz, vals, vals_sorted, d_P, CUSPARSE_INDEX_BASE_ZERO); +#pragma GCC diagnostic pop } /** @} */ @@ -205,8 +211,11 @@ inline cusparseStatus_t cusparsegemmi(cusparseHandle_t handle, int m, int n, const int* cscRowIndB, const float* beta, float* C, int ldc, cudaStream_t stream) { CUSPARSE_CHECK(cusparseSetStream(handle, stream)); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" return cusparseSgemmi(handle, m, n, k, nnz, alpha, A, lda, cscValB, cscColPtrB, cscRowIndB, beta, C, ldc); +#pragma GCC diagnostic pop } template <> inline cusparseStatus_t cusparsegemmi(cusparseHandle_t handle, int m, int n, @@ -217,8 +226,11 @@ inline cusparseStatus_t cusparsegemmi(cusparseHandle_t handle, int m, int n, const int* cscRowIndB, const double* beta, double* C, int ldc, cudaStream_t stream) { CUSPARSE_CHECK(cusparseSetStream(handle, stream)); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" return cusparseDgemmi(handle, m, n, k, nnz, alpha, A, lda, cscValB, cscColPtrB, cscRowIndB, beta, C, ldc); +#pragma GCC diagnostic pop } /** @} */ @@ -689,11 +701,14 @@ inline cusparseStatus_t cusparsecsrgemm2_buffersizeext( const int* indicesD, csrgemm2Info_t info, size_t* pBufferSizeInBytes, cudaStream_t stream) { CUSPARSE_CHECK(cusparseSetStream(handle, stream)); - +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" return cusparseScsrgemm2_bufferSizeExt( handle, m, n, k, alpha, matA, nnzA, rowindA, indicesA, matB, nnzB, rowindB, indicesB, beta, matD, nnzD, rowindD, indicesD, info, pBufferSizeInBytes); +#pragma GCC diagnostic pop } + template <> inline cusparseStatus_t cusparsecsrgemm2_buffersizeext( cusparseHandle_t handle, int m, int n, int k, const double* alpha, @@ -704,9 +719,12 @@ inline cusparseStatus_t cusparsecsrgemm2_buffersizeext( const int* indicesD, csrgemm2Info_t info, size_t* pBufferSizeInBytes, cudaStream_t stream) { CUSPARSE_CHECK(cusparseSetStream(handle, stream)); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" return cusparseDcsrgemm2_bufferSizeExt( handle, m, n, k, alpha, matA, nnzA, rowindA, indicesA, matB, nnzB, rowindB, indicesB, beta, matD, nnzD, rowindD, indicesD, info, pBufferSizeInBytes); +#pragma GCC diagnostic pop } inline cusparseStatus_t cusparsecsrgemm2nnz( @@ -718,11 +736,13 @@ inline cusparseStatus_t cusparsecsrgemm2nnz( int* rowindC, int* nnzC, const csrgemm2Info_t info, void* pBuffer, cudaStream_t stream) { CUSPARSE_CHECK(cusparseSetStream(handle, stream)); - +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" return cusparseXcsrgemm2Nnz(handle, m, n, k, matA, nnzA, rowindA, indicesA, matB, nnzB, rowindB, indicesB, matD, nnzD, rowindD, indicesD, matC, rowindC, nnzC, info, pBuffer); +#pragma GCC diagnostic pop } template @@ -748,12 +768,14 @@ inline cusparseStatus_t cusparsecsrgemm2( int* csrColIndC, const csrgemm2Info_t info, void* pBuffer, cudaStream_t stream) { CUSPARSE_CHECK(cusparseSetStream(handle, stream)); - +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" return cusparseScsrgemm2(handle, m, n, k, alpha, descrA, nnzA, csrValA, csrRowPtrA, csrColIndA, descrB, nnzB, csrValB, csrRowPtrB, csrColIndB, beta, descrD, nnzD, csrValD, csrRowPtrD, csrColIndD, descrC, csrValC, csrRowPtrC, csrColIndC, info, pBuffer); +#pragma GCC diagnostic pop } template <> @@ -768,11 +790,14 @@ inline cusparseStatus_t cusparsecsrgemm2( int* csrColIndC, const csrgemm2Info_t info, void* pBuffer, cudaStream_t stream) { CUSPARSE_CHECK(cusparseSetStream(handle, stream)); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" return cusparseDcsrgemm2(handle, m, n, k, alpha, descrA, nnzA, csrValA, csrRowPtrA, csrColIndA, descrB, nnzB, csrValB, csrRowPtrB, csrColIndB, beta, descrD, nnzD, csrValD, csrRowPtrD, csrColIndD, descrC, csrValC, csrRowPtrC, csrColIndC, info, pBuffer); +#pragma GCC diagnostic pop } /** @} */