private void initOpenCL1() {
        clContext = context.getOpenCLContext();
        clQueue = clContext.createQueue().register();
        ProgramCache programCache = new ProgramCache(clContext);
        //create kernel
        String cacheID = getClass().getName()+".Julia";
        Program program = programCache.loadFromCache(cacheID);
        if (program == null) {
            LOG.info("Program not loaded from cache, create from sources instead");
            program = clContext.createProgramFromSourceFiles(assetManager, "jme3test/opencl/JuliaSet.cl");
            program.build();
            programCache.saveToCache(cacheID, program);
        }
        program.register();
        kernel = program.createKernel("JuliaSet").register();
        C = new Vector2f(0.12f, -0.2f);
    }
This test class tests the capability to write to a GL texture from OpenCL.
Move the mouse around while pressing the left mouse key to modify the fractal.

In addition, this test shows how to use {@link ProgramCache}.

@author shaman
jme3-examples/src/main/java/jme3test/opencl/TestWriteToTexture.java