diff options
Diffstat (limited to 'src/com/mbien/opencl/CLBuffer.java')
-rw-r--r-- | src/com/mbien/opencl/CLBuffer.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/mbien/opencl/CLBuffer.java b/src/com/mbien/opencl/CLBuffer.java index 7dcd2928..185389c3 100644 --- a/src/com/mbien/opencl/CLBuffer.java +++ b/src/com/mbien/opencl/CLBuffer.java @@ -77,12 +77,14 @@ public class CLBuffer { } static int flagsToInt(MEM[] flags) { - int clFlags = CL.CL_MEM_READ_WRITE; + int clFlags = 0; if(flags != null) { for (int i = 0; i < flags.length; i++) { clFlags |= flags[i].CL_FLAG; } } + if(clFlags == 0) + clFlags = CL.CL_MEM_READ_WRITE; return clFlags; } |