Class CLMem

    • Method Detail

      • createImage2D

        public static CLMem createImage2D​(CLContext context,
                                          long flags,
                                          CLImageFormat image_format,
                                          long image_width,
                                          long image_height,
                                          long image_row_pitch,
                                          Buffer host_ptr,
                                          IntBuffer errcode_ret)
        Creates a new 2D image object.
        Parameters:
        context - the context on which to create the image object
        flags - the memory object flags
        image_format - the image format
        image_width - the image width
        image_height - the image height
        image_row_pitch - the image row pitch
        host_ptr - the host buffer from which to read image data (optional)
        errcode_ret - the error code result
        Returns:
        the new CLMem object
      • createImage3D

        public static CLMem createImage3D​(CLContext context,
                                          long flags,
                                          CLImageFormat image_format,
                                          long image_width,
                                          long image_height,
                                          long image_depth,
                                          long image_row_pitch,
                                          long image_slice_pitch,
                                          Buffer host_ptr,
                                          IntBuffer errcode_ret)
        Creates a new 3D image object.
        Parameters:
        context - the context on which to create the image object
        flags - the memory object flags
        image_format - the image format
        image_width - the image width
        image_height - the image height
        image_depth - the image depth
        image_row_pitch - the image row pitch
        image_slice_pitch - the image slice pitch
        host_ptr - the host buffer from which to read image data (optional)
        errcode_ret - the error code result
        Returns:
        the new CLMem object
      • createSubBuffer

        public CLMem createSubBuffer​(long flags,
                                     int buffer_create_type,
                                     CLBufferRegion buffer_create_info,
                                     IntBuffer errcode_ret)
      • getInfoInt

        public int getInfoInt​(int param_name)
        Returns the integer value of the specified parameter.
        Parameters:
        param_name - the parameter
        Returns:
        the parameter value
      • getInfoSize

        public long getInfoSize​(int param_name)
        Returns the size_t value of the specified parameter.
        Parameters:
        param_name - the parameter
        Returns:
        the parameter value
      • getInfoLong

        public long getInfoLong​(int param_name)
        Returns the long value of the specified parameter. Can be used for both cl_ulong and cl_bitfield parameters.
        Parameters:
        param_name - the parameter
        Returns:
        the parameter value
      • getInfoHostBuffer

        public ByteBuffer getInfoHostBuffer()
        Returns a direct ByteBuffer instance that points to the host memory that backs this CLMem object. Applicable only to CLMem objects that were created with the CL_MEM_USE_HOST_PTR flag.
        Returns:
        the host memory ByteBuffer
      • getImageInfoSize

        public long getImageInfoSize​(int param_name)
        Returns the size_t value of the specified parameter. Applicable to image objects only.
        Parameters:
        param_name - the parameter
        Returns:
        the parameter value
      • getImageFormat

        public CLImageFormat getImageFormat()
        Returns the image format. Applicable to image objects only.
        Returns:
        the parameter value
      • getImageChannelOrder

        public int getImageChannelOrder()
        Returns the image channel order. Applicable to image objects only.
        Returns:
        the parameter value
      • getImageChannelType

        public int getImageChannelType()
        Returns the image channel type. Applicable to image objects only.
        Returns:
        the parameter value
      • getGLObjectType

        public int getGLObjectType()
        Returns the GL object type. Applicable to CLMem objects that have been created GL objects only.
        Returns:
        the parameter value
      • getGLObjectName

        public int getGLObjectName()
        Returns the GL object name. Applicable to CLMem objects that have been created GL objects only.
        Returns:
        the parameter value
      • getGLTextureInfoInt

        public int getGLTextureInfoInt​(int param_name)
        Returns the int value of the specified parameter. Applicable to CLMem objects that have been created by GL textures only.
        Parameters:
        param_name - the parameter
        Returns:
        the parameter value
      • getParent

        public P getParent()
      • getReferenceCount

        public final int getReferenceCount()
      • isValid

        public final boolean isValid()
        Description copied from class: PointerWrapperAbstract
        Returns true if this object represents a valid pointer. The pointer might be invalid because it is NULL or because some other action has deleted the object that this pointer represents.
        Overrides:
        isValid in class PointerWrapperAbstract
        Returns:
        true if the pointer is valid