Skip to navigation

holoscan::DeploymentBinding

Beta
View as MarkdownOpen in Claude

Own cold deployment bindings supplied to Graph compilation.

The value deep-copies every string and placement. It contains no live scheduler, process, thread, transport, or backend handle. Compilation validates partition names, placement shape, and duplicates, then performs only read-only host capability probes. Probe results and any profile-permitted fallback become immutable plan evidence; compilation never applies affinity or scheduling state. Runtime consumes the accepted request and evidence when applying placement to executing threads.

#include <holoscan/compile.hpp>

Methods

bind_thread_placement

DeploymentBinding & holoscan::DeploymentBinding::bind_thread_placement(
std::string_view partition_name,
ThreadPlacement placement
)

Bind one manual execution partition to an exact placement request.

Compile rejects unknown names and duplicate authority with PARTITION_PLACEMENT_UNKNOWN_OR_DUPLICATE.

Returns: This binding for fluent cold-path authoring.

Throws: std::bad_alloc if owned storage allocation fails.

Parameters

partition_name
std::string_view

Exact authored partition name copied before return.

placement
ThreadPlacement

Placement request copied before return.

bind_support_thread_affinity

DeploymentBinding & holoscan::DeploymentBinding::bind_support_thread_affinity(
CPUAffinity affinity
)

Bind one Runtime-owned support-thread role to an allowed CPU set.

Compilation rejects unknown or duplicate roles. On Linux, the compiling thread’s current affinity proves permission for contained requests; CPUs outside that mask require read-only cgroup and online-CPU evidence. Unavailable, malformed or unsupported evidence fails closed. Runtime still applies and reads back the exact requested mask before dispatch. Neither this method nor compilation changes the calling thread’s affinity. A controller binding also constrains inline Operator callbacks hosted by that controller; separately worker-backed execution lanes without explicit partition affinity retain the controller thread’s pre-binding allowed CPU set.

Returns: This binding for fluent cold-path authoring.

Throws: std::bad_alloc if owned storage allocation fails.

Parameters

role
SupportThreadRole

Controller or optional process-local Channel pump.

affinity
CPUAffinity

Nonempty CPU set copied before return.

bind_cuda_green_context

DeploymentBinding & holoscan::DeploymentBinding::bind_cuda_green_context(
std::string_view partition_name,
)

Bind one manual execution partition to an exact CUDA Green Context placement.

Invalid devices, zero counts, unknown names, and duplicate authority are preserved for stable compile diagnostics. This call does not reserve CUDA resources.

Returns: This binding for fluent cold-path authoring.

Throws: std::bad_alloc if owned storage allocation fails.

Parameters

partition_name
std::string_view

Exact authored manual partition name copied before return.

placement
CudaGreenContextPlacement

Explicit target device and positive exact structured SM count.

allow_generated_endpoint_name

DeploymentBinding & holoscan::DeploymentBinding::allow_generated_endpoint_name(
)

Allow one exact versioned generated endpoint name.

Compile rejects invalid or conflicting duplicates; this call grants no wildcard or future-version authority.

Returns: This binding for fluent cold-path authoring.

Throws: std::bad_alloc if owned storage allocation fails.

Parameters

pin
GeneratedEndpointNamePin

Exact final name, algorithm identifier, and version.

bind_tensor_output_device

DeploymentBinding & holoscan::DeploymentBinding::bind_tensor_output_device(
)

Bind one exact Tensor output to a CUDA device.

This is deployment placement, not Tensor shape or allocation authorship. One Operator currently has one compute stream and therefore must resolve to at most one device across all of its Tensor obligations.

Returns: This binding for fluent cold-path authoring.

Throws: std::bad_alloc if owned storage allocation fails.

Parameters

placement
TensorOutputDevicePlacement

Stable output selector and explicit device ordinal; strings are copied before return.

bind_imported_topic_device

DeploymentBinding & holoscan::DeploymentBinding::bind_imported_topic_device(
)

Bind one imported external Tensor topic to a CUDA device.

Required for each imported topic whose Tensor or Tensor-bearing schema payload is MemoryKind::kCudaDevice, MemoryKind::kCudaManaged, or a copy-capable MemoryKind::kPinnedHost. Every device Tensor field must use a copy-capable transfer policy such as InterfaceTensorEmitPolicy::kCopyIfNeeded; a require-exportable CUDA Tensor has no staging pool to place and is rejected during compilation. This is deployment placement, not part of the topic contract. Compile rejects invalid placements with PHYSICAL_TENSOR_DEVICE_BINDING_INVALID.

Returns: This binding for fluent cold-path authoring.

Throws: std::bad_alloc if owned storage allocation fails.

Parameters

placement
ImportedTopicDevicePlacement

Imported-topic endpoint name and explicit device ordinal; the name is copied before return.

thread_placements

std::span<const PartitionThreadPlacementBinding> holoscan::DeploymentBinding::thread_placements() const noexcept

Return owned execution-partition placements in insertion order.

Returns: Immutable bindings valid until this value is mutated or destroyed.

support_thread_affinities

std::span<const SupportThreadAffinityBinding> holoscan::DeploymentBinding::support_thread_affinities() const noexcept

Return owned support-thread affinity bindings in insertion order.

Returns: Immutable bindings valid until this value is mutated or destroyed.

cuda_green_contexts

std::span<const PartitionCudaGreenContextBinding> holoscan::DeploymentBinding::cuda_green_contexts() const noexcept

Return owned manual-partition Green Context placements in insertion order.

Returns: Immutable bindings valid until this value is mutated or destroyed.

generated_endpoint_names

std::span<const GeneratedEndpointNamePinRecord> holoscan::DeploymentBinding::generated_endpoint_names() const noexcept

Return owned generated endpoint pins in insertion order.

Returns: Immutable pins valid until this value is mutated or destroyed.

imported_topic_devices

std::span<const ImportedTopicDevicePlacementRecord> holoscan::DeploymentBinding::imported_topic_devices() const noexcept

Return owned imported-topic device placements in insertion order.

Returns: Immutable placements valid until this value is mutated or destroyed.

tensor_output_devices

std::span<const TensorOutputDevicePlacementRecord> holoscan::DeploymentBinding::tensor_output_devices() const noexcept

Return owned Tensor output device placements in insertion order.

Returns: Immutable placements valid until this value is mutated or destroyed.


Member variables

NameTypeDescription
thread_placements_std::vector< PartitionThreadPlacementBinding >
support_thread_affinities_std::vector< SupportThreadAffinityBinding >
cuda_green_contexts_std::vector< PartitionCudaGreenContextBinding >
generated_endpoint_names_std::vector< GeneratedEndpointNamePinRecord >
tensor_output_devices_std::vector< TensorOutputDevicePlacementRecord >
imported_topic_devices_std::vector< ImportedTopicDevicePlacementRecord >