holoscan::FastDdsNativeBufferAdapter

Beta
View as Markdown

Fast-DDS native-buffer adapter: thin wrapper that creates ipc::Context<FastDdsTransport>.

#include <holoscan/fastdds_native_buffer_adapter.hpp>

Inherits from: holoscan::HoloIpcCudaNativeBufferAdapterBase< ipc::transport::fastdds::FastDdsTransport > (public)


Constructors

FastDdsNativeBufferAdapter

holoscan::FastDdsNativeBufferAdapter::FastDdsNativeBufferAdapter()holoscan::FastDdsNativeBufferAdapter::FastDdsNativeBufferAdapter()

Methods

initialize

nvidia::gxf::Expected<void> holoscan::FastDdsNativeBufferAdapter::initialize(
eprosima::fastdds::dds::DomainParticipant *participant,
nvidia::gxf::NativeBufferPolicy policy
)

Initialize with the DomainParticipant from FastDdsPubSubContext.

The participant is retained indirectly through the holoipc Fast-DDS transport and must outlive this adapter (including its shutdown). When policy is NativeBufferPolicy::kDisabled, participant is ignored and may be null.

This method is idempotent: repeated calls after a successful initialization are no-ops that log a warning and return success, keeping the original policy and context.

shutdown

void holoscan::HoloIpcCudaNativeBufferAdapterBase<ipc::transport::fastdds::FastDdsTransport>::shutdown()

is_initialized

bool holoscan::HoloIpcCudaNativeBufferAdapterBase<ipc::transport::fastdds::FastDdsTransport>::is_initialized() const override

policy

nvidia::gxf::NativeBufferPolicy holoscan::HoloIpcCudaNativeBufferAdapterBase<ipc::transport::fastdds::FastDdsTransport>::policy() const

set_acquire_timeout

void holoscan::HoloIpcCudaNativeBufferAdapterBase<ipc::transport::fastdds::FastDdsTransport>::set_acquire_timeout(
std::chrono::milliseconds timeout
)

set_export_ttl

void holoscan::HoloIpcCudaNativeBufferAdapterBase<ipc::transport::fastdds::FastDdsTransport>::set_export_ttl(
std::chrono::milliseconds ttl
)

set_use_eager_acquire

void holoscan::HoloIpcCudaNativeBufferAdapterBase<ipc::transport::fastdds::FastDdsTransport>::set_use_eager_acquire(
bool enabled
)

default_protocol_name

const std::string & holoscan::HoloIpcCudaNativeBufferAdapterBase<ipc::transport::fastdds::FastDdsTransport>::default_protocol_name() const override

supports_protocol

bool holoscan::HoloIpcCudaNativeBufferAdapterBase<ipc::transport::fastdds::FastDdsTransport>::supports_protocol(
const std::string &protocol_name
) const override

can_export_tensor

bool holoscan::HoloIpcCudaNativeBufferAdapterBase<ipc::transport::fastdds::FastDdsTransport>::can_export_tensor(
const nvidia::gxf::Tensor &tensor
) const override

descriptor_format_version

uint8_t holoscan::HoloIpcCudaNativeBufferAdapterBase<ipc::transport::fastdds::FastDdsTransport>::descriptor_format_version() const override

export_tensor

nvidia::gxf::Expected<std::vector<uint8_t>> holoscan::HoloIpcCudaNativeBufferAdapterBase<ipc::transport::fastdds::FastDdsTransport>::export_tensor(
void *device_ptr,
const std::shared_ptr<void> &device_ptr_owner,
const NativeTensorMetadata &tensor_info,
const std::string &protocol_name,
uint32_t sequence_num
) override

NativeBufferProtocolAdapter interface: converts NativeTensorMetadata to CudaTensorDescriptor and delegates to the CudaTensorDescriptor overload.

import_tensor_generic

nvidia::gxf::Expected<ImportedNativeTensor> holoscan::HoloIpcCudaNativeBufferAdapterBase<ipc::transport::fastdds::FastDdsTransport>::import_tensor_generic(nvidia::gxf::Expected<ImportedNativeTensor> holoscan::HoloIpcCudaNativeBufferAdapterBase<ipc::transport::fastdds::FastDdsTransport>::import_tensor_generic(
const std::vector<uint8_t> &descriptor_bytes,
const std::string &protocol_name,
std::chrono::milliseconds timeout = std::chrono::milliseconds{0}
) override

NativeBufferProtocolAdapter interface: delegates to import_tensor() and converts the NativeBufferHolder into a generic ImportedNativeTensor.

import_tensor

nvidia::gxf::Expected<NativeBufferHolder> holoscan::HoloIpcCudaNativeBufferAdapterBase<ipc::transport::fastdds::FastDdsTransport>::import_tensor(
const std::vector<uint8_t> &descriptor_bytes,
std::chrono::milliseconds timeout = std::chrono::milliseconds{0}
)

Decode a DNBX payload and acquire the CUDA IPC mapping via holoipc.

In strict mode (default): sends ACQUIRED, waits for ACK, then opens handle. In eager mode: opens handle locally first, then sends ACQUIRED (no ACK wait). Returns an RAII NativeBufferHolder whose destruction sends RELEASED.

pending_export_count

size_t holoscan::HoloIpcCudaNativeBufferAdapterBase<ipc::transport::fastdds::FastDdsTransport>::pending_export_count() const override

set_on_pending_export_count_changed

void holoscan::HoloIpcCudaNativeBufferAdapterBase<ipc::transport::fastdds::FastDdsTransport>::set_on_pending_export_count_changed(
PendingExportCountChangedCallback callback
) override

evict_stale_exports

size_t holoscan::HoloIpcCudaNativeBufferAdapterBase<ipc::transport::fastdds::FastDdsTransport>::evict_stale_exports(
std::chrono::milliseconds max_age
)

initialize_common

nvidia::gxf::Expected<void> holoscan::HoloIpcCudaNativeBufferAdapterBase<ipc::transport::fastdds::FastDdsTransport>::initialize_common(
std::shared_ptr<IpcContextType> ipc_context,
nvidia::gxf::NativeBufferPolicy policy
)

Called by derived-class initialize() after creating the ipc::Context.


Static methods

decode_exported_tensor

static nvidia::gxf::Expected<ExportedTensorDescriptor> holoscan::HoloIpcCudaNativeBufferAdapterBase<ipc::transport::fastdds::FastDdsTransport>::decode_exported_tensor(
const std::vector<uint8_t> &descriptor_bytes
)

Parse DNBX wire format back into ExportedTensorDescriptor.

Wire layout: magic | version | handle_type | ipc_version | hipc_blob | key | reply_topic


Types

Typedefs

NameDefinition
IpcContextTypeipc::Context< ipc::transport::fastdds::FastDdsTransport >
PointerDescriptorTypetypename IpcContextType::PointerDescriptorType
HandleTypetypename IpcContextType::HandleType
PendingExportCountChangedCallbackstd::function< void(size_t)>

Member variables

NameTypeDescription
adapter_name_std::string