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
This commit is contained in:
Hamidreza Norouzi 2024-03-24 14:22:48 -07:00
parent 38f1c8ec59
commit 593cb9e6ed
1 changed files with 6 additions and 6 deletions

View File

@ -470,11 +470,9 @@ void pFlow::VectorSingle<T,MemorySpace>::assign
}
else
{
setSize(srcSize);
changeSize(srcSize);
}
if constexpr( isTriviallyCopyable_ )
{
// - unmanaged view in the host
@ -557,9 +555,10 @@ void pFlow::VectorSingle<T,MemorySpace>::assign
}
else
{
setSize(srcSize);
changeSize(srcSize);
}
if constexpr(isTriviallyCopyable_)
{
copy(deviceView(), src.deviceView());
@ -626,7 +625,8 @@ void pFlow::VectorSingle<T, MemorySpace>::append
uint32 oldS = size();
uint32 newSize = oldS + appSize;
setSize(newSize);
changeSize(newSize);
auto appendView = Kokkos::subview(
view_,
Kokkos::make_pair<uint32>(oldS, newSize));