From 593cb9e6edf66727a7dfa9b1010ef49f5f958aa6 Mon Sep 17 00:00:00 2001 From: Hamidreza Norouzi Date: Sun, 24 Mar 2024 14:22:48 -0700 Subject: [PATCH] corrections for methods assign and append The size change and capacity check was not correct. A full test should be done on all the methods in this class --- src/phasicFlow/containers/VectorHD/VectorSingle.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/phasicFlow/containers/VectorHD/VectorSingle.cpp b/src/phasicFlow/containers/VectorHD/VectorSingle.cpp index 1ea576d2..f7dad0c7 100644 --- a/src/phasicFlow/containers/VectorHD/VectorSingle.cpp +++ b/src/phasicFlow/containers/VectorHD/VectorSingle.cpp @@ -470,11 +470,9 @@ void pFlow::VectorSingle::assign } else { - setSize(srcSize); + changeSize(srcSize); } - - if constexpr( isTriviallyCopyable_ ) { // - unmanaged view in the host @@ -555,10 +553,11 @@ void pFlow::VectorSingle::assign { reallocateCapacitySize(srcCap, srcSize); } - else + else { - setSize(srcSize); + changeSize(srcSize); } + if constexpr(isTriviallyCopyable_) { @@ -626,7 +625,8 @@ void pFlow::VectorSingle::append uint32 oldS = size(); uint32 newSize = oldS + appSize; - setSize(newSize); + changeSize(newSize); + auto appendView = Kokkos::subview( view_, Kokkos::make_pair(oldS, newSize));