Class CLMemory<B extends Buffer>

    • Field Detail

      • FLAGS

        protected final int FLAGS
      • size

        protected long size
      • elementSize

        protected int elementSize
      • clCapacity

        protected int clCapacity
    • Constructor Detail

      • CLMemory

        protected CLMemory​(CLContext context,
                           long size,
                           long id,
                           int flags)
      • CLMemory

        protected CLMemory​(CLContext context,
                           B directBuffer,
                           long size,
                           long id,
                           int flags)
    • Method Detail

      • initCLCapacity

        protected final void initCLCapacity()
      • isHostPointerFlag

        protected static boolean isHostPointerFlag​(int flags)
        Returns true if a host pointer must be specified on mem object creation.
      • getSizeImpl

        protected static long getSizeImpl​(CLContext context,
                                          long id)
      • getCL

        protected static CL getCL​(CLContext context)
      • registerDestructorCallback

        public void registerDestructorCallback​(CLMemObjectListener listener)
        Registers a callback which will be called by the OpenCL implementation when the memory object is released.
      • cloneWith

        public abstract <T extends BufferCLMemory<T> cloneWith​(T directBuffer)
        Returns a new instance of CLMemory pointing to the same CLResource but using a different Buffer.
      • getBuffer

        public B getBuffer()
        Returns the optional NIO buffer for this memory object.
      • getNIOCapacity

        public int getNIOCapacity()
        Returns the capacity of the wrapped direct buffer or 0 if no buffer available.
      • getNIOSize

        public int getNIOSize()
        Returns the size of the wrapped direct buffer in byte or 0 if no buffer available.
      • getCLSize

        public long getCLSize()
        Returns the size of the allocated OpenCL memory in bytes.
      • getCLCapacity

        public int getCLCapacity()
        Returns the size in buffer elements of this memory object.
      • getElementSize

        public int getElementSize()
        Returns the size in bytes of a single buffer element. This method returns 1 if no buffer is available indicating regular byte access.
      • getConfig

        public EnumSet<CLMemory.Mem> getConfig()
        Returns the configuration of this memory object.
      • getMapCount

        public int getMapCount()
        Returns the number of buffer mappings. The map count returned should be considered immediately stale. It is unsuitable for general use in applications. This feature is provided for debugging.
      • isReadOnly

        public boolean isReadOnly()
        Returns true if this memory object was created with the CLMemory.Mem.READ_ONLY flag.
      • isWriteOnly

        public boolean isWriteOnly()
        Returns true if this memory object was created with the CLMemory.Mem.WRITE_ONLY flag.
      • isReadWrite

        public boolean isReadWrite()
        Returns true if this memory object was created with the CLMemory.Mem.READ_WRITE flag.
      • release

        public void release()
        Description copied from interface: CLResource
        Releases the OpenCL resource.
        Specified by:
        release in interface CLResource
      • equals

        public boolean equals​(Object obj)
        Returns the OpenGL buffer type of this shared buffer.
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • close

        @Deprecated
        public final void close()
        Deprecated.
        This method is not intended to be called from client code.
        Implementation detail, satisfying AutoCloseable. Might be remove as soon we have extension methods, but shall validate with Java 1.5 specs.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface AutoCloseable
        See Also:
        AutoCloseable