Skip to content

Commit ab567b8

Browse files
authored
Run PODVector::push_back on GPU (#3308)
There are two versions of PODVector::push_back. The `const&` version previously ran on CPU, whereas the `&&` version on GPU. It seems that they should have the same behavior. Thus the `const&` version now runs on GPU. (We may not even need to have two versions, because the move (i.e., `&&`) version does not move. It calls another function that takes `const&`.)
1 parent 1e2154f commit ab567b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Src/Base/AMReX_PODVector.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ namespace amrex
476476
void push_back (const T& a_value) noexcept
477477
{
478478
if (m_size == m_capacity) AllocateBuffer(GetNewCapacity(1));
479-
m_data[m_size] = a_value;
479+
detail::uninitializedFillNImpl<Allocator>(m_data+m_size, 1, a_value, *this);
480480
++m_size;
481481
}
482482

0 commit comments

Comments
 (0)