public static long getMemoryAccessFlags(MemoryAccess ma) {
        switch (ma) {
            case READ_ONLY: return CL10.CL_MEM_READ_ONLY;
            case WRITE_ONLY: return CL10.CL_MEM_WRITE_ONLY;
            case READ_WRITE: return CL10.CL_MEM_READ_WRITE;
            default: throw new IllegalArgumentException("Unknown memory access: "+ma);
        }
    }
Maps OpenCL error token values to their String representations. 
        Taken directly from org.lwjgl.opencl.Util
jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/Utils.java