private boolean testBuffer(Context clContext, CommandQueue clQueue) {
        try {
            //create two buffers
            ByteBuffer h1 = BufferUtils.createByteBuffer(256);
            Buffer b1 = clContext.createBuffer(256);
            ByteBuffer h2 = BufferUtils.createByteBuffer(256);
            Buffer b2 = clContext.createBuffer(256);

            //fill buffer
            h2.rewind();
            for (int i=0; i<256; ++i) {
                h2.put((byte)i);
            }
            h2.rewind();
            b2.write(clQueue, h2);
            
            //copy b2 to b1
            b2.copyTo(clQueue, b1);
            
            //read buffer
            h1.rewind();
            b1.read(clQueue, h1);
            h1.rewind();
            for (int i=0; i<256; ++i) {
                byte b = h1.get();
                assertEquals((byte) i, b, "Wrong byte read");
            }
            
            //read buffer with offset
            int low = 26;
            int high = 184;
            h1.position(5);
            Event event = b1.readAsync(clQueue, h1, high-low, low);
            event.waitForFinished();
            h1.position(5);
            for (int i=0; i<high-low; ++i) {
                byte b = h1.get();
                assertEquals((byte) (i+low), b, "Wrong byte read");
            }
        
            //release
            b1.release();
            b2.release();
            
        } catch (AssertionError ex) {
            LOG.log(Level.SEVERE, "Buffer test failed with an assertion error");
            return false;
        } catch (Exception ex) {
            LOG.log(Level.SEVERE, "Buffer test failed with:", ex);
            return false;
        }
        return true;
    }
Simple test checking if the basic functions of the OpenCL wrapper work
@author shaman
jme3-examples/src/main/java/jme3test/opencl/HelloOpenCL.java