From ac33cb450a91577624eb73f13829754199ad4d1e Mon Sep 17 00:00:00 2001 From: Alejandro Saucedo Date: Sun, 1 Nov 2020 20:26:04 +0000 Subject: [PATCH] Updated tests to align with new sequence memory management workflow --- test/TestOpAlgoLoopsPassingData.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) 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 });