What can I help you with?
NVIDIA Holoscan SDK v3.1.0

Class DeviceBuffer

Base Type

class DeviceBuffer : public holoscan::inference::Buffer

Cuda Device Buffer Class.

Unnamed Group

virtual void *data() override

Buffer class virtual members implemented by this class

virtual size_t size() const override

Get the size of the allocated buffer in elements.

Returns

size in elements

virtual size_t get_bytes() const override

Get the bytes allocated.

Returns

allocated bytes

virtual void resize(size_t number_of_elements) override

Resize the underlying buffer, this is a no-op if the buffer is already large enough.

Parameters

number_of_elements – Number of elements to be resized with

Public Functions

explicit DeviceBuffer(holoinfer_datatype type = holoinfer_datatype::h_Float32, int device_id = 0)

Construction with default type.

Parameters
  • type – Data type, defaults to float32

  • device_id – GPU device ID, defaults to 0

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

~DeviceBuffer()

Destructor.

Previous Class DeviceAllocator
Next Class DeviceFree
© Copyright 2022-2025, NVIDIA. Last updated on Apr 30, 2025.