Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ttg/ttg/parsec/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
}
Expand Down
Loading