Package org.lwjgl.cuda
Class CUmemAllocationProp
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.cuda.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.NativeResourceSpecifies the allocation properties for a allocation.Layout
struct CUmemAllocationProp { CUmemAllocationTypetype(); CUmemAllocationHandleTyperequestedHandleTypes();CUmemLocationlocation(); void *win32HandleMetaData(); struct { unsigned charcompressionType; unsigned char gpuDirectRDMACapable; unsigned shortusage; unsigned char reserved[4]; } allocFlags; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCUmemAllocationProp.BufferAn array ofCUmemAllocationPropstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intALLOCFLAGS
ALLOCFLAGS_COMPRESSIONTYPE
ALLOCFLAGS_GPUDIRECTRDMACAPABLE
ALLOCFLAGS_RESERVED
ALLOCFLAGS_USAGE
LOCATION
REQUESTEDHANDLETYPESThe struct member offsets.static intSIZEOFThe struct size in bytes.static intTYPE
WIN32HANDLEMETADATAThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description CUmemAllocationProp(java.nio.ByteBuffer container)Creates aCUmemAllocationPropinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byteallocFlags_compressionType()allocation hint for requesting compressible memory.CUmemAllocationPropallocFlags_compressionType(byte value)Sets the specified value to theallocFlags_compressionType()field.byteallocFlags_gpuDirectRDMACapable()CUmemAllocationPropallocFlags_gpuDirectRDMACapable(byte value)Sets the specified value to thegpuDirectRDMACapablefield.java.nio.ByteBufferallocFlags_reserved()byteallocFlags_reserved(int index)CUmemAllocationPropallocFlags_reserved(int index, byte value)Sets the specified value at the specified index of thereservedfield.CUmemAllocationPropallocFlags_reserved(java.nio.ByteBuffer value)Copies the specifiedByteBufferto thereservedfield.shortallocFlags_usage()bitmask indicating intended usage for this allocationCUmemAllocationPropallocFlags_usage(short value)Sets the specified value to theallocFlags_usage()field.static CUmemAllocationPropcalloc()Returns a newCUmemAllocationPropinstance allocated withmemCalloc.static CUmemAllocationProp.Buffercalloc(int capacity)Returns a newCUmemAllocationProp.Bufferinstance allocated withmemCalloc.static CUmemAllocationProp.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newCUmemAllocationProp.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static CUmemAllocationPropcalloc(org.lwjgl.system.MemoryStack stack)Returns a newCUmemAllocationPropinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static CUmemAllocationPropcreate()Returns a newCUmemAllocationPropinstance allocated withBufferUtils.static CUmemAllocationProp.Buffercreate(int capacity)Returns a newCUmemAllocationProp.Bufferinstance allocated withBufferUtils.static CUmemAllocationPropcreate(long address)Returns a newCUmemAllocationPropinstance for the specified memory address.static CUmemAllocationProp.Buffercreate(long address, int capacity)Create aCUmemAllocationProp.Bufferinstance at the specified memory.static CUmemAllocationPropcreateSafe(long address)static CUmemAllocationProp.BuffercreateSafe(long address, int capacity)CUmemLocationlocation()location of allocationCUmemAllocationProplocation(java.util.function.Consumer<CUmemLocation> consumer)Passes thelocation()field to the specifiedConsumer.CUmemAllocationProplocation(CUmemLocation value)Copies the specifiedCUmemLocationto thelocation()field.static CUmemAllocationPropmalloc()Returns a newCUmemAllocationPropinstance allocated withmemAlloc.static CUmemAllocationProp.Buffermalloc(int capacity)Returns a newCUmemAllocationProp.Bufferinstance allocated withmemAlloc.static CUmemAllocationProp.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newCUmemAllocationProp.Bufferinstance allocated on the specifiedMemoryStack.static CUmemAllocationPropmalloc(org.lwjgl.system.MemoryStack stack)Returns a newCUmemAllocationPropinstance allocated on the specifiedMemoryStack.static bytenallocFlags_compressionType(long struct)Unsafe version ofallocFlags_compressionType().static voidnallocFlags_compressionType(long struct, byte value)Unsafe version ofallocFlags_compressionType.static bytenallocFlags_gpuDirectRDMACapable(long struct)Unsafe version ofallocFlags_gpuDirectRDMACapable().static voidnallocFlags_gpuDirectRDMACapable(long struct, byte value)Unsafe version ofallocFlags_gpuDirectRDMACapable.static java.nio.ByteBuffernallocFlags_reserved(long struct)Unsafe version ofallocFlags_reserved().static bytenallocFlags_reserved(long struct, int index)Unsafe version ofallocFlags_reserved.static voidnallocFlags_reserved(long struct, int index, byte value)Unsafe version ofallocFlags_reserved.static voidnallocFlags_reserved(long struct, java.nio.ByteBuffer value)Unsafe version ofallocFlags_reserved.static shortnallocFlags_usage(long struct)Unsafe version ofallocFlags_usage().static voidnallocFlags_usage(long struct, short value)Unsafe version ofallocFlags_usage.static CUmemLocationnlocation(long struct)Unsafe version oflocation().static voidnlocation(long struct, CUmemLocation value)Unsafe version oflocation.static intnrequestedHandleTypes(long struct)Unsafe version ofrequestedHandleTypes().static voidnrequestedHandleTypes(long struct, int value)Unsafe version ofrequestedHandleTypes.static intntype(long struct)Unsafe version oftype().static voidntype(long struct, int value)Unsafe version oftype.static longnwin32HandleMetaData(long struct)Unsafe version ofwin32HandleMetaData().static voidnwin32HandleMetaData(long struct, long value)Unsafe version ofwin32HandleMetaData.intrequestedHandleTypes()requestedCUmemAllocationHandleTypeCUmemAllocationProprequestedHandleTypes(int value)Sets the specified value to therequestedHandleTypes()field.CUmemAllocationPropset(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.CUmemAllocationPropset(CUmemAllocationProp src)Copies the specified struct data to this struct.intsizeof()inttype()allocation typeCUmemAllocationProptype(int value)Sets the specified value to thetype()field.longwin32HandleMetaData()windows-specificPOBJECT_ATTRIBUTESrequired whenMEM_HANDLE_TYPE_WIN32is specified.CUmemAllocationPropwin32HandleMetaData(long value)Sets the specified value to thewin32HandleMetaData()field.
-
-
-
Constructor Detail
-
CUmemAllocationProp
public CUmemAllocationProp(java.nio.ByteBuffer container)
Creates aCUmemAllocationPropinstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin classorg.lwjgl.system.Struct
-
type
public int type()
allocation type
-
requestedHandleTypes
public int requestedHandleTypes()
requestedCUmemAllocationHandleType
-
location
public CUmemLocation location()
location of allocation
-
win32HandleMetaData
public long win32HandleMetaData()
windows-specificPOBJECT_ATTRIBUTESrequired whenMEM_HANDLE_TYPE_WIN32is 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
MemCreateusingMemGetAllocationPropertiesFromHandleto 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.gpuDirectRDMACapablefield.
-
allocFlags_usage
public short allocFlags_usage()
bitmask indicating intended usage for this allocation
-
allocFlags_reserved
public java.nio.ByteBuffer allocFlags_reserved()
- Returns:
- a
ByteBufferview of theallocFlags.reservedfield.
-
allocFlags_reserved
public byte allocFlags_reserved(int index)
- Returns:
- the value at the specified index of the
allocFlags.reservedfield.
-
type
public CUmemAllocationProp type(int value)
Sets the specified value to thetype()field.
-
requestedHandleTypes
public CUmemAllocationProp requestedHandleTypes(int value)
Sets the specified value to therequestedHandleTypes()field.
-
location
public CUmemAllocationProp location(CUmemLocation value)
Copies the specifiedCUmemLocationto thelocation()field.
-
location
public CUmemAllocationProp location(java.util.function.Consumer<CUmemLocation> consumer)
Passes thelocation()field to the specifiedConsumer.
-
win32HandleMetaData
public CUmemAllocationProp win32HandleMetaData(long value)
Sets the specified value to thewin32HandleMetaData()field.
-
allocFlags_compressionType
public CUmemAllocationProp allocFlags_compressionType(byte value)
Sets the specified value to theallocFlags_compressionType()field.
-
allocFlags_gpuDirectRDMACapable
public CUmemAllocationProp allocFlags_gpuDirectRDMACapable(byte value)
Sets the specified value to thegpuDirectRDMACapablefield.
-
allocFlags_usage
public CUmemAllocationProp allocFlags_usage(short value)
Sets the specified value to theallocFlags_usage()field.
-
allocFlags_reserved
public CUmemAllocationProp allocFlags_reserved(java.nio.ByteBuffer value)
Copies the specifiedByteBufferto thereservedfield.
-
allocFlags_reserved
public CUmemAllocationProp allocFlags_reserved(int index, byte value)
Sets the specified value at the specified index of thereservedfield.
-
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.
-
set
public CUmemAllocationProp set(CUmemAllocationProp src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static CUmemAllocationProp malloc()
Returns a newCUmemAllocationPropinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static CUmemAllocationProp calloc()
Returns a newCUmemAllocationPropinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static CUmemAllocationProp create()
Returns a newCUmemAllocationPropinstance allocated withBufferUtils.
-
create
public static CUmemAllocationProp create(long address)
Returns a newCUmemAllocationPropinstance for the specified memory address.
-
createSafe
@Nullable public static CUmemAllocationProp createSafe(long address)
-
malloc
public static CUmemAllocationProp.Buffer malloc(int capacity)
Returns a newCUmemAllocationProp.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static CUmemAllocationProp.Buffer calloc(int capacity)
Returns a newCUmemAllocationProp.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static CUmemAllocationProp.Buffer create(int capacity)
Returns a newCUmemAllocationProp.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static CUmemAllocationProp.Buffer create(long address, int capacity)
Create aCUmemAllocationProp.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static CUmemAllocationProp.Buffer createSafe(long address, int capacity)
-
malloc
public static CUmemAllocationProp malloc(org.lwjgl.system.MemoryStack stack)
Returns a newCUmemAllocationPropinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static CUmemAllocationProp calloc(org.lwjgl.system.MemoryStack stack)
Returns a newCUmemAllocationPropinstance allocated on the specifiedMemoryStackand 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 newCUmemAllocationProp.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static CUmemAllocationProp.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newCUmemAllocationProp.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
ntype
public static int ntype(long struct)
Unsafe version oftype().
-
nrequestedHandleTypes
public static int nrequestedHandleTypes(long struct)
Unsafe version ofrequestedHandleTypes().
-
nlocation
public static CUmemLocation nlocation(long struct)
Unsafe version oflocation().
-
nwin32HandleMetaData
public static long nwin32HandleMetaData(long struct)
Unsafe version ofwin32HandleMetaData().
-
nallocFlags_compressionType
public static byte nallocFlags_compressionType(long struct)
Unsafe version ofallocFlags_compressionType().
-
nallocFlags_gpuDirectRDMACapable
public static byte nallocFlags_gpuDirectRDMACapable(long struct)
Unsafe version ofallocFlags_gpuDirectRDMACapable().
-
nallocFlags_usage
public static short nallocFlags_usage(long struct)
Unsafe version ofallocFlags_usage().
-
nallocFlags_reserved
public static java.nio.ByteBuffer nallocFlags_reserved(long struct)
Unsafe version ofallocFlags_reserved().
-
nallocFlags_reserved
public static byte nallocFlags_reserved(long struct, int index)Unsafe version ofallocFlags_reserved.
-
ntype
public static void ntype(long struct, int value)Unsafe version oftype.
-
nrequestedHandleTypes
public static void nrequestedHandleTypes(long struct, int value)Unsafe version ofrequestedHandleTypes.
-
nlocation
public static void nlocation(long struct, CUmemLocation value)Unsafe version oflocation.
-
nwin32HandleMetaData
public static void nwin32HandleMetaData(long struct, long value)Unsafe version ofwin32HandleMetaData.
-
nallocFlags_compressionType
public static void nallocFlags_compressionType(long struct, byte value)Unsafe version ofallocFlags_compressionType.
-
nallocFlags_gpuDirectRDMACapable
public static void nallocFlags_gpuDirectRDMACapable(long struct, byte value)Unsafe version ofallocFlags_gpuDirectRDMACapable.
-
nallocFlags_usage
public static void nallocFlags_usage(long struct, short value)Unsafe version ofallocFlags_usage.
-
nallocFlags_reserved
public static void nallocFlags_reserved(long struct, java.nio.ByteBuffer value)Unsafe version ofallocFlags_reserved.
-
nallocFlags_reserved
public static void nallocFlags_reserved(long struct, int index, byte value)Unsafe version ofallocFlags_reserved.
-
-