holoscan::gxf::GXFOutputContext
holoscan::gxf::GXFOutputContext
Class to hold the output context for a GXF Operator.
This class provides the interface to send data to the output ports of the operator using GXF.
Inherits from: holoscan::OutputContext (public)
Constructors
GXFOutputContext
Construct a new GXFOutputContext object
Construct a new GXFOutputContext object (with outputs)
Construct a new GXFOutputContext object.
Parameters
The pointer to the execution context.
The pointer to the GXFOperator object.
Methods
gxf_context
Get pointer to the GXF execution runtime.
Returns: The pointer to the GXF context.
set_cuda_stream
Set a stream to be emitted on a given output port.
The actual creation of the stream component in the output message will occur on any subsequent emit calls on this output port, so the call to this function should occur prior to the emit call(s) for a given port.
Parameters
The CUDA stream
The name of the output port.
stream_to_emit
Get the CUDA stream to be emitted on the specified output port.
Returns: Optional CUDA stream configured for this output port.
Parameters
The name of the output port.
execution_context
Get pointer to the execution context.
Returns: The pointer to the execution context.
op
Return the operator that this context is associated with.
Returns: The pointer to the operator.
outputs
Return the reference to the map of the output specs.
Returns: The reference to the map of the output specs.
emit
Single item (1)
Single item (2)
Single item (3)
Single item (4)
Send message data (GXF Entity) to the output port with the given name.
This method is for interoperability with the GXF Codelet.
The object to be sent must be an object with holoscan::gxf::Entity type and the output port with the given name must exist.
If the operator has a single output port, the output port name can be omitted.
Example:
Template parameters
The type of the data to send. It should be holoscan::gxf::Entity.
Parameters
The entity object to send (holoscan::gxf::Entity).
The name of the output port.
The time when the message is acquired. For instance, this would generally be the timestamp of the camera when it captures an image.
Example
cuda_object_handler
Overload 1
Overload 2
Get the CUDA stream/event handler used by this input context.
This CudaObjectHandler class is designed primarily for internal use and is not guaranteed to have a stable API. Application authors should instead rely on the public set_cuda_stream method.
emit_impl
The implementation of the emit method.
Depending on the type of the data, this method wraps the data with a message and sends it to the output port with the given name.
Parameters
The data to send.
The name of the output port.
The type of the message data.
The timestamp to publish in the output message. The default value of -1 does not publish a timestamp.
If true, data will not be logged via the DataLogger interface.
If true, skip propagating CUDA stream to entity memory buffers. Used when the caller has already set the stream on tensors.
If true, the entity was just created (not forwarded), allowing optimizations like skipping checks for existing components.
gxf_cuda_object_handler
log_tensor
log_tensormap
populate_output_metadata
Types
OutputType
The output data type.