Skip to content

Commit 9e5ba50

Browse files
committed
Workaround for Nvidia driver bug: enqueueFillBuffer is broken for large buffers on Nvidia GPUs
1 parent 08ef523 commit 9e5ba50

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/opencl.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,11 @@ template<typename T> class Memory {
339339
if(host_buffer_exists) {
340340
std::fill(host_buffer, host_buffer+range(), value); // faster than "for(ulong i=0ull; i<range(); i++) host_buffer[i] = value;"
341341
}
342-
if(device_buffer_exists) {
343-
cl_queue.enqueueFillBuffer(device_buffer, value, 0ull, capacity()); // faster than "write_to_device();"
344-
cl_queue.finish();
345-
}
342+
write_to_device(); // enqueueFillBuffer is broken for large buffers on Nvidia GPUs!
343+
//if(device_buffer_exists) {
344+
// cl_queue.enqueueFillBuffer(device_buffer, value, 0ull, capacity()); // faster than "write_to_device();"
345+
// cl_queue.finish();
346+
//}
346347
}
347348
inline const ulong length() const { return N; }
348349
inline const uint dimensions() const { return d; }

0 commit comments

Comments
 (0)