Module openj9.cuda
Package com.ibm.cuda

Class CudaGrid


  • public final class CudaGrid
    extends Object
    The CudaGrid class represents a kernel launch configuration.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int blockDimX
      The size of the thread block in the x dimension.
      int blockDimY
      The size of the thread block in the y dimension.
      int blockDimZ
      The size of the thread block in the z dimension.
      int gridDimX
      The size of the grid in the x dimension.
      int gridDimY
      The size of the grid in the y dimension.
      int gridDimZ
      The size of the grid in the z dimension.
      int sharedMemBytes
      The number of bytes of shared memory to allocate to each thread block.
      CudaStream stream
      The stream on which the kernel should be queued (or null for the default stream).
    • Constructor Summary

      Constructors 
      Constructor Description
      CudaGrid​(int gridDim, int blockDim)
      Creates a grid with the specified x dimensions with no shared memory on the default stream.
      CudaGrid​(int gridDim, int blockDim, int sharedMemBytes)
      Creates a grid with the specified x dimensions and shared memory size on the default stream.
      CudaGrid​(int gridDim, int blockDim, int sharedMemBytes, CudaStream stream)
      Creates a grid with the specified x dimensions and shared memory size on the specified stream.
      CudaGrid​(int gridDim, int blockDim, CudaStream stream)
      Creates a grid with the specified x dimensions with no shared memory on the specified stream.
      CudaGrid​(Dim3 gridDim, Dim3 blockDim)
      Creates a grid with the specified dimensions, with no shared memory on the default stream.
      CudaGrid​(Dim3 gridDim, Dim3 blockDim, int sharedMemBytes)
      Creates a grid with the specified dimensions and shared memory size on the default stream.
      CudaGrid​(Dim3 gridDim, Dim3 blockDim, int sharedMemBytes, CudaStream stream)
      Creates a grid with the specified dimensions and shared memory size on the specified stream.
      CudaGrid​(Dim3 gridDim, Dim3 blockDim, CudaStream stream)
      Creates a grid with the specified dimensions with no shared memory on the specified stream.
    • Field Detail

      • blockDimX

        public final int blockDimX
        The size of the thread block in the x dimension.
      • blockDimY

        public final int blockDimY
        The size of the thread block in the y dimension.
      • blockDimZ

        public final int blockDimZ
        The size of the thread block in the z dimension.
      • gridDimX

        public final int gridDimX
        The size of the grid in the x dimension.
      • gridDimY

        public final int gridDimY
        The size of the grid in the y dimension.
      • gridDimZ

        public final int gridDimZ
        The size of the grid in the z dimension.
      • sharedMemBytes

        public final int sharedMemBytes
        The number of bytes of shared memory to allocate to each thread block.
      • stream

        public final CudaStream stream
        The stream on which the kernel should be queued (or null for the default stream).
    • Constructor Detail

      • CudaGrid

        public CudaGrid​(Dim3 gridDim,
                        Dim3 blockDim)
        Creates a grid with the specified dimensions, with no shared memory on the default stream.
        Parameters:
        gridDim - the dimensions of the grid
        blockDim - the dimensions of the thread block
      • CudaGrid

        public CudaGrid​(Dim3 gridDim,
                        Dim3 blockDim,
                        CudaStream stream)
        Creates a grid with the specified dimensions with no shared memory on the specified stream.
        Parameters:
        gridDim - the dimensions of the grid
        blockDim - the dimensions of the thread block
        stream - the stream on which the kernel should be queued (or null for the default stream)
      • CudaGrid

        public CudaGrid​(Dim3 gridDim,
                        Dim3 blockDim,
                        int sharedMemBytes)
        Creates a grid with the specified dimensions and shared memory size on the default stream.
        Parameters:
        gridDim - the dimensions of the grid
        blockDim - the dimensions of the thread block
        sharedMemBytes - the number of bytes of shared memory to allocate to each thread block
      • CudaGrid

        public CudaGrid​(Dim3 gridDim,
                        Dim3 blockDim,
                        int sharedMemBytes,
                        CudaStream stream)
        Creates a grid with the specified dimensions and shared memory size on the specified stream.
        Parameters:
        gridDim - the dimensions of the grid
        blockDim - the dimensions of the thread block
        sharedMemBytes - the number of bytes of shared memory to allocate to each thread block
        stream - the stream on which the kernel should be queued (or null for the default stream)
      • CudaGrid

        public CudaGrid​(int gridDim,
                        int blockDim)
        Creates a grid with the specified x dimensions with no shared memory on the default stream. The y and z dimensions are set to 1.
        Parameters:
        gridDim - the x dimension of the grid
        blockDim - the x dimension of the thread block
      • CudaGrid

        public CudaGrid​(int gridDim,
                        int blockDim,
                        CudaStream stream)
        Creates a grid with the specified x dimensions with no shared memory on the specified stream. The y and z dimensions are set to 1.
        Parameters:
        gridDim - the x dimension of the grid
        blockDim - the x dimension of the thread block
        stream - the stream on which the kernel should be queued (or null for the default stream)
      • CudaGrid

        public CudaGrid​(int gridDim,
                        int blockDim,
                        int sharedMemBytes)
        Creates a grid with the specified x dimensions and shared memory size on the default stream. The y and z dimensions are set to 1.
        Parameters:
        gridDim - the x dimension of the grid
        blockDim - the x dimension of the thread block
        sharedMemBytes - the number of bytes of shared memory to allocate to each thread block
      • CudaGrid

        public CudaGrid​(int gridDim,
                        int blockDim,
                        int sharedMemBytes,
                        CudaStream stream)
        Creates a grid with the specified x dimensions and shared memory size on the specified stream. The y and z dimensions are set to 1.
        Parameters:
        gridDim - the x dimension of the grid
        blockDim - the x dimension of the thread block
        sharedMemBytes - the number of bytes of shared memory to allocate to each thread block
        stream - the stream on which the kernel should be queued (or null for the default stream)