Skip to content
Snippets Groups Projects

Improved Scheduler diagnosis

Merged Olivier BICHLER requested to merge impr_sched_diag into dev
2 files
+ 70
11
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -82,6 +82,14 @@ protected:
@@ -82,6 +82,14 @@ protected:
std::chrono::time_point<std::chrono::high_resolution_clock> end; /** Actual end time of execution */
std::chrono::time_point<std::chrono::high_resolution_clock> end; /** Actual end time of execution */
};
};
public:
public:
 
enum class AvailableDataStatus {
 
Connected,
 
UpperNodeInputFound,
 
UpperNodeInputConnected,
 
ValidTensor,
 
NotConnected
 
};
 
/**
/**
* @struct PriorProducersConsumers
* @struct PriorProducersConsumers
* @brief Manages producer-consumer relationships for nodes.
* @brief Manages producer-consumer relationships for nodes.
@@ -179,7 +187,7 @@ protected:
@@ -179,7 +187,7 @@ protected:
*/
*/
std::set<std::shared_ptr<Node>> getConsumers(const std::set<std::shared_ptr<Node>>& producers) const;
std::set<std::shared_ptr<Node>> getConsumers(const std::set<std::shared_ptr<Node>>& producers) const;
Elts_t getNbAvailableData(const std::shared_ptr<Node>& node, const IOIndex_t inputIdx) const;
Elts_t getNbAvailableData(const std::shared_ptr<Node>& node, const IOIndex_t inputIdx, AvailableDataStatus& status) const;
/**
/**
* @brief Get the prior producers and consumers for a node.
* @brief Get the prior producers and consumers for a node.
@@ -233,4 +241,23 @@ protected:
@@ -233,4 +241,23 @@ protected:
};
};
} // namespace Aidge
} // namespace Aidge
 
namespace Aidge {
 
inline auto format_as(Scheduler::AvailableDataStatus status) {
 
switch (status) {
 
case Scheduler::AvailableDataStatus::Connected:
 
return "The input is connected to a Node.";
 
case Scheduler::AvailableDataStatus::UpperNodeInputFound:
 
return "The input is an upper node input, but is not connected in any GraphView.";
 
case Scheduler::AvailableDataStatus::UpperNodeInputConnected:
 
return "The input is an upper node input and is connected to a Node.";
 
case Scheduler::AvailableDataStatus::ValidTensor:
 
return "The input is not connected in the current GraphView but has a valid tensor assigned.";
 
case Scheduler::AvailableDataStatus::NotConnected:
 
return "The input is not connected in the current GraphView.";
 
default:
 
return "UNKNOWN STATUS.";
 
}
 
}
 
}
 
#endif /* AIDGE_CORE_SCHEDULER_SCHEDULER_H_ */
#endif /* AIDGE_CORE_SCHEDULER_SCHEDULER_H_ */
Loading