Class CUDA_RESOURCE_DESC

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

    public class CUDA_RESOURCE_DESC
    extends Struct
    implements NativeResource
    CUDA Resource descriptor.

    Member documentation

    • resType – Resource type
    • res
      • res.array
        • res.array.hArray – CUDA array
      • res.mipmap
        • res.mipmap.hMipmappedArray – CUDA mipmapped array
      • res.linear
        • res.linear.devPtr – Device pointer
        • res.linear.format – Array format
        • res.linear.numChannels – Channels per array element
        • res.linear.sizeInBytes – Size in bytes
      • res.pitch2D
        • res.pitch2D.devPtr – Device pointer
        • res.pitch2D.format – Array format
        • res.pitch2D.numChannels – Channels per array element
        • res.pitch2D.width – Width of the array in elements
        • res.pitch2D.height – Height of the array in elements
        • res.pitch2D.pitchInBytes – Pitch between two rows in bytes
    • flags – Flags (must be zero)

    Layout

    
     struct CUDA_RESOURCE_DESC {
         CUresourcetype resType;
         union {
             struct {
                 CUarray hArray;
             } array;
             struct {
                 CUmipmappedArray hMipmappedArray;
             } mipmap;
             struct {
                 CUdeviceptr devPtr;
                 CUarray_format format;
                 unsigned int numChannels;
                 size_t sizeInBytes;
             } linear;
             struct {
                 CUdeviceptr devPtr;
                 CUarray_format format;
                 unsigned int numChannels;
                 size_t width;
                 size_t height;
                 size_t pitchInBytes;
             } pitch2D;
             struct {
                 int reserved[32];
             } reserved;
         } res;
         unsigned int flags;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • RESTYPE, RES, RES_ARRAY, RES_ARRAY_HARRAY, RES_MIPMAP, RES_MIPMAP_HMIPMAPPEDARRAY, RES_LINEAR, RES_LINEAR_DEVPTR, RES_LINEAR_FORMAT, RES_LINEAR_NUMCHANNELS, RES_LINEAR_SIZEINBYTES, RES_PITCH2D, RES_PITCH2D_DEVPTR, RES_PITCH2D_FORMAT, RES_PITCH2D_NUMCHANNELS, RES_PITCH2D_WIDTH, RES_PITCH2D_HEIGHT, RES_PITCH2D_PITCHINBYTES, RES_RESERVED, RES_RESERVED_RESERVED, FLAGS

        The struct member offsets.
    • Constructor Detail

      • CUDA_RESOURCE_DESC

        public CUDA_RESOURCE_DESC​(java.nio.ByteBuffer container)
        Creates a CUDA_RESOURCE_DESC 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()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • resType

        public int resType()
        Returns the value of the resType field.
      • res_array_hArray

        public long res_array_hArray()
        Returns the value of the res.array.hArray field.
      • res_mipmap_hMipmappedArray

        public long res_mipmap_hMipmappedArray()
        Returns the value of the res.mipmap.hMipmappedArray field.
      • res_linear_devPtr

        public long res_linear_devPtr()
        Returns the value of the res.linear.devPtr field.
      • res_linear_format

        public int res_linear_format()
        Returns the value of the res.linear.format field.
      • res_linear_numChannels

        public int res_linear_numChannels()
        Returns the value of the res.linear.numChannels field.
      • res_linear_sizeInBytes

        public long res_linear_sizeInBytes()
        Returns the value of the res.linear.sizeInBytes field.
      • res_pitch2D_devPtr

        public long res_pitch2D_devPtr()
        Returns the value of the res.pitch2D.devPtr field.
      • res_pitch2D_format

        public int res_pitch2D_format()
        Returns the value of the res.pitch2D.format field.
      • res_pitch2D_numChannels

        public int res_pitch2D_numChannels()
        Returns the value of the res.pitch2D.numChannels field.
      • res_pitch2D_width

        public long res_pitch2D_width()
        Returns the value of the res.pitch2D.width field.
      • res_pitch2D_height

        public long res_pitch2D_height()
        Returns the value of the res.pitch2D.height field.
      • res_pitch2D_pitchInBytes

        public long res_pitch2D_pitchInBytes()
        Returns the value of the res.pitch2D.pitchInBytes field.
      • res_reserved_reserved

        public java.nio.IntBuffer res_reserved_reserved()
        Returns a IntBuffer view of the res.reserved.reserved field.
      • res_reserved_reserved

        public int res_reserved_reserved​(int index)
        Returns the value at the specified index of the res.reserved.reserved field.
      • flags

        public int flags()
        Returns the value of the flags field.
      • resType

        public CUDA_RESOURCE_DESC resType​(int value)
        Sets the specified value to the resType field.
      • res_array_hArray

        public CUDA_RESOURCE_DESC res_array_hArray​(long value)
        Sets the specified value to the res.array.hArray field.
      • res_mipmap_hMipmappedArray

        public CUDA_RESOURCE_DESC res_mipmap_hMipmappedArray​(long value)
        Sets the specified value to the res.mipmap.hMipmappedArray field.
      • res_linear_devPtr

        public CUDA_RESOURCE_DESC res_linear_devPtr​(long value)
        Sets the specified value to the res.linear.devPtr field.
      • res_linear_format

        public CUDA_RESOURCE_DESC res_linear_format​(int value)
        Sets the specified value to the res.linear.format field.
      • res_linear_numChannels

        public CUDA_RESOURCE_DESC res_linear_numChannels​(int value)
        Sets the specified value to the res.linear.numChannels field.
      • res_linear_sizeInBytes

        public CUDA_RESOURCE_DESC res_linear_sizeInBytes​(long value)
        Sets the specified value to the res.linear.sizeInBytes field.
      • res_pitch2D_devPtr

        public CUDA_RESOURCE_DESC res_pitch2D_devPtr​(long value)
        Sets the specified value to the res.pitch2D.devPtr field.
      • res_pitch2D_format

        public CUDA_RESOURCE_DESC res_pitch2D_format​(int value)
        Sets the specified value to the res.pitch2D.format field.
      • res_pitch2D_numChannels

        public CUDA_RESOURCE_DESC res_pitch2D_numChannels​(int value)
        Sets the specified value to the res.pitch2D.numChannels field.
      • res_pitch2D_width

        public CUDA_RESOURCE_DESC res_pitch2D_width​(long value)
        Sets the specified value to the res.pitch2D.width field.
      • res_pitch2D_height

        public CUDA_RESOURCE_DESC res_pitch2D_height​(long value)
        Sets the specified value to the res.pitch2D.height field.
      • res_pitch2D_pitchInBytes

        public CUDA_RESOURCE_DESC res_pitch2D_pitchInBytes​(long value)
        Sets the specified value to the res.pitch2D.pitchInBytes field.
      • res_reserved_reserved

        public CUDA_RESOURCE_DESC res_reserved_reserved​(java.nio.IntBuffer value)
        Copies the specified IntBuffer to the res.reserved.reserved field.
      • res_reserved_reserved

        public CUDA_RESOURCE_DESC res_reserved_reserved​(int index,
                                                        int value)
        Sets the specified value at the specified index of the res.reserved.reserved field.
      • flags

        public CUDA_RESOURCE_DESC flags​(int value)
        Sets the specified value to the flags field.
      • malloc

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

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

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

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

        @Nullable
        public static CUDA_RESOURCE_DESC.Buffer createSafe​(long address,
                                                           int capacity)
        Like create, but returns null if address is NULL.
      • mallocStack

        public static CUDA_RESOURCE_DESC mallocStack()
        Returns a new CUDA_RESOURCE_DESC instance allocated on the thread-local MemoryStack.
      • callocStack

        public static CUDA_RESOURCE_DESC callocStack()
        Returns a new CUDA_RESOURCE_DESC instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static CUDA_RESOURCE_DESC mallocStack​(MemoryStack stack)
        Returns a new CUDA_RESOURCE_DESC instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static CUDA_RESOURCE_DESC callocStack​(MemoryStack stack)
        Returns a new CUDA_RESOURCE_DESC instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • nresType

        public static int nresType​(long struct)
        Unsafe version of resType().
      • nres_array_hArray

        public static long nres_array_hArray​(long struct)
        Unsafe version of res_array_hArray().
      • nres_mipmap_hMipmappedArray

        public static long nres_mipmap_hMipmappedArray​(long struct)
        Unsafe version of res_mipmap_hMipmappedArray().
      • nres_linear_devPtr

        public static long nres_linear_devPtr​(long struct)
        Unsafe version of res_linear_devPtr().
      • nres_linear_format

        public static int nres_linear_format​(long struct)
        Unsafe version of res_linear_format().
      • nres_linear_numChannels

        public static int nres_linear_numChannels​(long struct)
        Unsafe version of res_linear_numChannels().
      • nres_linear_sizeInBytes

        public static long nres_linear_sizeInBytes​(long struct)
        Unsafe version of res_linear_sizeInBytes().
      • nres_pitch2D_devPtr

        public static long nres_pitch2D_devPtr​(long struct)
        Unsafe version of res_pitch2D_devPtr().
      • nres_pitch2D_format

        public static int nres_pitch2D_format​(long struct)
        Unsafe version of res_pitch2D_format().
      • nres_pitch2D_numChannels

        public static int nres_pitch2D_numChannels​(long struct)
        Unsafe version of res_pitch2D_numChannels().
      • nres_pitch2D_width

        public static long nres_pitch2D_width​(long struct)
        Unsafe version of res_pitch2D_width().
      • nres_pitch2D_height

        public static long nres_pitch2D_height​(long struct)
        Unsafe version of res_pitch2D_height().
      • nres_pitch2D_pitchInBytes

        public static long nres_pitch2D_pitchInBytes​(long struct)
        Unsafe version of res_pitch2D_pitchInBytes().
      • nres_reserved_reserved

        public static java.nio.IntBuffer nres_reserved_reserved​(long struct)
        Unsafe version of res_reserved_reserved().
      • nres_reserved_reserved

        public static int nres_reserved_reserved​(long struct,
                                                 int index)
        Unsafe version of res_reserved_reserved.
      • nflags

        public static int nflags​(long struct)
        Unsafe version of flags().
      • nresType

        public static void nresType​(long struct,
                                    int value)
        Unsafe version of resType.
      • nres_array_hArray

        public static void nres_array_hArray​(long struct,
                                             long value)
        Unsafe version of res_array_hArray.
      • nres_mipmap_hMipmappedArray

        public static void nres_mipmap_hMipmappedArray​(long struct,
                                                       long value)
        Unsafe version of res_mipmap_hMipmappedArray.
      • nres_linear_devPtr

        public static void nres_linear_devPtr​(long struct,
                                              long value)
        Unsafe version of res_linear_devPtr.
      • nres_linear_format

        public static void nres_linear_format​(long struct,
                                              int value)
        Unsafe version of res_linear_format.
      • nres_linear_numChannels

        public static void nres_linear_numChannels​(long struct,
                                                   int value)
        Unsafe version of res_linear_numChannels.
      • nres_linear_sizeInBytes

        public static void nres_linear_sizeInBytes​(long struct,
                                                   long value)
        Unsafe version of res_linear_sizeInBytes.
      • nres_pitch2D_devPtr

        public static void nres_pitch2D_devPtr​(long struct,
                                               long value)
        Unsafe version of res_pitch2D_devPtr.
      • nres_pitch2D_format

        public static void nres_pitch2D_format​(long struct,
                                               int value)
        Unsafe version of res_pitch2D_format.
      • nres_pitch2D_numChannels

        public static void nres_pitch2D_numChannels​(long struct,
                                                    int value)
        Unsafe version of res_pitch2D_numChannels.
      • nres_pitch2D_width

        public static void nres_pitch2D_width​(long struct,
                                              long value)
        Unsafe version of res_pitch2D_width.
      • nres_pitch2D_height

        public static void nres_pitch2D_height​(long struct,
                                               long value)
        Unsafe version of res_pitch2D_height.
      • nres_pitch2D_pitchInBytes

        public static void nres_pitch2D_pitchInBytes​(long struct,
                                                     long value)
        Unsafe version of res_pitch2D_pitchInBytes.
      • nres_reserved_reserved

        public static void nres_reserved_reserved​(long struct,
                                                  java.nio.IntBuffer value)
        Unsafe version of res_reserved_reserved.
      • nres_reserved_reserved

        public static void nres_reserved_reserved​(long struct,
                                                  int index,
                                                  int value)
        Unsafe version of res_reserved_reserved.
      • nflags

        public static void nflags​(long struct,
                                  int value)
        Unsafe version of flags.