cpp/include/raft/mr/buffer_base.hpp
buffer_base(std::shared_ptr<AllocatorT> allocator, cudaStream_t stream, size_type n = 0)
    : data_(nullptr), size_(n), capacity_(n), stream_(stream), allocator_(std::move(allocator))
  {
    if (capacity_ > 0) {
      data_ =
        static_cast<value_type*>(allocator_->allocate(capacity_ * sizeof(value_type), stream_));
      RAFT_CUDA_TRY(cudaStreamSynchronize(stream_));
    }
  }
/**
   * @brief Main ctor
   *
   * @param[in] allocator asynchronous allocator used for managing buffer life
   * @param[in] stream    cuda stream where this allocation operations are async
   * @param[in] n         size of the buffer (in number of elements)
   */
@brief Main ctor
@param[in] allocator asynchronous allocator used for managing buffer life
@param[in] stream    cuda stream where this allocation operations are async
@param[in] n         size of the buffer (in number of elements)
@brief Main ctor @param [ in ] allocator asynchronous allocator used for managing buffer life @param [ in ] stream cuda stream where this allocation operations are async @param [ in ] n size of the buffer ( in number of elements )
buffer_base(std::shared_ptr<AllocatorT> allocator, cudaStream_t stream, size_type n = 0)
    : data_(nullptr), size_(n), capacity_(n), stream_(stream), allocator_(std::move(allocator))
  {
    if (capacity_ > 0) {
      data_ =
        static_cast<value_type*>(allocator_->allocate(capacity_ * sizeof(value_type), stream_));
      RAFT_CUDA_TRY(cudaStreamSynchronize(stream_));
    }
  }
buffer_base ( std :: shared_ptr < AllocatorT > allocator , cudaStream_t stream , size_type n = 0 ) : data_ ( nullptr ) , size_ ( n ) , capacity_ ( n ) , stream_ ( stream ) , allocator_ ( std :: move ( allocator ) ) { if ( capacity_ > 0 ) { data_ = static_cast < value_type * > ( allocator_ -> allocate ( capacity_ * sizeof ( value_type ) , stream_ ) ) ; RAFT_CUDA_TRY ( cudaStreamSynchronize ( stream_ ) ) ; } }
@brief Main ctor
 @param[in] allocator asynchronous allocator used for managing buffer life
 @param[in] stream    cuda stream where this allocation operations are async
 @param[in] n         size of the buffer (in number of elements)
@brief Main ctor @param [ in ] allocator asynchronous allocator used for managing buffer life @param [ in ] stream cuda stream where this allocation operations are async @param [ in ] n size of the buffer ( in number of elements )