For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • Introduction
    • Overview
    • Relevant Technologies
    • Getting Started
  • Setup
    • SDK Installation
    • Additional Setup
    • Third Party Hardware Setup
  • Using the SDK
    • Holoscan Core
    • GPU Resident Execution
    • Holoscan by Example
    • Create an Application
    • Create a Distributed Application
    • Create an Operator
    • Create an Operator via Decorator
    • Create a Condition
    • Dynamic Flow Control
    • CUDA Stream Handling
    • Logging
    • Data Logging
    • Debugging
    • Python Operator Bindings
  • Operators
    • Operators and Extensions
    • Visualization
    • Inference
    • Testing
    • Video I/O Vendor Implementation Guide
  • Components
    • Schedulers
    • Conditions
    • Resources
    • Analytics
  • AI Skills
    • Ai Skills
  • API reference
                  • Buffer
                  • CudaAllocator
                  • CudaFree
                  • CudaHostFree
                  • CudaHostMappedAllocator
                  • CudaHostMappedBuffer
                  • DeviceBuffer
  • Performance
    • Performance Considerations
    • Flow Tracking
    • GXF Job Statistics
    • Nsight Profiling
  • HoloHub
    • HoloHub Overview
  • FAQ
    • FAQ
NVIDIANVIDIA
Developer-friendly docs for your API
Privacy Policy | Your Privacy Choices | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact

Copyright © 2026, NVIDIA Corporation.

LogoLogoDocumentation
On this page
  • Constructors
  • DeviceBuffer
  • Destructor
  • ~DeviceBuffer
  • Assignment operators
  • operator=
  • Methods
  • data
  • size
  • get_bytes
  • resize
  • host_data
  • get_datatype
  • get_device
  • Member variables
API referenceC++ APIHoloscanNamespacesUtilsNamespacesCudaClasses

holoscan::utils::cuda::DeviceBuffer

Beta
||View as Markdown|
Previous

holoscan::utils::cuda::CudaHostMappedBuffer

Next

holoscan::utils::cuda::BufferDataType

CUDA Device Buffer Class.

#include <holoscan/utils/cuda/buffer.hpp>

Inherits from: holoscan::utils::cuda::Buffer (public)


Constructors

DeviceBuffer

Construction with size
Deleted overloads
holoscan::utils::cuda::DeviceBuffer::DeviceBuffer(holoscan::utils::cuda::DeviceBuffer::DeviceBuffer(
size_t size,
int device_id = 0
)

Construction with size.

Parameters

size
size_t

Memory size to be allocated in bytes

device_id
intDefaults to 0

GPU device ID, defaults to 0

Destructor

~DeviceBuffer

holoscan::utils::cuda::DeviceBuffer::~DeviceBuffer()holoscan::utils::cuda::DeviceBuffer::~DeviceBuffer()

Destructor.


Assignment operators

operator=

Deleted overloads

The following overloads are deleted to prevent misuse:

DeviceBuffer & holoscan::utils::cuda::DeviceBuffer::operator=(const DeviceBuffer &) = delete;DeviceBuffer & holoscan::utils::cuda::DeviceBuffer::operator=(const DeviceBuffer &) = delete;DeviceBuffer & holoscan::utils::cuda::DeviceBuffer::operator=(const DeviceBuffer &) = delete;
DeviceBuffer & holoscan::utils::cuda::DeviceBuffer::operator=(DeviceBuffer &&) = delete;DeviceBuffer & holoscan::utils::cuda::DeviceBuffer::operator=(DeviceBuffer &&) = delete;DeviceBuffer & holoscan::utils::cuda::DeviceBuffer::operator=(DeviceBuffer &&) = delete;

Methods

data

void * holoscan::utils::cuda::DeviceBuffer::data() override

Buffer class virtual members implemented by this class.

size

size_t holoscan::utils::cuda::DeviceBuffer::size() const override

Get the size of the allocated buffer in elements.

Returns: size in elements

get_bytes

size_t holoscan::utils::cuda::DeviceBuffer::get_bytes() const override

Get the bytes allocated.

Returns: allocated bytes

resize

void holoscan::utils::cuda::DeviceBuffer::resize(
size_t number_of_elements
) override

Resize the underlying buffer.

Parameters

number_of_elements
size_t

Number of elements to be resized with

host_data

void * holoscan::utils::cuda::DeviceBuffer::host_data(
cudaStream_t stream = 0
)

Copies data from device to host after allocating the host memory.

get_datatype

BufferDataType holoscan::utils::cuda::DeviceBuffer::get_datatype() constBufferDataType holoscan::utils::cuda::DeviceBuffer::get_datatype() const

Get the datatype.

Returns: datatype

get_device

int holoscan::utils::cuda::DeviceBuffer::get_device() const

Get the device ID.

Returns: device ID


Member variables

NameTypeDescription
size_size_t
capacity_size_t
buffer_void *
host_buffer_void *
allocator_CudaAllocator
free_CudaFree
data_type_BufferDataTypeDatatype of the elements in the buffer.
device_id_intDevice ID.