Add comment

This commit is contained in:
Nikhil Jain 2026-01-29 20:55:38 -08:00
parent 608fc9d16d
commit edee0d6bc6
No known key found for this signature in database
1 changed files with 6 additions and 1 deletions

View File

@ -146,8 +146,13 @@ struct webgpu_submission_futures {
struct webgpu_buf_pool {
std::vector<webgpu_pool_bufs> free;
// The pool must be synchronized because:
// 1. The memset pool is shared globally by every ggml buffer,
// since allocating a pool per ggml buffer would consume too much memory.
// 2. For the per-thread buffer pools in webgpu_context,
// buffers are allocated and freed in Dawn callbacks,
// which can run on a different thread than the calling thread.
std::mutex mutex;
std::condition_variable cv;
void init(wgpu::Device device,