public static MemoryAccess getMemoryAccessFromFlag(long flag) {
        if ((flag & CL10.CL_MEM_READ_WRITE) > 0) {
            return MemoryAccess.READ_WRITE;
        }
        if ((flag & CL10.CL_MEM_READ_ONLY) > 0) {
            return MemoryAccess.READ_ONLY;
        }
        if ((flag & CL10.CL_MEM_WRITE_ONLY) > 0) {
            return MemoryAccess.WRITE_ONLY;
        }
        throw new OpenCLException("Unknown memory access flag: "+flag);
    }
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