diff options
author | Michael Bien <[email protected]> | 2009-11-05 02:52:26 +0100 |
---|---|---|
committer | Michael Bien <[email protected]> | 2009-11-05 02:52:26 +0100 |
commit | 3d8df0c175ff84ac7b42e0ee5f247099b953514a (patch) | |
tree | 41b8a9a7e3b366938919efb75ab38599fc1d8c5b /src/com/mbien/opencl/CLKernel.java | |
parent | 0eebae54517e816aaeb36495dfdbdc1b6d03bfba (diff) |
bug fixes in buffer handling.
Diffstat (limited to 'src/com/mbien/opencl/CLKernel.java')
-rw-r--r-- | src/com/mbien/opencl/CLKernel.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/mbien/opencl/CLKernel.java b/src/com/mbien/opencl/CLKernel.java index 21b176c7..a4ee9f89 100644 --- a/src/com/mbien/opencl/CLKernel.java +++ b/src/com/mbien/opencl/CLKernel.java @@ -68,10 +68,18 @@ public class CLKernel { return this; } + private final Buffer wrap(float value) { + return BufferFactory.newDirectByteBuffer(4).putFloat(value).rewind(); + } + private final Buffer wrap(double value) { return BufferFactory.newDirectByteBuffer(8).putDouble(value).rewind(); } + private final Buffer wrap(int value) { + return BufferFactory.newDirectByteBuffer(4).putInt(value).rewind(); + } + private final Buffer wrap(long value) { return BufferFactory.newDirectByteBuffer(8).putLong(value).rewind(); } |