A container which may or may not own its own data on host or device. More...
#include <buffer.hpp>

Public Types | |
| using | index_type = std::size_t |
| using | value_type = T |
| using | data_store = std::variant< non_owning_buffer< device_type::cpu, T >, non_owning_buffer< device_type::gpu, T >, owning_buffer< device_type::cpu, T >, owning_buffer< device_type::gpu, T > > |
Public Member Functions | |
| buffer () | |
| buffer (index_type size, device_type mem_type=device_type::cpu, int device=0, cuda_stream stream=0) | |
| buffer (T *input_data, index_type size, device_type mem_type=device_type::cpu, int device=0) | |
| buffer (buffer< T > const &other, device_type mem_type, int device=0, cuda_stream stream=cuda_stream{}) | |
| Construct one buffer from another in the given memory location (either on host or on device) A buffer constructed in this way is owning and will copy the data from the original location. More... | |
| buffer (buffer< T > const &other, cuda_stream stream=cuda_stream{}) | |
| Create owning copy of existing buffer with given stream The memory type of this new buffer will be the same as the original. More... | |
| buffer< T > & | operator= (buffer< T > const &other) |
| buffer (buffer< T > &&other, device_type mem_type, int device, cuda_stream stream) | |
| Move from existing buffer unless a copy is necessary based on memory location. More... | |
| buffer (buffer< T > &&other, device_type mem_type, int device) | |
| buffer (buffer< T > &&other, device_type mem_type) | |
| buffer (buffer< T > &&other) noexcept | |
| buffer< T > & | operator= (buffer< T > &&other) noexcept |
| template<typename iter_t , typename = decltype(*std::declval<iter_t&>(), void(), ++std::declval<iter_t&>(), void())> | |
| buffer (iter_t const &begin, iter_t const &end) | |
| template<typename iter_t , typename = decltype(*std::declval<iter_t&>(), void(), ++std::declval<iter_t&>(), void())> | |
| buffer (iter_t const &begin, iter_t const &end, device_type mem_type) | |
| template<typename iter_t , typename = decltype(*std::declval<iter_t&>(), void(), ++std::declval<iter_t&>(), void())> | |
| buffer (iter_t const &begin, iter_t const &end, device_type mem_type, int device, cuda_stream stream=cuda_stream{}) | |
| auto | size () const noexcept |
| HOST DEVICE auto * | data () const noexcept |
| auto | memory_type () const noexcept |
| auto | device () const noexcept |
| auto | device_index () const noexcept |
| ~buffer ()=default | |
Friends | |
| void | swap (buffer< T > &first, buffer< T > &second) |
| Create owning copy of existing buffer The memory type of this new buffer will be the same as the original. More... | |
A container which may or may not own its own data on host or device.
| using raft_proto::buffer< T >::data_store = std::variant<non_owning_buffer<device_type::cpu, T>, non_owning_buffer<device_type::gpu, T>, owning_buffer<device_type::cpu, T>, owning_buffer<device_type::gpu, T> > |
| using raft_proto::buffer< T >::index_type = std::size_t |
| using raft_proto::buffer< T >::value_type = T |
|
inline |
|
inline |
Construct non-initialized owning buffer
|
inline |
Construct non-owning buffer
|
inline |
Construct one buffer from another in the given memory location (either on host or on device) A buffer constructed in this way is owning and will copy the data from the original location.
|
inline |
Create owning copy of existing buffer with given stream The memory type of this new buffer will be the same as the original.
|
inline |
Move from existing buffer unless a copy is necessary based on memory location.
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
default |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
Create owning copy of existing buffer The memory type of this new buffer will be the same as the original.