Class CUDA_LAUNCH_PARAMS

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

    public class CUDA_LAUNCH_PARAMS
    extends Struct
    implements NativeResource
    Kernel launch parameters.

    Member documentation

    • function – Kernel to launch
    • gridDimX – Width of grid in blocks
    • gridDimY – Height of grid in blocks
    • gridDimZ – Depth of grid in blocks
    • blockDimX – X dimension of each thread block
    • blockDimY – Y dimension of each thread block
    • blockDimZ – Z dimension of each thread block
    • sharedMemBytes – Dynamic shared-memory size per thread block in bytes
    • hStream – Stream identifier
    • kernelParams – Array of pointers to kernel parameters

    Layout

    
     struct CUDA_LAUNCH_PARAMS {
         CUfunction function;
         unsigned int gridDimX;
         unsigned int gridDimY;
         unsigned int gridDimZ;
         unsigned int blockDimX;
         unsigned int blockDimY;
         unsigned int blockDimZ;
         unsigned int sharedMemBytes;
         CUstream hStream;
         void ** kernelParams;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • FUNCTION, GRIDDIMX, GRIDDIMY, GRIDDIMZ, BLOCKDIMX, BLOCKDIMY, BLOCKDIMZ, SHAREDMEMBYTES, HSTREAM, KERNELPARAMS

        The struct member offsets.
    • Constructor Detail

      • CUDA_LAUNCH_PARAMS

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

        public long function()
        Returns the value of the function field.
      • gridDimX

        public int gridDimX()
        Returns the value of the gridDimX field.
      • gridDimY

        public int gridDimY()
        Returns the value of the gridDimY field.
      • gridDimZ

        public int gridDimZ()
        Returns the value of the gridDimZ field.
      • blockDimX

        public int blockDimX()
        Returns the value of the blockDimX field.
      • blockDimY

        public int blockDimY()
        Returns the value of the blockDimY field.
      • blockDimZ

        public int blockDimZ()
        Returns the value of the blockDimZ field.
      • sharedMemBytes

        public int sharedMemBytes()
        Returns the value of the sharedMemBytes field.
      • hStream

        public long hStream()
        Returns the value of the hStream field.
      • kernelParams

        public PointerBuffer kernelParams​(int capacity)
        Returns a PointerBuffer view of the data pointed to by the kernelParams field.
        Parameters:
        capacity - the number of elements in the returned buffer
      • function

        public CUDA_LAUNCH_PARAMS function​(long value)
        Sets the specified value to the function field.
      • gridDimX

        public CUDA_LAUNCH_PARAMS gridDimX​(int value)
        Sets the specified value to the gridDimX field.
      • gridDimY

        public CUDA_LAUNCH_PARAMS gridDimY​(int value)
        Sets the specified value to the gridDimY field.
      • gridDimZ

        public CUDA_LAUNCH_PARAMS gridDimZ​(int value)
        Sets the specified value to the gridDimZ field.
      • blockDimX

        public CUDA_LAUNCH_PARAMS blockDimX​(int value)
        Sets the specified value to the blockDimX field.
      • blockDimY

        public CUDA_LAUNCH_PARAMS blockDimY​(int value)
        Sets the specified value to the blockDimY field.
      • blockDimZ

        public CUDA_LAUNCH_PARAMS blockDimZ​(int value)
        Sets the specified value to the blockDimZ field.
      • sharedMemBytes

        public CUDA_LAUNCH_PARAMS sharedMemBytes​(int value)
        Sets the specified value to the sharedMemBytes field.
      • hStream

        public CUDA_LAUNCH_PARAMS hStream​(long value)
        Sets the specified value to the hStream field.
      • set

        public CUDA_LAUNCH_PARAMS set​(long function,
                                      int gridDimX,
                                      int gridDimY,
                                      int gridDimZ,
                                      int blockDimX,
                                      int blockDimY,
                                      int blockDimZ,
                                      int sharedMemBytes,
                                      long hStream,
                                      PointerBuffer kernelParams)
        Initializes this struct with the specified values.
      • malloc

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

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

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

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

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

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

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

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

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

        public static long nfunction​(long struct)
        Unsafe version of function().
      • ngridDimX

        public static int ngridDimX​(long struct)
        Unsafe version of gridDimX().
      • ngridDimY

        public static int ngridDimY​(long struct)
        Unsafe version of gridDimY().
      • ngridDimZ

        public static int ngridDimZ​(long struct)
        Unsafe version of gridDimZ().
      • nblockDimX

        public static int nblockDimX​(long struct)
        Unsafe version of blockDimX().
      • nblockDimY

        public static int nblockDimY​(long struct)
        Unsafe version of blockDimY().
      • nblockDimZ

        public static int nblockDimZ​(long struct)
        Unsafe version of blockDimZ().
      • nsharedMemBytes

        public static int nsharedMemBytes​(long struct)
        Unsafe version of sharedMemBytes().
      • nhStream

        public static long nhStream​(long struct)
        Unsafe version of hStream().
      • nfunction

        public static void nfunction​(long struct,
                                     long value)
        Unsafe version of function.
      • ngridDimX

        public static void ngridDimX​(long struct,
                                     int value)
        Unsafe version of gridDimX.
      • ngridDimY

        public static void ngridDimY​(long struct,
                                     int value)
        Unsafe version of gridDimY.
      • ngridDimZ

        public static void ngridDimZ​(long struct,
                                     int value)
        Unsafe version of gridDimZ.
      • nblockDimX

        public static void nblockDimX​(long struct,
                                      int value)
        Unsafe version of blockDimX.
      • nblockDimY

        public static void nblockDimY​(long struct,
                                      int value)
        Unsafe version of blockDimY.
      • nblockDimZ

        public static void nblockDimZ​(long struct,
                                      int value)
        Unsafe version of blockDimZ.
      • nsharedMemBytes

        public static void nsharedMemBytes​(long struct,
                                           int value)
        Unsafe version of sharedMemBytes.
      • nhStream

        public static void nhStream​(long struct,
                                    long value)
        Unsafe version of hStream.
      • 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