Skip to content

Class muda::DeviceBuffer

template <typename T>

ClassList > muda > DeviceBuffer

A std::vector like wrapper of cuda device memory, allows user to:More...

  • #include <device_buffer.h>

Public Types

Type Name
typedef T value_type

Public Functions

Type Name
DeviceBuffer (size_t n)
DeviceBuffer ()
DeviceBuffer (const DeviceBuffer< T > & other)
DeviceBuffer (DeviceBuffer && other)
DeviceBuffer (CBufferView< T > other)
DeviceBuffer (const std::vector< T > & host)
auto capacity () const
void clear ()
void copy_from (const std::vector< T > & host)
void copy_to (std::vector< T > & host) const
CDense1D< T > cviewer () const
T * data ()
const T * data () const
void fill (const T & v)
operator BufferView< T > ()
operator CBufferView< T > () const
DeviceBuffer & operator= (const DeviceBuffer< T > & other)
DeviceBuffer & operator= (DeviceBuffer< T > && other)
DeviceBuffer & operator= (CBufferView< T > other)
DeviceBuffer & operator= (const std::vector< T > & other)
void reserve (size_t new_capacity)
void resize (size_t new_size)
void resize (size_t new_size, const T & value)
void shrink_to_fit ()
auto size () const
BufferView< T > view (size_t offset, size_t size=~0)
BufferView< T > view ()
CBufferView< T > view (size_t offset, size_t size=~0) const
CBufferView< T > view () const
Dense1D< T > viewer ()
~DeviceBuffer ()

Detailed Description

  • resize
  • reserve
  • clear
  • fill
  • shrink_to_fit
  • make view or subview from it
  • make a safe viewer from it

See also:

Public Types Documentation

typedef value_type

using muda::DeviceBuffer< T >::value_type =  T;

Public Functions Documentation

function DeviceBuffer [1/6]

muda::DeviceBuffer::DeviceBuffer (
    size_t n
) 

function DeviceBuffer [2/6]

muda::DeviceBuffer::DeviceBuffer () 

function DeviceBuffer [3/6]

muda::DeviceBuffer::DeviceBuffer (
    const DeviceBuffer < T > & other
) 

function DeviceBuffer [4/6]

muda::DeviceBuffer::DeviceBuffer (
    DeviceBuffer && other
) 

function DeviceBuffer [5/6]

muda::DeviceBuffer::DeviceBuffer (
    CBufferView < T > other
) 

function DeviceBuffer [6/6]

muda::DeviceBuffer::DeviceBuffer (
    const std::vector< T > & host
) 

function capacity

inline auto muda::DeviceBuffer::capacity () const

function clear

void muda::DeviceBuffer::clear () 

function copy_from

void muda::DeviceBuffer::copy_from (
    const std::vector< T > & host
) 

function copy_to

void muda::DeviceBuffer::copy_to (
    std::vector< T > & host
) const

function cviewer

CDense1D < T > muda::DeviceBuffer::cviewer () const

function data [1/2]

inline T * muda::DeviceBuffer::data () 

function data [2/2]

inline const T * muda::DeviceBuffer::data () const

function fill

void muda::DeviceBuffer::fill (
    const T & v
) 

function operator BufferView< T >

inline muda::DeviceBuffer::operator BufferView< T > () 

function operator CBufferView< T >

inline muda::DeviceBuffer::operator CBufferView< T > () const

function operator=

DeviceBuffer & muda::DeviceBuffer::operator= (
    const DeviceBuffer < T > & other
) 

function operator=

DeviceBuffer & muda::DeviceBuffer::operator= (
    DeviceBuffer < T > && other
) 

function operator=

DeviceBuffer & muda::DeviceBuffer::operator= (
    CBufferView < T > other
) 

function operator=

DeviceBuffer & muda::DeviceBuffer::operator= (
    const std::vector< T > & other
) 

function reserve

void muda::DeviceBuffer::reserve (
    size_t new_capacity
) 

function resize [1/2]

void muda::DeviceBuffer::resize (
    size_t new_size
) 

function resize [2/2]

void muda::DeviceBuffer::resize (
    size_t new_size,
    const T & value
) 

function shrink_to_fit

void muda::DeviceBuffer::shrink_to_fit () 

function size

inline auto muda::DeviceBuffer::size () const

function view [1/4]

BufferView < T > muda::DeviceBuffer::view (
    size_t offset,
    size_t size=~0
) 

function view [2/4]

BufferView < T > muda::DeviceBuffer::view () 

function view [3/4]

CBufferView < T > muda::DeviceBuffer::view (
    size_t offset,
    size_t size=~0
) const

function view [4/4]

CBufferView < T > muda::DeviceBuffer::view () const

function viewer

Dense1D < T > muda::DeviceBuffer::viewer () 

function ~DeviceBuffer

muda::DeviceBuffer::~DeviceBuffer () 


The documentation for this class was generated from the following file src/muda/buffer/device_buffer.h