JOCL v2.6.0-rc-20250722
JOCL, OpenCL® API Binding for Java™ (public API).
CLBufferTest.java
Go to the documentation of this file.
1/*
2 * Copyright 2010 JogAmp Community. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without modification, are
5 * permitted provided that the following conditions are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright notice, this list of
8 * conditions and the following disclaimer.
9 *
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * The views and conclusions contained in the software and documentation are those of the
25 * authors and should not be interpreted as representing official policies, either expressed
26 * or implied, of JogAmp Community.
27 */
28
29package com.jogamp.opencl;
30
31import com.jogamp.opencl.CLMemory.Mem;
32import com.jogamp.opencl.CLMemory.Map;
33import com.jogamp.opencl.test.util.UITestCase;
34import com.jogamp.common.nio.Buffers;
35import com.jogamp.common.util.Bitstream;
36
37import java.io.IOException;
38import java.nio.Buffer;
39import java.nio.ByteBuffer;
40import java.nio.ByteOrder;
41import java.nio.DoubleBuffer;
42import java.nio.FloatBuffer;
43import java.nio.IntBuffer;
44import java.nio.LongBuffer;
45import java.nio.ShortBuffer;
46import java.util.List;
47import java.util.concurrent.CountDownLatch;
48import java.util.concurrent.TimeUnit;
49
50import org.junit.FixMethodOrder;
51import org.junit.Test;
52import org.junit.runners.MethodSorters;
53
54import static org.junit.Assert.*;
55import static java.lang.System.*;
56import static com.jogamp.common.nio.Buffers.*;
57import static com.jogamp.opencl.test.util.MiscUtils.*;
58import static com.jogamp.opencl.util.CLPlatformFilters.*;
59import static com.jogamp.opencl.CLVersion.*;
60
61/**
62 * @author Michael Bien, et.al.
63 */
64@FixMethodOrder(MethodSorters.NAME_ASCENDING)
65public class CLBufferTest extends UITestCase {
66
67 @Test
69 final int elements = NUM_ELEMENTS;
70 final int padding = 19*SIZEOF_INT*2; // Totally arbitrary number > 0 divisible by 2*SIZEOF_INT
71 final CLContext context = CLContext.create();
72
73 // Make a buffer that is offset relative to the originally allocated position and has a
74 // limit that is
75 // not equal to the capacity to test whether all these attributes are correctly handled.
76 ByteBuffer byteBuffer = ByteBuffer.allocateDirect(elements*SIZEOF_INT + padding);
77 byteBuffer.position(padding / 2); // Offset the original buffer
78 IntBuffer intBuffer = byteBuffer.slice().order(ByteOrder.nativeOrder()).asIntBuffer(); // Slice it to have a new buffer that starts at the offset
79 intBuffer.limit(elements);
80
81 final CLBuffer<IntBuffer> deviceBuffer = context.createBuffer(intBuffer);
82 assertEquals(elements, deviceBuffer.getCLCapacity());
83 assertEquals(elements * SIZEOF_INT, deviceBuffer.getNIOSize());
84 assertEquals(elements, deviceBuffer.getNIOCapacity());
85 }
86
87 @Test
89 final int elements = NUM_ELEMENTS;
90 final int padding = 312; // Arbitrary number
91 final CLContext context = CLContext.create();
92
93 final IntBuffer hostBuffer = ByteBuffer.allocateDirect((elements + padding)*SIZEOF_INT).asIntBuffer();
94 hostBuffer.limit(elements);
95
96 final CLBuffer<?> deviceBuffer = context.createBuffer(elements*SIZEOF_INT).cloneWith(hostBuffer);
97 assertEquals(elements, deviceBuffer.getCLCapacity());
98 assertEquals(elements*SIZEOF_INT, deviceBuffer.getNIOSize());
99 assertEquals(elements, deviceBuffer.getNIOCapacity());
100
101 context.release();
102 }
103
104 @Test
106 final int size = 4200*SIZEOF_INT; // Arbitrary number that is a multiple of SIZEOF_INT;
107 final int padding = 307; // Totally arbitrary number > 0
108 final CLContext context = CLContext.create();
109 final CLCommandQueue queue = context.getDevices()[0].createCommandQueue();
110
111 // Make a buffer that is offset relative to the originally allocated position and has a limit that is
112 // not equal to the capacity to test whether all these attributes are correctly handled.
113 ByteBuffer hostBuffer = ByteBuffer.allocateDirect(size + padding);
114 hostBuffer.position(padding/2); // Offset the original buffer
115 hostBuffer = hostBuffer.slice(); // Slice it to have a new buffer that starts at the offset
116 hostBuffer.limit(size);
117 hostBuffer.order(ByteOrder.nativeOrder()); // Necessary for comparisons to work later on.
118 fillBuffer(hostBuffer, 12345);
119
120 final CLBuffer<ByteBuffer> bufferA = context.createBuffer(size).cloneWith(hostBuffer);
121 final CLBuffer<ByteBuffer> bufferB = context.createByteBuffer(size);
122
123 queue.putWriteBuffer(bufferA, false)
124 .putCopyBuffer(bufferA, bufferB, bufferA.getNIOSize())
125 .putReadBuffer(bufferB, true).finish();
126
127 hostBuffer.rewind();
128 bufferB.buffer.rewind();
129 checkIfEqual(hostBuffer, bufferB.buffer, size/SIZEOF_INT);
130 context.release();
131 }
132
133 @Test
134 public void createBufferTest() {
135
136 out.println(" - - - highLevelTest; create buffer test - - - ");
137
138 final CLContext context = CLContext.create();
139 try{
140 final int size = 6;
141
142 final CLBuffer<ByteBuffer> bb = context.createByteBuffer(size);
143 final CLBuffer<ShortBuffer> sb = context.createShortBuffer(size);
144 final CLBuffer<IntBuffer> ib = context.createIntBuffer(size);
145 final CLBuffer<LongBuffer> lb = context.createLongBuffer(size);
146 final CLBuffer<FloatBuffer> fb = context.createFloatBuffer(size);
147 final CLBuffer<DoubleBuffer> db = context.createDoubleBuffer(size);
148
149 final List<CLMemory<? extends Buffer>> buffers = context.getMemoryObjects();
150 assertEquals(6, buffers.size());
151
152 assertEquals(1, bb.getElementSize());
153 assertEquals(2, sb.getElementSize());
154 assertEquals(4, ib.getElementSize());
155 assertEquals(8, lb.getElementSize());
156 assertEquals(4, fb.getElementSize());
157 assertEquals(8, db.getElementSize());
158
159 final ByteBuffer anotherNIO = newDirectByteBuffer(2);
160
161 for (final CLMemory<? extends Buffer> memory : buffers) {
162
164 final Buffer nio = buffer.getBuffer();
165
166 assertEquals(nio.capacity(), buffer.getCLCapacity());
167 assertEquals(buffer.getNIOSize(), buffer.getCLSize());
168 assertEquals(sizeOfBufferElem(nio), buffer.getElementSize());
169 assertEquals(nio.capacity() * sizeOfBufferElem(nio), buffer.getCLSize());
170
171 final CLBuffer<ByteBuffer> clone = buffer.cloneWith(anotherNIO);
172
173 assertEquals(buffer.ID, clone.ID);
174 assertTrue(clone.equals(buffer));
175 assertTrue(buffer.equals(clone));
176
177 assertEquals(buffer.getCLSize(), clone.getCLCapacity());
178 assertEquals(buffer.getCLSize(), clone.getCLSize());
179 assertEquals(anotherNIO.capacity(), clone.getNIOCapacity());
180 }
181
182 }finally{
183 context.release();
184 }
185
186 }
187
188 @Test
190
191 out.println(" - - - highLevelTest; copy buffer test - - - ");
192
193 final int elements = NUM_ELEMENTS;
194
195 final CLContext context = CLContext.create();
196
197 // the CL.MEM_* flag is probably completely irrelevant in our case since we do not use a kernel in this test
198 final CLBuffer<ByteBuffer> clBufferA = context.createByteBuffer(elements*SIZEOF_INT, Mem.READ_ONLY);
199 final CLBuffer<ByteBuffer> clBufferB = context.createByteBuffer(elements*SIZEOF_INT, Mem.READ_ONLY);
200
201 // fill only first read buffer -> we will copy the payload to the second later.
202 fillBuffer(clBufferA.buffer, 12345);
203
204 final CLCommandQueue queue = context.getDevices()[0].createCommandQueue();
205
206 // asynchronous write of data to GPU device, blocking read later to get the computed results back.
207 queue.putWriteBuffer(clBufferA, false) // write A
208 .putCopyBuffer(clBufferA, clBufferB, clBufferA.buffer.capacity()) // copy A -> B
209 .putReadBuffer(clBufferB, true) // read B
210 .finish();
211
212 context.release();
213
214 out.println("validating computed results...");
215 checkIfEqual(clBufferA.buffer, clBufferB.buffer, elements);
216 out.println("results are valid");
217
218 }
219
220 @Test
222
223 out.println(" - - - highLevelTest; host pointer test - - - ");
224
225 final int elements = NUM_ELEMENTS;
226
227 final CLContext context = CLContext.create();
228
229 final ByteBuffer buffer = Buffers.newDirectByteBuffer(elements*SIZEOF_INT);
230 // fill only first read buffer -> we will copy the payload to the second later.
231 fillBuffer(buffer, 12345);
232
233 final CLCommandQueue queue = context.getDevices()[0].createCommandQueue();
234
235 final Mem[] bufferConfig = new Mem[] {Mem.COPY_BUFFER, Mem.USE_BUFFER};
236
237 for(int i = 0; i < bufferConfig.length; i++) {
238
239 out.println("testing with "+bufferConfig[i] + " config");
240
241 final CLBuffer<ByteBuffer> clBufferA = context.createBuffer(buffer, Mem.READ_ONLY, bufferConfig[i]);
242 final CLBuffer<ByteBuffer> clBufferB = context.createByteBuffer(elements*SIZEOF_INT, Mem.READ_ONLY);
243
244 // asynchronous write of data to GPU device, blocking read later to get the computed results back.
245 queue.putCopyBuffer(clBufferA, clBufferB, clBufferA.buffer.capacity()) // copy A -> B
246 .putReadBuffer(clBufferB, true) // read B
247 .finish();
248
249 assertEquals(2, context.getMemoryObjects().size());
250 clBufferA.release();
251 assertEquals(1, context.getMemoryObjects().size());
252 clBufferB.release();
253 assertEquals(0, context.getMemoryObjects().size());
254
255 // uploading worked when a==b.
256 out.println("validating computed results...");
257 checkIfEqual(clBufferA.buffer, clBufferB.buffer, elements);
258 out.println("results are valid");
259 }
260
261 context.release();
262 }
263
264 @Test
265 public void mapBufferTest() {
266
267 out.println(" - - - highLevelTest; map buffer test - - - ");
268
269 final int elements = NUM_ELEMENTS;
270 final int sizeInBytes = elements*SIZEOF_INT;
271
272 CLContext context;
273 CLBuffer<?> clBufferA;
274 CLBuffer<?> clBufferB;
275
276 // We will have to allocate mappable NIO memory on non CPU contexts
277 // since we can't map e.g GPU memory.
279
280 context = CLContext.create(CLDevice.Type.CPU);
281
282 clBufferA = context.createBuffer(sizeInBytes, Mem.READ_WRITE);
283 clBufferB = context.createBuffer(sizeInBytes, Mem.READ_WRITE);
284 }else{
285
286 context = CLContext.create();
287
288 clBufferA = context.createByteBuffer(sizeInBytes, Mem.READ_WRITE, Mem.USE_BUFFER);
289 clBufferB = context.createByteBuffer(sizeInBytes, Mem.READ_WRITE, Mem.USE_BUFFER);
290 }
291
292 final CLCommandQueue queue = context.getDevices()[0].createCommandQueue();
293
294 // fill only first buffer -> we will copy the payload to the second later.
295 final ByteBuffer mappedBufferA = queue.putMapBuffer(clBufferA, Map.WRITE, true);
296 assertEquals(sizeInBytes, mappedBufferA.capacity());
297
298 fillBuffer(mappedBufferA, 12345); // write to A
299
300 queue.putUnmapMemory(clBufferA, mappedBufferA)// unmap A
301 .putCopyBuffer(clBufferA, clBufferB); // copy A -> B
302
303 // map B for read operations
304 final ByteBuffer mappedBufferB = queue.putMapBuffer(clBufferB, Map.READ, true);
305 assertEquals(sizeInBytes, mappedBufferB.capacity());
306
307 out.println("validating computed results...");
308 checkIfEqual(mappedBufferA, mappedBufferB, elements); // A == B ?
309 out.println("results are valid");
310
311 queue.putUnmapMemory(clBufferB, mappedBufferB); // unmap B
312
313 context.release();
314
315 }
316
317 @Test
319
320 out.println(" - - - subBufferTest - - - ");
321
322 @SuppressWarnings("unchecked")
323 final
324 CLPlatform platform = CLPlatform.getDefault(version(CL_1_1));
325 if(platform == null) {
326 out.println("aborting subBufferTest");
327 return;
328 }
329
330 final CLContext context = CLContext.create(platform);
331 try{
332 final int subelements = 5;
333 final long lMaxAlignment = context.getMaxMemBaseAddrAlign();
334 final int iMaxAlignment = Bitstream.uint32LongToInt(lMaxAlignment);
335 System.err.println("XXX: maxAlignment "+lMaxAlignment+", 0x"+Long.toHexString(lMaxAlignment)+", (int)"+iMaxAlignment+", (int)0x"+Integer.toHexString(iMaxAlignment));
336 if( -1 == iMaxAlignment ) {
337 throw new RuntimeException("Cannot handle MaxMemBaseAddrAlign > MAX_INT, has 0x"+Long.toHexString(lMaxAlignment));
338 }
339 // device only
340 final CLBuffer<?> buffer = context.createBuffer(iMaxAlignment+subelements);
341
342 assertFalse(buffer.isSubBuffer());
343 assertNotNull(buffer.getSubBuffers());
344 assertTrue(buffer.getSubBuffers().isEmpty());
345
346 final CLSubBuffer<?> subBuffer = buffer.createSubBuffer(iMaxAlignment, subelements);
347
348 assertTrue(subBuffer.isSubBuffer());
349 assertEquals(subelements, subBuffer.getCLSize());
350 assertEquals(iMaxAlignment, subBuffer.getOffset());
351 assertEquals(iMaxAlignment, subBuffer.getCLOffset());
352 assertEquals(buffer, subBuffer.getParent());
353 assertEquals(1, buffer.getSubBuffers().size());
354
355 subBuffer.release();
356 assertEquals(0, buffer.getSubBuffers().size());
357 }finally{
358 context.release();
359 }
360
361 }
362
363 @Test
365
366 out.println(" - - - subBufferTest - - - ");
367
368 @SuppressWarnings("unchecked")
369 final
370 CLPlatform platform = CLPlatform.getDefault(version(CL_1_1));
371 if(platform == null) {
372 out.println("aborting subBufferTest");
373 return;
374 }
375
376 final CLContext context = CLContext.create(platform);
377 try{
378 final int subelements = 5;
379 final long lMaxAlignment = context.getMaxMemBaseAddrAlign();
380 final int iMaxAlignment = Bitstream.uint32LongToInt(lMaxAlignment);
381 System.err.println("XXX: maxAlignment "+lMaxAlignment+", 0x"+Long.toHexString(lMaxAlignment)+", (int)"+iMaxAlignment+", (int)0x"+Integer.toHexString(iMaxAlignment));
382 if( -1 == iMaxAlignment ) {
383 throw new RuntimeException("Cannot handle MaxMemBaseAddrAlign > MAX_INT, has 0x"+Long.toHexString(lMaxAlignment));
384 }
385 // FIXME: See Bug 979: Offset/Alignment via offset calculation per element-count is faulty!
386 final int floatsPerAlignment = iMaxAlignment / Buffers.SIZEOF_FLOAT;
387 // device + direct buffer
388 final CLBuffer<FloatBuffer> buffer = context.createFloatBuffer(floatsPerAlignment+subelements);
389 assertFalse(buffer.isSubBuffer());
390 assertNotNull(buffer.getSubBuffers());
391 assertTrue(buffer.getSubBuffers().isEmpty());
392
393 final CLSubBuffer<FloatBuffer> subBuffer = buffer.createSubBuffer(floatsPerAlignment, subelements);
394
395 assertTrue(subBuffer.isSubBuffer());
396 assertEquals(subelements, subBuffer.getBuffer().capacity());
397 assertEquals(floatsPerAlignment, subBuffer.getOffset());
398 assertEquals(iMaxAlignment, subBuffer.getCLOffset());
399 assertEquals(buffer, subBuffer.getParent());
400 assertEquals(1, buffer.getSubBuffers().size());
401
402 assertEquals(subBuffer.getCLCapacity(), subBuffer.getBuffer().capacity());
403
404 subBuffer.release();
405 assertEquals(0, buffer.getSubBuffers().size());
406
407 }finally{
408 context.release();
409 }
410
411 }
412
413 @Test
414 public void destructorCallbackTest() throws InterruptedException {
415
416 out.println(" - - - destructorCallbackTest - - - ");
417
418 @SuppressWarnings("unchecked")
419 final
420 CLPlatform platform = CLPlatform.getDefault(version(CL_1_1));
421 if(platform == null) {
422 out.println("aborting destructorCallbackTest");
423 return;
424 }
425
426 final CLContext context = CLContext.create(platform);
427
428 try{
429
430 final CLBuffer<?> buffer = context.createBuffer(32);
431 final CountDownLatch countdown = new CountDownLatch(1);
432
434 public void memoryDeallocated(final CLMemory<?> mem) {
435 out.println("buffer released");
436 assertEquals(mem, buffer);
437 countdown.countDown();
438 }
439 });
440 buffer.release();
441
442 countdown.await(2, TimeUnit.SECONDS);
443 assertEquals(countdown.getCount(), 0);
444
445 }finally{
446 context.release();
447 }
448
449
450 }
451
452 public static void main(final String[] args) throws IOException {
453 final String tstname = CLBufferTest.class.getName();
454 org.junit.runner.JUnitCore.main(tstname);
455 }
456}
static void main(final String[] args)
OpenCL buffer object wrapping an optional NIO buffer.
Definition: CLBuffer.java:46
CLSubBuffer< B > createSubBuffer(int offset, int size, final Mem... flags)
Creates a sub buffer with the specified region from this buffer.
Definition: CLBuffer.java:101
List< CLSubBuffer< B > > getSubBuffers()
Returns the list of subbuffers.
Definition: CLBuffer.java:149
boolean isSubBuffer()
Returns true if this is a sub buffer.
Definition: CLBuffer.java:160
The command queue is used to queue a set of operations for a specific CLDevice.
CLCommandQueue putUnmapMemory(final CLMemory<?> memory, final Buffer mapped)
Calls {@native clEnqueueUnmapMemObject}.
CLCommandQueue finish()
Calls {@native clFinish}.
CLCommandQueue putCopyBuffer(final CLBuffer<?> src, final CLBuffer<?> dest)
Calls {@native clEnqueueCopyBuffer}.
CLCommandQueue putWriteBuffer(final CLBuffer<?> writeBuffer, final boolean blockingRead)
Calls {@native clEnqueueWriteBuffer}.
ByteBuffer putMapBuffer(final CLBuffer<?> buffer, final CLMemory.Map flag, final boolean blockingMap)
Calls {@native clEnqueueMapBuffer}.
CLCommandQueue putReadBuffer(final CLBuffer<?> readBuffer, final boolean blockingRead)
Calls {@native clEnqueueReadBuffer}.
CLContext is responsible for managing objects such as command-queues, memory, program and kernel obje...
Definition: CLContext.java:79
List< CLMemory<? extends Buffer > > getMemoryObjects()
Returns a read only shapshot of all allocated memory objects associated with this context.
Definition: CLContext.java:590
CLDevice[] getDevices()
Returns all devices associated with this CLContext.
Definition: CLContext.java:638
final CLBuffer< ShortBuffer > createShortBuffer(final int size, final Mem... flags)
Creates a CLBuffer with the specified flags and element count.
Definition: CLContext.java:292
static CLContext create()
Creates a context on all available devices (CL_DEVICE_TYPE_ALL).
Definition: CLContext.java:139
final CLBuffer< DoubleBuffer > createDoubleBuffer(final int size, final Mem... flags)
Creates a CLBuffer with the specified flags and element count.
Definition: CLContext.java:320
final CLBuffer< IntBuffer > createIntBuffer(final int size, final Mem... flags)
Creates a CLBuffer with the specified flags and element count.
Definition: CLContext.java:299
final CLBuffer<?> createBuffer(final int size, final Mem... flags)
Creates a CLBuffer with the specified flags.
Definition: CLContext.java:341
final CLBuffer< ByteBuffer > createByteBuffer(final int size, final Mem... flags)
Creates a CLBuffer with the specified flags and buffer size in bytes.
Definition: CLContext.java:327
final CLBuffer< LongBuffer > createLongBuffer(final int size, final Mem... flags)
Creates a CLBuffer with the specified flags and element count.
Definition: CLContext.java:306
final CLBuffer< FloatBuffer > createFloatBuffer(final int size, final Mem... flags)
Creates a CLBuffer with the specified flags and element count.
Definition: CLContext.java:313
long getMaxMemBaseAddrAlign()
Returns the maximum CLDevice#getMemBaseAddrAlign() of all devices.
Definition: CLContext.java:627
This object represents an OpenCL device.
Definition: CLDevice.java:53
CLCommandQueue createCommandQueue()
Definition: CLDevice.java:72
Common superclass for all OpenCL memory types.
Definition: CLMemory.java:49
int getElementSize()
Returns the size in bytes of a single buffer element.
Definition: CLMemory.java:179
boolean equals(final Object obj)
Returns the OpenGL buffer type of this shared buffer.
Definition: CLMemory.java:256
int getCLCapacity()
Returns the size in buffer elements of this memory object.
Definition: CLMemory.java:171
B getBuffer()
Returns the optional NIO buffer for this memory object.
Definition: CLMemory.java:137
int getNIOCapacity()
Returns the capacity of the wrapped direct buffer or 0 if no buffer available.
Definition: CLMemory.java:144
void registerDestructorCallback(final CLMemObjectListener listener)
Registers a callback which will be called by the OpenCL implementation when the memory object is rele...
Definition: CLMemory.java:107
int getNIOSize()
Returns the size of the wrapped direct buffer in byte or 0 if no buffer available.
Definition: CLMemory.java:154
long getCLSize()
Returns the size of the allocated OpenCL memory in bytes.
Definition: CLMemory.java:164
CLPlatfrorm representing a OpenCL implementation (e.g.
Definition: CLPlatform.java:99
CLDevice[] listCLDevices()
Lists all physical devices available on this platform.
static CLPlatform getDefault()
Returns the default OpenCL platform or null when no platform found.
A sub buffer of a CLBuffer.
int getOffset()
Returns the offset of this sub buffer to its parent in buffer elements.
CLBuffer< B > getParent()
Returns the parent buffer this buffer was created from.
boolean isSubBuffer()
Returns true.
int getCLOffset()
Returns the offset of this sub buffer to its parent in bytes.
Enumeration for the type of a device.
Definition: CLDevice.java:798
Configures the mapping process.
Definition: CLMemory.java:402
READ
Enum representing CL_MAP_READ.
Definition: CLMemory.java:420
WRITE
Enum representing CL_MAP_WRITE.
Definition: CLMemory.java:414
Memory settings for configuring CLMemory.
Definition: CLMemory.java:289
READ_WRITE
Enum representing CL_MEM_READ_WRITE.
Definition: CLMemory.java:296
COPY_BUFFER
Enum representing CL_MEM_COPY_HOST_PTR.
Definition: CLMemory.java:340
USE_BUFFER
Enum representing CL_MEM_USE_HOST_PTR.
Definition: CLMemory.java:323
READ_ONLY
Enum representing CL_MEM_READ_ONLY.
Definition: CLMemory.java:313
A callback which is invoked by the OpenCL implementation when the memory object is deleted and its re...