Skip to navigation

holoscan::TensorSchemaOutputLoan

Beta
View as Markdown
template <typename SchemaT>

Hold one atomic set of unpublished provider-backed Tensor field allocations.

The bundle is move-constructible but neither copyable nor assignable. Field write operations borrow the corresponding private loan without allowing individual authority to escape. Destruction abandons every still-live field as one unpublished transaction.

#include <holoscan/tensor_schema_output_loan.hpp>

Template parameters

SchemaT
typename

Owning descriptor-backed schema type.


Constructors

TensorSchemaOutputLoan

Transfer the complete unpublished field transaction.

Parameters

other
TensorSchemaOutputLoan &&

Bundle whose authority becomes moved-from.

Destructor

~TensorSchemaOutputLoan

holoscan::TensorSchemaOutputLoan<SchemaT>::~TensorSchemaOutputLoan() noexcept = default

Destroy the bundle and abandon any unpublished field allocations.


Assignment operators

operator=

The following overloads are deleted to prevent misuse:

TensorSchemaOutputLoan & holoscan::TensorSchemaOutputLoan< SchemaT >::operator=(const TensorSchemaOutputLoan &) = delete;
TensorSchemaOutputLoan & holoscan::TensorSchemaOutputLoan< SchemaT >::operator=(TensorSchemaOutputLoan &&) = delete;

Methods

size

std::size_t holoscan::TensorSchemaOutputLoan<SchemaT>::size() const noexcept

Return the number of fields in this transaction.

Returns: Static schema field count, or zero after the bundle has been moved from.

empty

bool holoscan::TensorSchemaOutputLoan<SchemaT>::empty() const noexcept

Return whether this bundle has no live field inventory.

Returns: true after move or for an invalid empty bundle.

shape

TensorShapeView holoscan::TensorSchemaOutputLoan<SchemaT>::shape(
TensorFieldSelector<SchemaT> field
) const noexcept

Return one field’s allocation shape.

Returns: Borrowed shape view, or an empty view when the selector is not in this bundle.

Parameters

field
TensorFieldSelector<SchemaT>

Generated selector for this schema.

memory_kind

MemoryKind holoscan::TensorSchemaOutputLoan<SchemaT>::memory_kind(
TensorFieldSelector<SchemaT> field
) const noexcept

Return one field’s concrete memory kind.

Returns: Planned memory kind, or kUnknown for an invalid selector.

Parameters

field
TensorFieldSelector<SchemaT>

Generated selector for this schema.

device_id

DeviceId holoscan::TensorSchemaOutputLoan<SchemaT>::device_id(
TensorFieldSelector<SchemaT> field
) const noexcept

Return one field’s resolved CUDA device.

Returns: Planned device, or an invalid identity for an invalid selector or host field.

Parameters

field
TensorFieldSelector<SchemaT>

Generated selector for this schema.

write_and_commit

template <typename Fill>
expected<void, Error> holoscan::TensorSchemaOutputLoan<SchemaT>::write_and_commit(
TensorFieldSelector<SchemaT> field,
::cuda::stream_ref producer_stream,
Fill &&fill
) &

Run one CUDA-stream-ordered field write and commit it.

Returns: Success, or a typed selector, state, callback, or commit error.

Template parameters

Fill
typename

Parameters

field
TensorFieldSelector<SchemaT>

Generated selector for this schema.

producer_stream
::cuda::stream_ref

Stream on which producer writes are ordered.

fill
Fill &&

Callback receiving the borrowed field write guard.

write_host_and_commit

template <typename Fill>
expected<void, Error> holoscan::TensorSchemaOutputLoan<SchemaT>::write_host_and_commit(
TensorFieldSelector<SchemaT> field,
Fill &&fill
) &

Run one host field write and commit it.

Returns: Success, or a typed selector, state, callback, or commit error.

Template parameters

Fill
typename

Parameters

field
TensorFieldSelector<SchemaT>

Generated selector for this schema.

fill
Fill &&

Callback receiving the borrowed field write guard.

write_all

template <typename... Writes>
expected<void, Error> holoscan::TensorSchemaOutputLoan<SchemaT>::write_all(
Writes &&... writes
) &

Preflight, run, and commit one callback for every Tensor field in this bundle.

Selector and inventory rejection occurs before write acquisition and leaves the bundle reusable. Once acquisition begins, an acquisition, callback, or commit failure abandons the transaction: acquired guards and eventual bundle destruction release its unpublished fields, and the bundle cannot be published or retried.

All selectors, placement kinds, and write phases are checked before the first callback. The operation performs no heap allocation or type-erased dispatch on the success path.

Returns: Success after every callback and commit, or the first selector, kind, state, callback, or commit error.

Throws: Any exception propagated by a fill callback. Active writes are abandoned during unwinding.

Template parameters

Writes
typename...

Typed host or device field-write entry types for this schema.

Parameters

writes
Writes &&...

Complete generated field inventory in callback execution order.

batch_write_field_error

static Error holoscan::TensorSchemaOutputLoan<SchemaT>::batch_write_field_error(
ErrorCode code,
std::string_view token,
TensorFieldSelector<SchemaT> field,
std::string_view detail = {}
)

loan_at

TensorOutputLoan * holoscan::TensorSchemaOutputLoan<SchemaT>::loan_at(
TensorFieldSelector<SchemaT> field
) noexcept

Member variables

NameTypeDescription
storage_detail::TensorSchemaLoanBundleStorage