Class CUmemAllocationProp

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

    public class CUmemAllocationProp
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Specifies the allocation properties for a allocation.

    Layout

    
     struct CUmemAllocationProp {
         CUmemAllocationType type();
         CUmemAllocationHandleType requestedHandleTypes();
         CUmemLocation location();
         void * win32HandleMetaData();
         struct {
             unsigned char compressionType;
             unsigned char gpuDirectRDMACapable;
             unsigned short usage;
             unsigned char reserved[4];
         } allocFlags;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • TYPE, REQUESTEDHANDLETYPES, LOCATION, WIN32HANDLEMETADATA, ALLOCFLAGS, ALLOCFLAGS_COMPRESSIONTYPE, ALLOCFLAGS_GPUDIRECTRDMACAPABLE, ALLOCFLAGS_USAGE, ALLOCFLAGS_RESERVED

        The struct member offsets.
    • Constructor Detail

      • CUmemAllocationProp

        public CUmemAllocationProp​(java.nio.ByteBuffer container)
        Creates a CUmemAllocationProp instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • type

        public int type()
        allocation type
      • requestedHandleTypes

        public int requestedHandleTypes()
        requested CUmemAllocationHandleType
      • location

        public CUmemLocation location()
        location of allocation
      • win32HandleMetaData

        public long win32HandleMetaData()
        windows-specific POBJECT_ATTRIBUTES required when MEM_HANDLE_TYPE_WIN32 is specified. This object atributes structure includes security attributes that define the scope of which exported allocations may be tranferred to other processes. In all other cases, this field is required to be zero.
      • allocFlags_compressionType

        public byte allocFlags_compressionType()
        allocation hint for requesting compressible memory.

        On devices that support Compute Data Compression, compressible memory can be used to accelerate accesses to data with unstructured sparsity and other compressible data patterns. Applications are expected to query allocation property of the handle obtained with MemCreate using MemGetAllocationPropertiesFromHandle to validate if the obtained allocation is compressible or not. Note that compressed memory may not be mappable on all devices.

      • allocFlags_gpuDirectRDMACapable

        public byte allocFlags_gpuDirectRDMACapable()
        Returns:
        the value of the allocFlags.gpuDirectRDMACapable field.
      • allocFlags_usage

        public short allocFlags_usage()
        bitmask indicating intended usage for this allocation
      • allocFlags_reserved

        public java.nio.ByteBuffer allocFlags_reserved()
        Returns:
        a ByteBuffer view of the allocFlags.reserved field.
      • allocFlags_reserved

        public byte allocFlags_reserved​(int index)
        Returns:
        the value at the specified index of the allocFlags.reserved field.
      • allocFlags_gpuDirectRDMACapable

        public CUmemAllocationProp allocFlags_gpuDirectRDMACapable​(byte value)
        Sets the specified value to the gpuDirectRDMACapable field.
      • allocFlags_reserved

        public CUmemAllocationProp allocFlags_reserved​(java.nio.ByteBuffer value)
        Copies the specified ByteBuffer to the reserved field.
      • allocFlags_reserved

        public CUmemAllocationProp allocFlags_reserved​(int index,
                                                       byte value)
        Sets the specified value at the specified index of the reserved field.
      • set

        public CUmemAllocationProp set​(int type,
                                       int requestedHandleTypes,
                                       CUmemLocation location,
                                       long win32HandleMetaData,
                                       byte allocFlags_compressionType,
                                       byte allocFlags_gpuDirectRDMACapable,
                                       short allocFlags_usage,
                                       java.nio.ByteBuffer allocFlags_reserved)
        Initializes this struct with the specified values.
      • malloc

        public static CUmemAllocationProp malloc()
        Returns a new CUmemAllocationProp instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static CUmemAllocationProp calloc()
        Returns a new CUmemAllocationProp instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static CUmemAllocationProp create()
        Returns a new CUmemAllocationProp instance allocated with BufferUtils.
      • create

        public static CUmemAllocationProp create​(long address)
        Returns a new CUmemAllocationProp instance for the specified memory address.
      • createSafe

        @Nullable
        public static CUmemAllocationProp createSafe​(long address)
        Like create, but returns null if address is NULL.
      • malloc

        public static CUmemAllocationProp malloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new CUmemAllocationProp instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • calloc

        public static CUmemAllocationProp calloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new CUmemAllocationProp instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • malloc

        public static CUmemAllocationProp.Buffer malloc​(int capacity,
                                                        org.lwjgl.system.MemoryStack stack)
        Returns a new CUmemAllocationProp.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • calloc

        public static CUmemAllocationProp.Buffer calloc​(int capacity,
                                                        org.lwjgl.system.MemoryStack stack)
        Returns a new CUmemAllocationProp.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • ntype

        public static int ntype​(long struct)
        Unsafe version of type().
      • nrequestedHandleTypes

        public static int nrequestedHandleTypes​(long struct)
        Unsafe version of requestedHandleTypes().
      • nwin32HandleMetaData

        public static long nwin32HandleMetaData​(long struct)
        Unsafe version of win32HandleMetaData().
      • nallocFlags_compressionType

        public static byte nallocFlags_compressionType​(long struct)
        Unsafe version of allocFlags_compressionType().
      • nallocFlags_usage

        public static short nallocFlags_usage​(long struct)
        Unsafe version of allocFlags_usage().
      • nallocFlags_reserved

        public static java.nio.ByteBuffer nallocFlags_reserved​(long struct)
        Unsafe version of allocFlags_reserved().
      • nallocFlags_reserved

        public static byte nallocFlags_reserved​(long struct,
                                                int index)
        Unsafe version of allocFlags_reserved.
      • ntype

        public static void ntype​(long struct,
                                 int value)
        Unsafe version of type.
      • nrequestedHandleTypes

        public static void nrequestedHandleTypes​(long struct,
                                                 int value)
        Unsafe version of requestedHandleTypes.
      • nlocation

        public static void nlocation​(long struct,
                                     CUmemLocation value)
        Unsafe version of location.
      • nwin32HandleMetaData

        public static void nwin32HandleMetaData​(long struct,
                                                long value)
        Unsafe version of win32HandleMetaData.
      • nallocFlags_compressionType

        public static void nallocFlags_compressionType​(long struct,
                                                       byte value)
        Unsafe version of allocFlags_compressionType.
      • nallocFlags_gpuDirectRDMACapable

        public static void nallocFlags_gpuDirectRDMACapable​(long struct,
                                                            byte value)
      • nallocFlags_usage

        public static void nallocFlags_usage​(long struct,
                                             short value)
        Unsafe version of allocFlags_usage.
      • nallocFlags_reserved

        public static void nallocFlags_reserved​(long struct,
                                                java.nio.ByteBuffer value)
        Unsafe version of allocFlags_reserved.
      • nallocFlags_reserved

        public static void nallocFlags_reserved​(long struct,
                                                int index,
                                                byte value)
        Unsafe version of allocFlags_reserved.