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:
parent
38f1c8ec59
commit
593cb9e6ed
|
@ -470,11 +470,9 @@ void pFlow::VectorSingle<T,MemorySpace>::assign
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setSize(srcSize);
|
changeSize(srcSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if constexpr( isTriviallyCopyable_ )
|
if constexpr( isTriviallyCopyable_ )
|
||||||
{
|
{
|
||||||
// - unmanaged view in the host
|
// - unmanaged view in the host
|
||||||
|
@ -557,9 +555,10 @@ void pFlow::VectorSingle<T,MemorySpace>::assign
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setSize(srcSize);
|
changeSize(srcSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if constexpr(isTriviallyCopyable_)
|
if constexpr(isTriviallyCopyable_)
|
||||||
{
|
{
|
||||||
copy(deviceView(), src.deviceView());
|
copy(deviceView(), src.deviceView());
|
||||||
|
@ -626,7 +625,8 @@ void pFlow::VectorSingle<T, MemorySpace>::append
|
||||||
uint32 oldS = size();
|
uint32 oldS = size();
|
||||||
uint32 newSize = oldS + appSize;
|
uint32 newSize = oldS + appSize;
|
||||||
|
|
||||||
setSize(newSize);
|
changeSize(newSize);
|
||||||
|
|
||||||
auto appendView = Kokkos::subview(
|
auto appendView = Kokkos::subview(
|
||||||
view_,
|
view_,
|
||||||
Kokkos::make_pair<uint32>(oldS, newSize));
|
Kokkos::make_pair<uint32>(oldS, newSize));
|
||||||
|
|
Loading…
Reference in New Issue