mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-06-12 16:26:23 +00:00
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:
@ -470,11 +470,9 @@ void pFlow::VectorSingle<T,MemorySpace>::assign
|
||||
}
|
||||
else
|
||||
{
|
||||
setSize(srcSize);
|
||||
changeSize(srcSize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if constexpr( isTriviallyCopyable_ )
|
||||
{
|
||||
// - unmanaged view in the host
|
||||
@ -555,10 +553,11 @@ void pFlow::VectorSingle<T,MemorySpace>::assign
|
||||
{
|
||||
reallocateCapacitySize(srcCap, srcSize);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
setSize(srcSize);
|
||||
changeSize(srcSize);
|
||||
}
|
||||
|
||||
|
||||
if constexpr(isTriviallyCopyable_)
|
||||
{
|
||||
@ -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));
|
||||
|
Reference in New Issue
Block a user