Package org.lwjgl.cuda
Class CUaccessPolicyWindow
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.cuda.CUaccessPolicyWindow
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class CUaccessPolicyWindow extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceSpecifies an access policy for a window, a contiguous extent of memory beginning atbase_ptrand ending atbase_ptr + num_bytes.num_bytesis limited byDEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE. Partition into many segments and assign segments such that: sum of "hit segments" / window == approx. ratio. sum of "miss segments" / window == approx 1-ratio. Segments and ratio specifications are fitted to the capabilities of the architecture. Accesses in a hit segment apply the hitProp access policy. Accesses in a miss segment apply the missProp access policy.Layout
struct CUaccessPolicyWindow { void *base_ptr(); size_tnum_bytes(); floathitRatio(); CUaccessPropertyhitProp(); CUaccessPropertymissProp(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCUaccessPolicyWindow.BufferAn array ofCUaccessPolicyWindowstructs.
-
Constructor Summary
Constructors Constructor Description CUaccessPolicyWindow(java.nio.ByteBuffer container)Creates aCUaccessPolicyWindowinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longbase_ptr()starting address of the access policy window.CUaccessPolicyWindowbase_ptr(long value)Sets the specified value to thebase_ptr()field.static CUaccessPolicyWindowcalloc()Returns a newCUaccessPolicyWindowinstance allocated withmemCalloc.static CUaccessPolicyWindow.Buffercalloc(int capacity)Returns a newCUaccessPolicyWindow.Bufferinstance allocated withmemCalloc.static CUaccessPolicyWindow.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newCUaccessPolicyWindow.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static CUaccessPolicyWindowcalloc(org.lwjgl.system.MemoryStack stack)Returns a newCUaccessPolicyWindowinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static CUaccessPolicyWindowcreate()Returns a newCUaccessPolicyWindowinstance allocated withBufferUtils.static CUaccessPolicyWindow.Buffercreate(int capacity)Returns a newCUaccessPolicyWindow.Bufferinstance allocated withBufferUtils.static CUaccessPolicyWindowcreate(long address)Returns a newCUaccessPolicyWindowinstance for the specified memory address.static CUaccessPolicyWindow.Buffercreate(long address, int capacity)Create aCUaccessPolicyWindow.Bufferinstance at the specified memory.static CUaccessPolicyWindowcreateSafe(long address)static CUaccessPolicyWindow.BuffercreateSafe(long address, int capacity)inthitProp()CUaccessPropertyset for hitCUaccessPolicyWindowhitProp(int value)Sets the specified value to thehitProp()field.floathitRatio()specifies percentage of lines assignedhitProp, rest are assignedmissPropCUaccessPolicyWindowhitRatio(float value)Sets the specified value to thehitRatio()field.static CUaccessPolicyWindowmalloc()Returns a newCUaccessPolicyWindowinstance allocated withmemAlloc.static CUaccessPolicyWindow.Buffermalloc(int capacity)Returns a newCUaccessPolicyWindow.Bufferinstance allocated withmemAlloc.static CUaccessPolicyWindow.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newCUaccessPolicyWindow.Bufferinstance allocated on the specifiedMemoryStack.static CUaccessPolicyWindowmalloc(org.lwjgl.system.MemoryStack stack)Returns a newCUaccessPolicyWindowinstance allocated on the specifiedMemoryStack.intmissProp()CUaccessPropertyset for miss.CUaccessPolicyWindowmissProp(int value)Sets the specified value to themissProp()field.static longnbase_ptr(long struct)Unsafe version ofbase_ptr().static voidnbase_ptr(long struct, long value)Unsafe version ofbase_ptr.static intnhitProp(long struct)Unsafe version ofhitProp().static voidnhitProp(long struct, int value)Unsafe version ofhitProp.static floatnhitRatio(long struct)Unsafe version ofhitRatio().static voidnhitRatio(long struct, float value)Unsafe version ofhitRatio.static intnmissProp(long struct)Unsafe version ofmissProp().static voidnmissProp(long struct, int value)Unsafe version ofmissProp.static longnnum_bytes(long struct)Unsafe version ofnum_bytes().static voidnnum_bytes(long struct, long value)Unsafe version ofnum_bytes.longnum_bytes()size in bytes of the window policy.CUaccessPolicyWindownum_bytes(long value)Sets the specified value to thenum_bytes()field.CUaccessPolicyWindowset(long base_ptr, long num_bytes, float hitRatio, int hitProp, int missProp)Initializes this struct with the specified values.CUaccessPolicyWindowset(CUaccessPolicyWindow src)Copies the specified struct data to this struct.intsizeof()static voidvalidate(long struct)Validates pointer members that should not beNULL.
-
-
-
Constructor Detail
-
CUaccessPolicyWindow
public CUaccessPolicyWindow(java.nio.ByteBuffer container)
Creates aCUaccessPolicyWindowinstance 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
-
base_ptr
public long base_ptr()
starting address of the access policy window. CUDA driver may align it.
-
num_bytes
public long num_bytes()
size in bytes of the window policy. CUDA driver may restrict the maximum size and alignment.
-
hitRatio
public float hitRatio()
specifies percentage of lines assignedhitProp, rest are assignedmissProp
-
hitProp
public int hitProp()
CUaccessPropertyset for hit
-
missProp
public int missProp()
-
base_ptr
public CUaccessPolicyWindow base_ptr(long value)
Sets the specified value to thebase_ptr()field.
-
num_bytes
public CUaccessPolicyWindow num_bytes(long value)
Sets the specified value to thenum_bytes()field.
-
hitRatio
public CUaccessPolicyWindow hitRatio(float value)
Sets the specified value to thehitRatio()field.
-
hitProp
public CUaccessPolicyWindow hitProp(int value)
Sets the specified value to thehitProp()field.
-
missProp
public CUaccessPolicyWindow missProp(int value)
Sets the specified value to themissProp()field.
-
set
public CUaccessPolicyWindow set(long base_ptr, long num_bytes, float hitRatio, int hitProp, int missProp)
Initializes this struct with the specified values.
-
set
public CUaccessPolicyWindow set(CUaccessPolicyWindow src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static CUaccessPolicyWindow malloc()
Returns a newCUaccessPolicyWindowinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static CUaccessPolicyWindow calloc()
Returns a newCUaccessPolicyWindowinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static CUaccessPolicyWindow create()
Returns a newCUaccessPolicyWindowinstance allocated withBufferUtils.
-
create
public static CUaccessPolicyWindow create(long address)
Returns a newCUaccessPolicyWindowinstance for the specified memory address.
-
createSafe
@Nullable public static CUaccessPolicyWindow createSafe(long address)
-
malloc
public static CUaccessPolicyWindow.Buffer malloc(int capacity)
Returns a newCUaccessPolicyWindow.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static CUaccessPolicyWindow.Buffer calloc(int capacity)
Returns a newCUaccessPolicyWindow.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static CUaccessPolicyWindow.Buffer create(int capacity)
Returns a newCUaccessPolicyWindow.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static CUaccessPolicyWindow.Buffer create(long address, int capacity)
Create aCUaccessPolicyWindow.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static CUaccessPolicyWindow.Buffer createSafe(long address, int capacity)
-
malloc
public static CUaccessPolicyWindow malloc(org.lwjgl.system.MemoryStack stack)
Returns a newCUaccessPolicyWindowinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static CUaccessPolicyWindow calloc(org.lwjgl.system.MemoryStack stack)
Returns a newCUaccessPolicyWindowinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static CUaccessPolicyWindow.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newCUaccessPolicyWindow.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static CUaccessPolicyWindow.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newCUaccessPolicyWindow.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nbase_ptr
public static long nbase_ptr(long struct)
Unsafe version ofbase_ptr().
-
nnum_bytes
public static long nnum_bytes(long struct)
Unsafe version ofnum_bytes().
-
nhitRatio
public static float nhitRatio(long struct)
Unsafe version ofhitRatio().
-
nhitProp
public static int nhitProp(long struct)
Unsafe version ofhitProp().
-
nmissProp
public static int nmissProp(long struct)
Unsafe version ofmissProp().
-
nbase_ptr
public static void nbase_ptr(long struct, long value)Unsafe version ofbase_ptr.
-
nnum_bytes
public static void nnum_bytes(long struct, long value)Unsafe version ofnum_bytes.
-
nhitRatio
public static void nhitRatio(long struct, float value)Unsafe version ofhitRatio.
-
nhitProp
public static void nhitProp(long struct, int value)Unsafe version ofhitProp.
-
nmissProp
public static void nmissProp(long struct, int value)Unsafe version ofmissProp.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-
-