Class ExecutionContext
Defined in File execution_context.hpp
Derived Type
public holoscan::gxf::GXFExecutionContext(Class GXFExecutionContext)
- 
class ExecutionContext
 Class to hold the execution context.
This class provides the execution context for the operator.
Subclassed by holoscan::gxf::GXFExecutionContext
Public Functions
- 
ExecutionContext() = default
 Construct a new Execution Context object.
- 
virtual ~ExecutionContext() = default
 
- 
inline std::shared_ptr<InputContext> input() const
 Get the input context.
- Returns
 The shared pointer to the input context.
- 
inline std::shared_ptr<OutputContext> output() const
 Get the output context.
- Returns
 The shared pointer to the output context.
- 
inline void *context() const
 Get the context.
- Returns
 The pointer to the context.
- 
virtual expected<cudaStream_t, RuntimeError> allocate_cuda_stream(const std::string &stream_name = "") = 0
 allocate a new GXF CudaStream object and return the contained cudaStream_t
- 
virtual void synchronize_streams(const std::vector<std::optional<cudaStream_t>> &cuda_streams, cudaStream_t target_cuda_stream) = 0
 synchronize all of the streams in cuda_streams with target_cuda_stream
- 
virtual expected<int, RuntimeError> device_from_stream(cudaStream_t stream) = 0
 determine the CUDA device corresponding to the given stream
- 
virtual std::shared_ptr<Operator> find_operator(const std::string &op_name = "") = 0
 Find an operator by name.
If the operator name is not provided, the current operator is returned.
- Parameters
 op_name – The name of the operator.
- Returns
 A shared pointer to the operator or nullptr if the operator is not found.
- 
virtual expected<holoscan::OperatorStatus, RuntimeError> get_operator_status(const std::string &op_name = "") = 0
 Get the status of the operator.
If the operator name is not provided, the status of the current operator is returned.
- Parameters
 op_name – The name of the operator.
- Returns
 The status of the operator or an error if the operator is not found.
Protected Attributes
- 
std::shared_ptr<InputContext> input_context_ = nullptr
 The input context.
- 
std::shared_ptr<OutputContext> output_context_ = nullptr
 The output context.
- 
void *context_ = nullptr
 The context.
- 
ExecutionContext() = default