Class CUDA_MEMCPY2D

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

    public class CUDA_MEMCPY2D
    extends Struct
    implements NativeResource
    2D memory copy parameters.

    Member documentation

    • srcXInBytes – Source X in bytes
    • srcY – Source Y
    • srcMemoryType – Source memory type (host, device, array)
    • srcHost – Source host pointer
    • srcDevice – Source device pointer
    • srcArray – Source array reference
    • srcPitch – Source pitch (ignored when src is array)
    • dstXInBytes – Destination X in bytes
    • dstY – Destination Y
    • dstMemoryType – Destination memory type (host, device, array)
    • dstHost – Destination host pointer
    • dstDevice – Destination device pointer
    • dstArray – Destination array reference
    • dstPitch – Destination pitch (ignored when dst is array)
    • WidthInBytes – Width of 2D memory copy in bytes
    • Height – Height of 2D memory copy

    Layout

    
     struct CUDA_MEMCPY2D {
         size_t srcXInBytes;
         size_t srcY;
         CUmemorytype srcMemoryType;
         void const * srcHost;
         CUdeviceptr srcDevice;
         CUarray srcArray;
         size_t srcPitch;
         size_t dstXInBytes;
         size_t dstY;
         CUmemorytype dstMemoryType;
         void * dstHost;
         CUdeviceptr dstDevice;
         CUarray dstArray;
         size_t dstPitch;
         size_t WidthInBytes;
         size_t Height;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • SRCXINBYTES, SRCY, SRCMEMORYTYPE, SRCHOST, SRCDEVICE, SRCARRAY, SRCPITCH, DSTXINBYTES, DSTY, DSTMEMORYTYPE, DSTHOST, DSTDEVICE, DSTARRAY, DSTPITCH, WIDTHINBYTES, HEIGHT

        The struct member offsets.
    • Constructor Detail

      • CUDA_MEMCPY2D

        public CUDA_MEMCPY2D​(java.nio.ByteBuffer container)
        Creates a CUDA_MEMCPY2D 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
      • srcXInBytes

        public long srcXInBytes()
        Returns the value of the srcXInBytes field.
      • srcY

        public long srcY()
        Returns the value of the srcY field.
      • srcMemoryType

        public int srcMemoryType()
        Returns the value of the srcMemoryType field.
      • srcHost

        public java.nio.ByteBuffer srcHost​(int capacity)
        Returns a ByteBuffer view of the data pointed to by the srcHost field.
        Parameters:
        capacity - the number of elements in the returned buffer
      • srcDevice

        public long srcDevice()
        Returns the value of the srcDevice field.
      • srcArray

        public long srcArray()
        Returns the value of the srcArray field.
      • srcPitch

        public long srcPitch()
        Returns the value of the srcPitch field.
      • dstXInBytes

        public long dstXInBytes()
        Returns the value of the dstXInBytes field.
      • dstY

        public long dstY()
        Returns the value of the dstY field.
      • dstMemoryType

        public int dstMemoryType()
        Returns the value of the dstMemoryType field.
      • dstHost

        public java.nio.ByteBuffer dstHost​(int capacity)
        Returns a ByteBuffer view of the data pointed to by the dstHost field.
        Parameters:
        capacity - the number of elements in the returned buffer
      • dstDevice

        public long dstDevice()
        Returns the value of the dstDevice field.
      • dstArray

        public long dstArray()
        Returns the value of the dstArray field.
      • dstPitch

        public long dstPitch()
        Returns the value of the dstPitch field.
      • WidthInBytes

        public long WidthInBytes()
        Returns the value of the WidthInBytes field.
      • Height

        public long Height()
        Returns the value of the Height field.
      • srcXInBytes

        public CUDA_MEMCPY2D srcXInBytes​(long value)
        Sets the specified value to the srcXInBytes field.
      • srcY

        public CUDA_MEMCPY2D srcY​(long value)
        Sets the specified value to the srcY field.
      • srcMemoryType

        public CUDA_MEMCPY2D srcMemoryType​(int value)
        Sets the specified value to the srcMemoryType field.
      • srcHost

        public CUDA_MEMCPY2D srcHost​(java.nio.ByteBuffer value)
        Sets the address of the specified ByteBuffer to the srcHost field.
      • srcDevice

        public CUDA_MEMCPY2D srcDevice​(long value)
        Sets the specified value to the srcDevice field.
      • srcArray

        public CUDA_MEMCPY2D srcArray​(long value)
        Sets the specified value to the srcArray field.
      • srcPitch

        public CUDA_MEMCPY2D srcPitch​(long value)
        Sets the specified value to the srcPitch field.
      • dstXInBytes

        public CUDA_MEMCPY2D dstXInBytes​(long value)
        Sets the specified value to the dstXInBytes field.
      • dstY

        public CUDA_MEMCPY2D dstY​(long value)
        Sets the specified value to the dstY field.
      • dstMemoryType

        public CUDA_MEMCPY2D dstMemoryType​(int value)
        Sets the specified value to the dstMemoryType field.
      • dstHost

        public CUDA_MEMCPY2D dstHost​(java.nio.ByteBuffer value)
        Sets the address of the specified ByteBuffer to the dstHost field.
      • dstDevice

        public CUDA_MEMCPY2D dstDevice​(long value)
        Sets the specified value to the dstDevice field.
      • dstArray

        public CUDA_MEMCPY2D dstArray​(long value)
        Sets the specified value to the dstArray field.
      • dstPitch

        public CUDA_MEMCPY2D dstPitch​(long value)
        Sets the specified value to the dstPitch field.
      • WidthInBytes

        public CUDA_MEMCPY2D WidthInBytes​(long value)
        Sets the specified value to the WidthInBytes field.
      • Height

        public CUDA_MEMCPY2D Height​(long value)
        Sets the specified value to the Height field.
      • set

        public CUDA_MEMCPY2D set​(long srcXInBytes,
                                 long srcY,
                                 int srcMemoryType,
                                 java.nio.ByteBuffer srcHost,
                                 long srcDevice,
                                 long srcArray,
                                 long srcPitch,
                                 long dstXInBytes,
                                 long dstY,
                                 int dstMemoryType,
                                 java.nio.ByteBuffer dstHost,
                                 long dstDevice,
                                 long dstArray,
                                 long dstPitch,
                                 long WidthInBytes,
                                 long Height)
        Initializes this struct with the specified values.
      • set

        public CUDA_MEMCPY2D set​(CUDA_MEMCPY2D src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • malloc

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

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

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

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

        public static CUDA_MEMCPY2D.Buffer create​(long address,
                                                  int capacity)
        Create a CUDA_MEMCPY2D.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

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

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

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

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

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

        public static long nsrcXInBytes​(long struct)
        Unsafe version of srcXInBytes().
      • nsrcY

        public static long nsrcY​(long struct)
        Unsafe version of srcY().
      • nsrcMemoryType

        public static int nsrcMemoryType​(long struct)
        Unsafe version of srcMemoryType().
      • nsrcHost

        public static java.nio.ByteBuffer nsrcHost​(long struct,
                                                   int capacity)
        Unsafe version of srcHost.
      • nsrcDevice

        public static long nsrcDevice​(long struct)
        Unsafe version of srcDevice().
      • nsrcArray

        public static long nsrcArray​(long struct)
        Unsafe version of srcArray().
      • nsrcPitch

        public static long nsrcPitch​(long struct)
        Unsafe version of srcPitch().
      • ndstXInBytes

        public static long ndstXInBytes​(long struct)
        Unsafe version of dstXInBytes().
      • ndstY

        public static long ndstY​(long struct)
        Unsafe version of dstY().
      • ndstMemoryType

        public static int ndstMemoryType​(long struct)
        Unsafe version of dstMemoryType().
      • ndstHost

        public static java.nio.ByteBuffer ndstHost​(long struct,
                                                   int capacity)
        Unsafe version of dstHost.
      • ndstDevice

        public static long ndstDevice​(long struct)
        Unsafe version of dstDevice().
      • ndstArray

        public static long ndstArray​(long struct)
        Unsafe version of dstArray().
      • ndstPitch

        public static long ndstPitch​(long struct)
        Unsafe version of dstPitch().
      • nWidthInBytes

        public static long nWidthInBytes​(long struct)
        Unsafe version of WidthInBytes().
      • nHeight

        public static long nHeight​(long struct)
        Unsafe version of Height().
      • nsrcXInBytes

        public static void nsrcXInBytes​(long struct,
                                        long value)
        Unsafe version of srcXInBytes.
      • nsrcY

        public static void nsrcY​(long struct,
                                 long value)
        Unsafe version of srcY.
      • nsrcMemoryType

        public static void nsrcMemoryType​(long struct,
                                          int value)
        Unsafe version of srcMemoryType.
      • nsrcHost

        public static void nsrcHost​(long struct,
                                    java.nio.ByteBuffer value)
        Unsafe version of srcHost.
      • nsrcDevice

        public static void nsrcDevice​(long struct,
                                      long value)
        Unsafe version of srcDevice.
      • nsrcArray

        public static void nsrcArray​(long struct,
                                     long value)
        Unsafe version of srcArray.
      • nsrcPitch

        public static void nsrcPitch​(long struct,
                                     long value)
        Unsafe version of srcPitch.
      • ndstXInBytes

        public static void ndstXInBytes​(long struct,
                                        long value)
        Unsafe version of dstXInBytes.
      • ndstY

        public static void ndstY​(long struct,
                                 long value)
        Unsafe version of dstY.
      • ndstMemoryType

        public static void ndstMemoryType​(long struct,
                                          int value)
        Unsafe version of dstMemoryType.
      • ndstHost

        public static void ndstHost​(long struct,
                                    java.nio.ByteBuffer value)
        Unsafe version of dstHost.
      • ndstDevice

        public static void ndstDevice​(long struct,
                                      long value)
        Unsafe version of dstDevice.
      • ndstArray

        public static void ndstArray​(long struct,
                                     long value)
        Unsafe version of dstArray.
      • ndstPitch

        public static void ndstPitch​(long struct,
                                     long value)
        Unsafe version of dstPitch.
      • nWidthInBytes

        public static void nWidthInBytes​(long struct,
                                         long value)
        Unsafe version of WidthInBytes.
      • nHeight

        public static void nHeight​(long struct,
                                   long value)
        Unsafe version of Height.
      • validate

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

        public static void validate​(long array,
                                    int count)
        Calls validate(long) for each struct contained in the specified struct array.
        Parameters:
        array - the struct array to validate
        count - the number of structs in array