Updated tests to align with new sequence memory management workflow

This commit is contained in:
Alejandro Saucedo 2020-11-01 20:26:04 +00:00
parent e2f6e876bc
commit ac33cb450a

View file

@ -30,10 +30,11 @@ TEST(TestProcessingIterations, IterateThroughMultipleSumAndCopies)
}
)");
std::weak_ptr<kp::Sequence> sqWeakPtr =
mgr.getOrCreateManagedSequence("default");
if (std::shared_ptr<kp::Sequence> sq = sqWeakPtr.lock()) {
{
std::shared_ptr<kp::Sequence> sq =
mgr.getOrCreateManagedSequence("default");
sq->begin();
sq->record<kp::OpTensorCreate>({ tensorA, tensorB });
@ -43,10 +44,10 @@ TEST(TestProcessingIterations, IterateThroughMultipleSumAndCopies)
sq->eval();
}
std::weak_ptr<kp::Sequence> sqWeakPtr2 =
mgr.getOrCreateManagedSequence("run");
{
std::shared_ptr<kp::Sequence> sq =
mgr.getOrCreateManagedSequence("run");
if (std::shared_ptr<kp::Sequence> sq = sqWeakPtr2.lock()) {
sq->begin();
sq->record<kp::OpAlgoBase>(
@ -61,10 +62,10 @@ TEST(TestProcessingIterations, IterateThroughMultipleSumAndCopies)
}
}
std::weak_ptr<kp::Sequence> sqWeakPtr3 =
mgr.getOrCreateManagedSequence("export");
{
std::shared_ptr<kp::Sequence> sq =
mgr.getOrCreateManagedSequence("export");
if (std::shared_ptr<kp::Sequence> sq = sqWeakPtr3.lock()) {
sq->begin();
sq->record<kp::OpTensorSyncLocal>({ tensorA, tensorB });