Skip to content

Commit 143a88c

Browse files
committed
test-perf It seems Field does not always like the check for assigning empty managed arrays
1 parent d56d252 commit 143a88c

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/Field/FieldInline.hh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,8 +1370,7 @@ inline
13701370
void
13711371
Field<Dimension, DataType>::
13721372
assignDataSpan() {
1373-
GPUUtils::initMAView(mDataSpan, mDataArray);
1374-
DEBUG_LOG << "Field::assignDataSpan : " << this->name() << " " << mDataArray.data() << " : " << mDataSpan.data() << " : " << static_cast<ViewType*>(this);
1373+
GPUUtils::initMAView(mDataSpan, mDataArray, false);
13751374
#if !defined(SPHERAL_UNIFIED_MEMORY) && !defined(CHAI_DISABLE_RM)
13761375
mDataSpan.setUserCallback(this->getCallback());
13771376
#endif

src/Utilities/GPUUtils.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ void deviceSync();
5959

6060
template<typename SpanType, typename ContainerType>
6161
void
62-
initMAView(SpanType& a_ma, ContainerType& a_dc) {
63-
if (a_dc.size() == 0u) {
62+
initMAView(SpanType& a_ma, ContainerType& a_dc, bool check_empty = true) {
63+
if (a_dc.size() == 0u && check_empty) {
6464
a_ma.free();
6565
} else if ((a_dc.data() != a_ma.data(chai::CPU, false) ||
6666
a_dc.size() != a_ma.size())) {

0 commit comments

Comments
 (0)