Class 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.NativeResource
    Specifies an access policy for a window, a contiguous extent of memory beginning at base_ptr and ending at base_ptr + num_bytes.

    num_bytes is limited by DEVICE_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_t num_bytes();
         float hitRatio();
         CUaccessProperty hitProp();
         CUaccessProperty missProp();
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • BASE_PTR, NUM_BYTES, HITRATIO, HITPROP, MISSPROP

        The struct member offsets.
    • Constructor Detail

      • CUaccessPolicyWindow

        public CUaccessPolicyWindow​(java.nio.ByteBuffer container)
        Creates a CUaccessPolicyWindow 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
      • 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 assigned hitProp, rest are assigned missProp
      • hitProp

        public int hitProp()
        CUaccessProperty set for hit
      • set

        public CUaccessPolicyWindow set​(long base_ptr,
                                        long num_bytes,
                                        float hitRatio,
                                        int hitProp,
                                        int missProp)
        Initializes this struct with the specified values.
      • malloc

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

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

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

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

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

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

        public static CUaccessPolicyWindow calloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new CUaccessPolicyWindow instance allocated on the specified MemoryStack and 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 new CUaccessPolicyWindow.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • calloc

        public static CUaccessPolicyWindow.Buffer calloc​(int capacity,
                                                         org.lwjgl.system.MemoryStack stack)
        Returns a new CUaccessPolicyWindow.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
      • nbase_ptr

        public static long nbase_ptr​(long struct)
        Unsafe version of base_ptr().
      • nnum_bytes

        public static long nnum_bytes​(long struct)
        Unsafe version of num_bytes().
      • nhitRatio

        public static float nhitRatio​(long struct)
        Unsafe version of hitRatio().
      • nhitProp

        public static int nhitProp​(long struct)
        Unsafe version of hitProp().
      • nmissProp

        public static int nmissProp​(long struct)
        Unsafe version of missProp().
      • nbase_ptr

        public static void nbase_ptr​(long struct,
                                     long value)
        Unsafe version of base_ptr.
      • nnum_bytes

        public static void nnum_bytes​(long struct,
                                      long value)
        Unsafe version of num_bytes.
      • nhitRatio

        public static void nhitRatio​(long struct,
                                     float value)
        Unsafe version of hitRatio.
      • nhitProp

        public static void nhitProp​(long struct,
                                    int value)
        Unsafe version of hitProp.
      • nmissProp

        public static void nmissProp​(long struct,
                                     int value)
        Unsafe version of missProp.
      • validate

        public static void validate​(long struct)
        Validates pointer members that should not be NULL.
        Parameters:
        struct - the struct to validate