Skip to content

Commit 5f82ff4

Browse files
committed
linux has a segfault if wait for events after.
1 parent 752a53a commit 5f82ff4

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

test/test_gpu.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ void stressTestToCPU() {
227227

228228
// Prepare to run for one second.
229229
auto startTime = high_resolution_clock::now();
230-
std::vector<std::future<void>> futures;
231230
size_t opCount = 0;
232231
while (high_resolution_clock::now() - startTime < seconds(2)) {
233232
// Allocate an output buffer (using a shared_ptr so it stays valid until the future completes)
@@ -237,14 +236,9 @@ void stressTestToCPU() {
237236
// log count
238237
LOG(kDefLog, kInfo, "opCount = %zu", opCount);
239238
auto fut = toCPUAsync(ctx, tensor, outputData->data(), N * sizeof(float), 0);
240-
futures.push_back(std::move(fut));
239+
wait(ctx, fut);
241240
++opCount;
242241
}
243-
244-
// Wait for all submitted operations to complete.
245-
for (auto &f : futures) {
246-
wait(ctx, f);
247-
}
248242

249243
auto endTime = high_resolution_clock::now();
250244
auto totalMs = duration_cast<milliseconds>(endTime - startTime).count();

0 commit comments

Comments
 (0)