Class DeviceBuffer

class DeviceBuffer

Cuda Device Buffer Class.

Public Functions

explicit DeviceBuffer(holoinfer_datatype type = holoinfer_datatype::h_Float32)

Construction with default type.

Parameters

type – Data type, defaults to float32

DeviceBuffer(size_t size, holoinfer_datatype type)

Construction with type and size.

Parameters
  • size – memory size to be allocated

  • type – Data type to be allocated

void *data()

Get the data buffer.

Returns

Void pointer to the buffer

size_t size() const

Get the size of the allocated buffer.

Returns

size

size_t get_bytes() const

Get the bytes allocated.

Returns

allocated bytes

void resize(size_t number_of_elements)

Resize the underlying buffer.

Parameters

number_of_elements – Number of elements to be resized with

~DeviceBuffer()

Destructor.

© Copyright 2022-2023, NVIDIA. Last updated on Sep 13, 2023.