Added rerecord functionality and tests

This commit is contained in:
Alejandro Saucedo 2021-03-01 22:08:05 +00:00
parent 7f686b47da
commit 6192dda520
5 changed files with 110 additions and 113 deletions

View file

@ -51,6 +51,11 @@ Sequence::end()
{
KP_LOG_DEBUG("Kompute Sequence calling END");
if (this->isRunning()) {
throw std::runtime_error(
"Kompute Sequence begin called when sequence still running");
}
if (!this->isRecording()) {
KP_LOG_WARN("Kompute Sequence end called when not recording");
return;
@ -64,7 +69,7 @@ Sequence::end()
void
Sequence::clear()
{
KP_LOG_DEBUG("Kompute Sequence calling clear");
KP_LOG_DEBUG("Kompute Sequence calling clear");
this->end();
}
@ -171,6 +176,17 @@ Sequence::isInit()
this->mComputeQueue;
}
void
Sequence::rerecord()
{
this->end();
std::vector<std::shared_ptr<OpBase>> ops = this->mOperations;
this->mOperations.clear();
for (const std::shared_ptr<kp::OpBase>& op : ops) {
this->record(op);
}
}
void
Sequence::destroy()
{