Class GXFExecutor

Clara Holoscan v0.4.0
class GXFExecutor : public holoscan::Executor

Executor for GXF.

Public Functions

GXFExecutor() = delete

explicit GXFExecutor(holoscan::Fragment *app)

~GXFExecutor() override

virtual void run(Graph &graph) override

Initialize the graph and run the graph.

This method calls compose() to compose the graph, and runs the graph.

Public Static Functions

static void create_input_port(Fragment *fragment, gxf_context_t gxf_context, gxf_uid_t eid, IOSpec *io_spec)

Create and setup GXF components for input port.

For a given input port specification, create a GXF Receiver component for the port and create a GXF SchedulingTerm component that is corresponding to the Condition of the port.

If there is no condition specified for the port, a default condition (MessageAvailableCondition) is created. It currently supports ConditionType::kMessageAvailable and ConditionType::kNone condition types.

This function is a static function so that it can be called from other classes without dependency on this class.

Parameters
  • fragment – The fragment that this operator belongs to.

  • gxf_context – The GXF context.

  • eid – The GXF entity ID.

  • io_spec – The input port specification.

static void create_output_port(Fragment *fragment, gxf_context_t gxf_context, gxf_uid_t eid, IOSpec *io_spec)

Create and setup GXF components for output port.

For a given output port specification, create a GXF Receiver component for the port and create a GXF SchedulingTerm component that is corresponding to the Condition of the port.

If there is no condition specified for the port, a default condition (DownstreamMessageAffordableCondition) is created. It currently supports ConditionType::kDownstreamMessageAffordable and ConditionType::kNone condition types.

This function is a static function so that it can be called from other classes without dependency on on this class.

Parameters
  • fragment – The fragment that this operator belongs to.

  • gxf_context – The GXF context.

  • eid – The GXF entity ID.

  • io_spec – The output port specification.

Protected Functions

virtual bool initialize_operator(Operator *op) override

Initialize the given operator.

This method is called by Operator::initialize() to initialize the operator.

Depending on the type of the operator, this method may be overridden to initialize the operator. For example, the default executor (GXFExecutor) initializes the operator using the GXF API and sets the operator’s ID to the ID of the GXF codelet.

Parameters

op – The pointer to the operator.

Returns

true if the operator is initialized successfully. Otherwise, false.

virtual bool add_receivers(const std::shared_ptr<Operator> &op, const std::string &receivers_name, std::set<std::string, std::less<>> &input_labels, std::vector<holoscan::IOSpec*> &iospec_vector) override

Add the receivers as input ports of the given operator.

This method is to be called by the Fragment::add_flow() method to support for the case where the destination input port label points to the parameter name of the downstream operator, and the parameter type is ‘std::vector<holoscan::IOSpec*>’. This finds a parameter with with ‘std::vector<holoscan::IOSpec*>’ type and create a new input port with a specific label (‘<parameter name>:<index>’. e.g, ‘receivers:0’).

Parameters
  • op – The reference to the shared pointer of the operator.

  • receivers_name – The name of the receivers whose parameter type is ‘std::vector<holoscan::IOSpec*>’.

  • input_labels – The reference to the set of input port labels of the operator.

  • iospec_vector – The reference to the vector of IOSpec pointers.

Returns

true if the receivers are added successfully. Otherwise, false.

© Copyright 2022, NVIDIA. Last updated on Jun 28, 2023.