org.apache.sysml.runtime.instructions.gpu.context

Class ExecutionConfig

  • java.lang.Object
    • org.apache.sysml.runtime.instructions.gpu.context.ExecutionConfig


  • public class ExecutionConfig
    extends Object
    Java Wrapper to specify CUDA execution configuration for launching custom kernels
    • Field Detail

      • gridDimX

        public int gridDimX
      • gridDimY

        public int gridDimY
      • gridDimZ

        public int gridDimZ
      • blockDimX

        public int blockDimX
      • blockDimY

        public int blockDimY
      • blockDimZ

        public int blockDimZ
      • sharedMemBytes

        public int sharedMemBytes
      • stream

        public jcuda.driver.CUstream stream
    • Constructor Detail

      • ExecutionConfig

        public ExecutionConfig(int gridDimX,
                               int blockDimX,
                               int sharedMemBytes)
        Convenience constructor for setting the number of blocks, number of threads and the shared memory size
        Parameters:
        gridDimX - Number of blocks (for CUDA Kernel)
        blockDimX - Number of threads per block (for CUDA Kernel)
        sharedMemBytes - Amount of Shared memory (for CUDA Kernel)
      • ExecutionConfig

        public ExecutionConfig(int gridDimX,
                               int blockDimX)
      • ExecutionConfig

        public ExecutionConfig(int gridDimX,
                               int gridDimY,
                               int blockDimX,
                               int blockDimY)
    • Method Detail

      • getConfigForSimpleVectorOperations

        public static ExecutionConfig getConfigForSimpleVectorOperations(int numCells)
                                                                  throws DMLRuntimeException
        Use this for simple vector operations and use following in the kernel int index = blockIdx.x * blockDim.x + threadIdx.x

        This tries to schedule as minimum grids as possible.

        Parameters:
        numCells - number of cells
        Returns:
        execution configuration
        Throws:
        DMLRuntimeException - if DMLRuntimeException occurs
      • getConfigForMatrixOperations

        public static ExecutionConfig getConfigForMatrixOperations(int rlen,
                                                                   int clen)
                                                            throws DMLRuntimeException
        Use this for simple matrix operations and use following in the kernel int ix = blockIdx.x * blockDim.x + threadIdx.x; int iy = blockIdx.y * blockDim.y + threadIdx.y;

        This tries to schedule as minimum grids as possible.

        Parameters:
        rlen - number of rows
        clen - number of columns
        Returns:
        execution configuration
        Throws:
        DMLRuntimeException - if DMLRuntimeException occurs
      • getConfigForSimpleMatrixOperations

        public static ExecutionConfig getConfigForSimpleMatrixOperations(int rlen,
                                                                         int clen)
                                                                  throws DMLRuntimeException
        Use this for simple vector operations and use following in the kernel int index = blockIdx.x * blockDim.x + threadIdx.x

        Parameters:
        rlen - number of rows
        clen - number of columns
        Returns:
        execution configuration
        Throws:
        DMLRuntimeException - if DMLRuntimeException occurs

Copyright © 2017 The Apache Software Foundation. All rights reserved.