Skip to content

Commit 498ba74

Browse files
committed
should not release readback buffer
1 parent d58e191 commit 498ba74

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

gpu.hpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,11 +1486,7 @@ inline std::future<void> toCPUAsync(Context &ctx, Tensor &tensor, void *data,
14861486
// Register the callback. The async chain continues inside
14871487
// queueWorkDoneCallback.
14881488
wgpuQueueOnSubmittedWorkDone(ctx.queue, workDoneCallbackInfo);
1489-
1490-
if (readbackBuffer) {
1491-
wgpuBufferRelease(readbackBuffer);
1492-
}
1493-
1489+
14941490
return promise->get_future();
14951491
}
14961492

@@ -1550,10 +1546,6 @@ inline std::future<void> toCPUAsync(Context &ctx, WGPUBuffer buffer, void *data,
15501546
// Start the asynchronous chain by registering the work-done callback.
15511547
wgpuQueueOnSubmittedWorkDone(ctx.queue, workDoneCallbackInfo);
15521548

1553-
if (op.readbackBuffer) {
1554-
wgpuBufferRelease(op.readbackBuffer);
1555-
}
1556-
15571549
return promise->get_future();
15581550
}
15591551

0 commit comments

Comments
 (0)