Function holoscan::utils::transmit_data_per_model(gxf_context_t&, const HoloInfer::MultiMappings&, HoloInfer::DataMap&, OutputContext&, std::vector&, HoloInfer::DimType&, bool, bool, const nvidia::gxf::Handle&, const std::string&, const cudaStream_t&, TensorTransmitCache&)
Defined in File holoinfer_utils.hpp
-
gxf_result_t holoscan::utils::transmit_data_per_model(gxf_context_t &cont, const HoloInfer::MultiMappings &model_to_tensor_map, HoloInfer::DataMap &input_data_map, OutputContext &op_output, std::vector<std::string> &out_tensors, HoloInfer::DimType &tensor_out_dims_map, bool cuda_buffer_in, bool cuda_buffer_out, const nvidia::gxf::Handle<nvidia::gxf::Allocator> &allocator_, const std::string &module, const cudaStream_t &cstream, TensorTransmitCache &cache)
Transmits multiple buffers via GXF Transmitters with persistent message caching.
Unlike the other overloads, this variant allocates the output GXF entity and inserts tensor components only once (on the first call). On subsequent calls the pre-allocated tensor buffers are reused and only the data is updated via memcpy / cudaMemcpyAsync. A tensor is reshaped (and its backing memory reallocated) only when the incoming buffer size exceeds the current allocation capacity. The persistent entity is emitted by reference-counted copy each frame rather than being moved, so the cache remains valid for the next call.
- Parameters
cont – GXF context for transmission
model_to_tensor_map – Map of model name as key, mapped to a vector of tensor names
input_data_map – Map of tensor name as key, mapped to the data buffer
op_output – Output context. Assumes the output port name is “transmitter”.
out_tensors – Output tensor names
tensor_out_dims_map – Map with model name as key mapped to output tensor dimensions
cuda_buffer_in – Whether input buffers reside on the GPU
cuda_buffer_out – Whether the output message should reside on the GPU
allocator_ – GXF Memory allocator
module – Module name used in error reporting
cstream – CUDA stream to use for async memory copies
cache – Persistent cache holding the reusable output entity and per-tensor allocation info
- Returns
GXF result code