Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: device::finishAll()` #723

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@
}

void modeDevice_t::finishAll() const {
for(auto* stream : streams) {
if(stream) stream->finish();
if (streamRing.head) {
auto* start = static_cast<modeStream_t*>(streamRing.head);

Check warning on line 89 in src/occa/internal/core/device.cpp

View check run for this annotation

Codecov / codecov/patch

src/occa/internal/core/device.cpp#L88-L89

Added lines #L88 - L89 were not covered by tests
auto* current = start;
// Every device
do {
current->finish();
current = static_cast<modeStream_t*>(current->rightRingEntry);
} while (current != start);

Check warning on line 95 in src/occa/internal/core/device.cpp

View check run for this annotation

Codecov / codecov/patch

src/occa/internal/core/device.cpp#L93-L95

Added lines #L93 - L95 were not covered by tests
}
}

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