Class VectorBuffer

Inheritance Relationships

Base Type

Class Documentation

class VectorBuffer : public amdinfer::Buffer

VectorBuffer uses vectors for storing data.

Public Functions

VectorBuffer(int elements, DataType data_type)

Construct a new Vector Buffer object.

Parameters
  • elements – number of elements to store

  • data_type – type of element to store

virtual void *data(size_t offset) override

Returns a pointer to the underlying data. Vectors guarantee that it is contiguous.

Returns

void*

virtual void reset() override

Reset the internal write_counter_ prior to returning the buffer to a pool.

Public Static Functions

static void allocate(BufferPtrsQueue *my_buffer, size_t num, size_t elements, DataType data_type)

Allocate VectorBuffers in the given BufferPtrsQueue.

Parameters
  • my_buffer – a queue of Buffer pointers

  • num – number of VectorBuffers to allocate

  • elements – number of elements per VectorBuffer

  • data_type – data type of the VectorBuffer (used for sizing)