NVIDIA Holoscan SDK v0.5.1
Holoscan v0.5.1

Class DeviceBuffer

class DeviceBuffer

Cuda Device Buffer Class.

Public Functions

explicit DeviceBuffer(holoinfer_datatype type = holoinfer_datatype::hFloat)

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 element_size)

Resize the underlying buffer.

Parameters

element_size – Size to be resized with

~DeviceBuffer()

Destructor.

© Copyright 2022-2023, NVIDIA. Last updated on Jul 28, 2023.