@@ -38,7 +38,7 @@ namespace ipa {
*/
/**
- * \fn Algorithm::init()
+ * \fn Algorithm::init(typename Module::Context &context, const YamlObject &tuningData)
* \brief Initialize the Algorithm with tuning data
* \param[in] context The shared IPA context
* \param[in] tuningData The tuning data for the algorithm
@@ -50,6 +50,17 @@ namespace ipa {
* \return 0 if successful, an error code otherwise
*/
+/**
+ * \fn Algorithm::init(typename Module::Context &context)
+ * \brief Initialize the algorithm with default parameters
+ *
+ * This method is called when no tuning data is available. The algorithm
+ * should initialize with sensible default values.
+ *
+ * \param context The IPA context containing algorithm state
+ * \return 0 on success, negative error code on failure
+ */
+
/**
* \fn Algorithm::configure()
* \brief Configure the Algorithm given an IPAConfigInfo
@@ -32,6 +32,11 @@ public:
return 0;
}
+ virtual int init([[maybe_unused]] typename Module::Context &context)
+ {
+ return 0;
+ }
+
virtual int configure([[maybe_unused]] typename Module::Context &context,
[[maybe_unused]] const typename Module::Config &configInfo)
{
Add in an algorithm init() routine which can be called in the absence of a Yaml input. Do this to allow an algorithm to set up a default set of parameters. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> --- src/ipa/libipa/algorithm.cpp | 13 ++++++++++++- src/ipa/libipa/algorithm.h | 5 +++++ 2 files changed, 17 insertions(+), 1 deletion(-)