Package org.lwjgl.cuda
Class CUDA_MEM_ALLOC_NODE_PARAMS
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.cuda.CUDA_MEM_ALLOC_NODE_PARAMS
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class CUDA_MEM_ALLOC_NODE_PARAMS extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceMemory allocation node parameters.Layout
struct CUDA_MEM_ALLOC_NODE_PARAMS {CUmemPoolPropspoolProps();CUmemAccessDescconst *accessDescs(); size_taccessDescCount(); size_tbytesize(); CUdeviceptrdptr(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCUDA_MEM_ALLOC_NODE_PARAMS.BufferAn array ofCUDA_MEM_ALLOC_NODE_PARAMSstructs.
-
Field Summary
Fields Modifier and Type Field Description static intACCESSDESCCOUNT
ACCESSDESCSThe struct member offsets.static intALIGNOFThe struct alignment in bytes.static intBYTESIZE
DPTR
POOLPROPSThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor Description CUDA_MEM_ALLOC_NODE_PARAMS(java.nio.ByteBuffer container)Creates aCUDA_MEM_ALLOC_NODE_PARAMSinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longaccessDescCount()in: number of memory access descriptors.CUmemAccessDesc.BufferaccessDescs()in: array of memory access descriptors.CUDA_MEM_ALLOC_NODE_PARAMSaccessDescs(CUmemAccessDesc.Buffer value)Sets the address of the specifiedCUmemAccessDesc.Bufferto theaccessDescs()field.longbytesize()in: size in bytes of the requested allocationCUDA_MEM_ALLOC_NODE_PARAMSbytesize(long value)Sets the specified value to thebytesize()field.static CUDA_MEM_ALLOC_NODE_PARAMScalloc()Returns a newCUDA_MEM_ALLOC_NODE_PARAMSinstance allocated withmemCalloc.static CUDA_MEM_ALLOC_NODE_PARAMS.Buffercalloc(int capacity)Returns a newCUDA_MEM_ALLOC_NODE_PARAMS.Bufferinstance allocated withmemCalloc.static CUDA_MEM_ALLOC_NODE_PARAMS.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newCUDA_MEM_ALLOC_NODE_PARAMS.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static CUDA_MEM_ALLOC_NODE_PARAMScalloc(org.lwjgl.system.MemoryStack stack)Returns a newCUDA_MEM_ALLOC_NODE_PARAMSinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static CUDA_MEM_ALLOC_NODE_PARAMScreate()Returns a newCUDA_MEM_ALLOC_NODE_PARAMSinstance allocated withBufferUtils.static CUDA_MEM_ALLOC_NODE_PARAMS.Buffercreate(int capacity)Returns a newCUDA_MEM_ALLOC_NODE_PARAMS.Bufferinstance allocated withBufferUtils.static CUDA_MEM_ALLOC_NODE_PARAMScreate(long address)Returns a newCUDA_MEM_ALLOC_NODE_PARAMSinstance for the specified memory address.static CUDA_MEM_ALLOC_NODE_PARAMS.Buffercreate(long address, int capacity)Create aCUDA_MEM_ALLOC_NODE_PARAMS.Bufferinstance at the specified memory.static CUDA_MEM_ALLOC_NODE_PARAMScreateSafe(long address)static CUDA_MEM_ALLOC_NODE_PARAMS.BuffercreateSafe(long address, int capacity)longdptr()out: address of the allocation returned by CUDACUDA_MEM_ALLOC_NODE_PARAMSdptr(long value)Sets the specified value to thedptr()field.static CUDA_MEM_ALLOC_NODE_PARAMSmalloc()Returns a newCUDA_MEM_ALLOC_NODE_PARAMSinstance allocated withmemAlloc.static CUDA_MEM_ALLOC_NODE_PARAMS.Buffermalloc(int capacity)Returns a newCUDA_MEM_ALLOC_NODE_PARAMS.Bufferinstance allocated withmemAlloc.static CUDA_MEM_ALLOC_NODE_PARAMS.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newCUDA_MEM_ALLOC_NODE_PARAMS.Bufferinstance allocated on the specifiedMemoryStack.static CUDA_MEM_ALLOC_NODE_PARAMSmalloc(org.lwjgl.system.MemoryStack stack)Returns a newCUDA_MEM_ALLOC_NODE_PARAMSinstance allocated on the specifiedMemoryStack.static longnaccessDescCount(long struct)Unsafe version ofaccessDescCount().static voidnaccessDescCount(long struct, long value)Sets the specified value to theaccessDescCountfield of the specifiedstruct.static CUmemAccessDesc.BuffernaccessDescs(long struct)Unsafe version ofaccessDescs().static voidnaccessDescs(long struct, CUmemAccessDesc.Buffer value)Unsafe version ofaccessDescs.static longnbytesize(long struct)Unsafe version ofbytesize().static voidnbytesize(long struct, long value)Unsafe version ofbytesize.static longndptr(long struct)Unsafe version ofdptr().static voidndptr(long struct, long value)Unsafe version ofdptr.static CUmemPoolPropsnpoolProps(long struct)Unsafe version ofpoolProps().static voidnpoolProps(long struct, CUmemPoolProps value)Unsafe version ofpoolProps.CUmemPoolPropspoolProps()in: location where the allocation should reside (specified inlocation).CUDA_MEM_ALLOC_NODE_PARAMSpoolProps(java.util.function.Consumer<CUmemPoolProps> consumer)Passes thepoolProps()field to the specifiedConsumer.CUDA_MEM_ALLOC_NODE_PARAMSpoolProps(CUmemPoolProps value)Copies the specifiedCUmemPoolPropsto thepoolProps()field.CUDA_MEM_ALLOC_NODE_PARAMSset(CUDA_MEM_ALLOC_NODE_PARAMS src)Copies the specified struct data to this struct.CUDA_MEM_ALLOC_NODE_PARAMSset(CUmemPoolProps poolProps, CUmemAccessDesc.Buffer accessDescs, long bytesize, long dptr)Initializes this struct with the specified values.intsizeof()static voidvalidate(long struct)Validates pointer members that should not beNULL.
-
-
-
Constructor Detail
-
CUDA_MEM_ALLOC_NODE_PARAMS
public CUDA_MEM_ALLOC_NODE_PARAMS(java.nio.ByteBuffer container)
Creates aCUDA_MEM_ALLOC_NODE_PARAMSinstance 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
-
poolProps
public CUmemPoolProps poolProps()
in: location where the allocation should reside (specified inlocation).handleTypesmust beMEM_HANDLE_TYPE_NONE. IPC is not supported.
-
accessDescs
public CUmemAccessDesc.Buffer accessDescs()
in: array of memory access descriptors. Used to describe peer GPU access
-
accessDescCount
public long accessDescCount()
in: number of memory access descriptors. Must not exceed the number of GPUs.
-
bytesize
public long bytesize()
in: size in bytes of the requested allocation
-
dptr
public long dptr()
out: address of the allocation returned by CUDA
-
poolProps
public CUDA_MEM_ALLOC_NODE_PARAMS poolProps(CUmemPoolProps value)
Copies the specifiedCUmemPoolPropsto thepoolProps()field.
-
poolProps
public CUDA_MEM_ALLOC_NODE_PARAMS poolProps(java.util.function.Consumer<CUmemPoolProps> consumer)
Passes thepoolProps()field to the specifiedConsumer.
-
accessDescs
public CUDA_MEM_ALLOC_NODE_PARAMS accessDescs(CUmemAccessDesc.Buffer value)
Sets the address of the specifiedCUmemAccessDesc.Bufferto theaccessDescs()field.
-
bytesize
public CUDA_MEM_ALLOC_NODE_PARAMS bytesize(long value)
Sets the specified value to thebytesize()field.
-
dptr
public CUDA_MEM_ALLOC_NODE_PARAMS dptr(long value)
Sets the specified value to thedptr()field.
-
set
public CUDA_MEM_ALLOC_NODE_PARAMS set(CUmemPoolProps poolProps, CUmemAccessDesc.Buffer accessDescs, long bytesize, long dptr)
Initializes this struct with the specified values.
-
set
public CUDA_MEM_ALLOC_NODE_PARAMS set(CUDA_MEM_ALLOC_NODE_PARAMS src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static CUDA_MEM_ALLOC_NODE_PARAMS malloc()
Returns a newCUDA_MEM_ALLOC_NODE_PARAMSinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static CUDA_MEM_ALLOC_NODE_PARAMS calloc()
Returns a newCUDA_MEM_ALLOC_NODE_PARAMSinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static CUDA_MEM_ALLOC_NODE_PARAMS create()
Returns a newCUDA_MEM_ALLOC_NODE_PARAMSinstance allocated withBufferUtils.
-
create
public static CUDA_MEM_ALLOC_NODE_PARAMS create(long address)
Returns a newCUDA_MEM_ALLOC_NODE_PARAMSinstance for the specified memory address.
-
createSafe
@Nullable public static CUDA_MEM_ALLOC_NODE_PARAMS createSafe(long address)
-
malloc
public static CUDA_MEM_ALLOC_NODE_PARAMS.Buffer malloc(int capacity)
Returns a newCUDA_MEM_ALLOC_NODE_PARAMS.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static CUDA_MEM_ALLOC_NODE_PARAMS.Buffer calloc(int capacity)
Returns a newCUDA_MEM_ALLOC_NODE_PARAMS.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static CUDA_MEM_ALLOC_NODE_PARAMS.Buffer create(int capacity)
Returns a newCUDA_MEM_ALLOC_NODE_PARAMS.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static CUDA_MEM_ALLOC_NODE_PARAMS.Buffer create(long address, int capacity)
Create aCUDA_MEM_ALLOC_NODE_PARAMS.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static CUDA_MEM_ALLOC_NODE_PARAMS.Buffer createSafe(long address, int capacity)
-
malloc
public static CUDA_MEM_ALLOC_NODE_PARAMS malloc(org.lwjgl.system.MemoryStack stack)
Returns a newCUDA_MEM_ALLOC_NODE_PARAMSinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static CUDA_MEM_ALLOC_NODE_PARAMS calloc(org.lwjgl.system.MemoryStack stack)
Returns a newCUDA_MEM_ALLOC_NODE_PARAMSinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static CUDA_MEM_ALLOC_NODE_PARAMS.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newCUDA_MEM_ALLOC_NODE_PARAMS.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static CUDA_MEM_ALLOC_NODE_PARAMS.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newCUDA_MEM_ALLOC_NODE_PARAMS.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
npoolProps
public static CUmemPoolProps npoolProps(long struct)
Unsafe version ofpoolProps().
-
naccessDescs
public static CUmemAccessDesc.Buffer naccessDescs(long struct)
Unsafe version ofaccessDescs().
-
naccessDescCount
public static long naccessDescCount(long struct)
Unsafe version ofaccessDescCount().
-
nbytesize
public static long nbytesize(long struct)
Unsafe version ofbytesize().
-
ndptr
public static long ndptr(long struct)
Unsafe version ofdptr().
-
npoolProps
public static void npoolProps(long struct, CUmemPoolProps value)Unsafe version ofpoolProps.
-
naccessDescs
public static void naccessDescs(long struct, CUmemAccessDesc.Buffer value)Unsafe version ofaccessDescs.
-
naccessDescCount
public static void naccessDescCount(long struct, long value)Sets the specified value to theaccessDescCountfield of the specifiedstruct.
-
nbytesize
public static void nbytesize(long struct, long value)Unsafe version ofbytesize.
-
ndptr
public static void ndptr(long struct, long value)Unsafe version ofdptr.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-
-