biod.pnpi.spb.ru
/
alexxy
/
gromacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Add early returns in clearDeviceBuffer(...) in OpenCL and CUDA
[alexxy/gromacs.git]
/
src
/
gromacs
/
gpu_utils
/
devicebuffer_ocl.h
diff --git
a/src/gromacs/gpu_utils/devicebuffer_ocl.h
b/src/gromacs/gpu_utils/devicebuffer_ocl.h
index fe489926c8c48ed591ebfd912050b34e521ab946..a6d9e6813461f9d01287ab252424017c29cf5a51 100644
(file)
--- a/
src/gromacs/gpu_utils/devicebuffer_ocl.h
+++ b/
src/gromacs/gpu_utils/devicebuffer_ocl.h
@@
-259,6
+259,10
@@
void clearDeviceBufferAsync(DeviceBuffer<ValueType>* buffer,
size_t numValues,
const DeviceStream& deviceStream)
{
+ if (numValues == 0)
+ {
+ return;
+ }
GMX_ASSERT(buffer, "needs a buffer pointer");
const size_t offset = startingOffset * sizeof(ValueType);
const size_t bytes = numValues * sizeof(ValueType);