diff --git a/test/TestOpAlgoLoopsPassingData.cpp b/test/TestOpAlgoLoopsPassingData.cpp index 9c592e356..35a08e02a 100644 --- a/test/TestOpAlgoLoopsPassingData.cpp +++ b/test/TestOpAlgoLoopsPassingData.cpp @@ -30,10 +30,11 @@ TEST(TestProcessingIterations, IterateThroughMultipleSumAndCopies) } )"); - std::weak_ptr sqWeakPtr = - mgr.getOrCreateManagedSequence("default"); - if (std::shared_ptr sq = sqWeakPtr.lock()) { + { + std::shared_ptr sq = + mgr.getOrCreateManagedSequence("default"); + sq->begin(); sq->record({ tensorA, tensorB }); @@ -43,10 +44,10 @@ TEST(TestProcessingIterations, IterateThroughMultipleSumAndCopies) sq->eval(); } - std::weak_ptr sqWeakPtr2 = - mgr.getOrCreateManagedSequence("run"); + { + std::shared_ptr sq = + mgr.getOrCreateManagedSequence("run"); - if (std::shared_ptr sq = sqWeakPtr2.lock()) { sq->begin(); sq->record( @@ -61,10 +62,10 @@ TEST(TestProcessingIterations, IterateThroughMultipleSumAndCopies) } } - std::weak_ptr sqWeakPtr3 = - mgr.getOrCreateManagedSequence("export"); + { + std::shared_ptr sq = + mgr.getOrCreateManagedSequence("export"); - if (std::shared_ptr sq = sqWeakPtr3.lock()) { sq->begin(); sq->record({ tensorA, tensorB });