NNFW_STATUS nnfw_session::run()
{
- // TODO : add run routine
+ try
+ {
+ _executor->execute();
+ }
+ catch (...)
+ {
+ std::cerr << "Error during nnfw_session::run" << std::endl;
+ return NNFW_STATUS_ERROR;
+ }
+
return NNFW_STATUS_NO_ERROR;
}
NNFW_STATUS nnfw_session::set_input(int index, NNFW_TYPE type, const void *buffer, size_t length)
{
- // TODO : add set input routine
+ try
+ {
+ _executor->setInput(neurun::model::IOIndex(index), buffer, length);
+ }
+ catch (...)
+ {
+ std::cerr << "Error during nnfw_session::set_input" << std::endl;
+ return NNFW_STATUS_ERROR;
+ }
return NNFW_STATUS_NO_ERROR;
}
NNFW_STATUS nnfw_session::set_output(int index, NNFW_TYPE type, void *buffer, size_t length)
{
- // TODO : add set output routine
+ try
+ {
+ _executor->setOutput(neurun::model::IOIndex(index), buffer, length);
+ }
+ catch (...)
+ {
+ std::cerr << "Error during nnfw_session::set_output" << std::endl;
+ return NNFW_STATUS_ERROR;
+ }
return NNFW_STATUS_NO_ERROR;
}