diff --git a/ttg/ttg/parsec/buffer.h b/ttg/ttg/parsec/buffer.h index 62be4270ce..a2cdd88bcc 100644 --- a/ttg/ttg/parsec/buffer.h +++ b/ttg/ttg/parsec/buffer.h @@ -459,7 +459,7 @@ struct Buffer { void reset_scope(ttg::scope scope) { if (scope == ttg::scope::Allocate) { m_data->device_copies[0]->version = 0; - } else { + } else if (scope == ttg::scope::Invalid) { m_data->device_copies[0]->version = 1; /* reset all other copies to force a sync-in */ for (int i = 0; i < parsec_nb_devices; ++i) { @@ -473,7 +473,7 @@ struct Buffer { ttg::scope scope() const { /* if the host owns the data and has a version of zero we only have to allocate data */ - if (nullptr != m_data) return ttg::scope::Invalid; + if (nullptr == m_data) return ttg::scope::Invalid; return (m_data->device_copies[0]->version == 0 && m_data->owner_device == 0) ? ttg::scope::Allocate : ttg::scope::SyncIn; }