Fresto
Fresto

Reputation: 465

How to clear buffers in OpenCL 1.2 c++

In my program, after calculations, there is a lot of memory left that is not cleared and is stored just like that. It is necessary to clear the buffer memory. What command can this be done in C ++?

Buffer myBuffer = Buffer(context, CL_MEM_READ_ONLY, count * sizeof(double));
queue.enqueueWriteBuffer(myBuffer, CL_TRUE, 0, count * sizeof(double), openF);

Upvotes: 1

Views: 1459

Answers (1)

mogu
mogu

Reputation: 1119

clEnqueueFillBuffer

But TBH i don't quite understand why you need it after the calculation. It's usually done before calculation, after it you just release the buffer.

Upvotes: 1

Related Questions