Skip to content

Commit

Permalink
Correctly sync all streams in device::finishAll(). (#723)
Browse files Browse the repository at this point in the history
  • Loading branch information
kris-rowe committed Jan 24, 2024
1 parent 06e32fd commit 789e9fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/occa/internal/core/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,14 @@ namespace occa {
}

void modeDevice_t::finishAll() const {
for(auto* stream : streams) {
if(stream) stream->finish();
if (streamRing.head) {
auto* start = static_cast<modeStream_t*>(streamRing.head);
auto* current = start;
// Every device
do {
current->finish();
current = static_cast<modeStream_t*>(current->rightRingEntry);
} while (current != start);
}
}

Expand Down
1 change: 0 additions & 1 deletion src/occa/internal/core/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ namespace occa {
gc::ring_t<modeStreamTag_t> streamTagRing;

stream currentStream;
std::vector<modeStream_t*> streams;

udim_t bytesAllocated;
udim_t maxBytesAllocated;
Expand Down

0 comments on commit 789e9fc

Please sign in to comment.