nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/blas/impl/BaseLevel3.java
@Override
    public void gemm(char Order, char TransA, char TransB, double alpha, INDArray A, INDArray B, double beta,
                    INDArray C) {
        if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL)
            OpProfiler.getInstance().processBlasCall(true, A, B, C);

        GemmParams params = new GemmParams(A, B, C);

        int charOder = Order;
        if (A.data().dataType() == DataBuffer.Type.DOUBLE) {
            DefaultOpExecutioner.validateDataType(DataBuffer.Type.DOUBLE, params.getA(), params.getB(), params.getC());
            dgemm(Order, params.getTransA(), params.getTransB(), params.getM(), params.getN(), params.getK(), 1.0,
                            params.getA(), params.getLda(), params.getB(), params.getLdb(), 0, C, params.getLdc());
        } else if (A.data().dataType() == DataBuffer.Type.FLOAT) {
            DefaultOpExecutioner.validateDataType(DataBuffer.Type.FLOAT, params.getA(), params.getB(), params.getC());
            sgemm(Order, params.getTransA(), params.getTransB(), params.getM(), params.getN(), params.getK(), 1.0f,
                            params.getA(), params.getLda(), params.getB(), params.getLdb(), 0, C, params.getLdc());
        } else {
            DefaultOpExecutioner.validateDataType(DataBuffer.Type.HALF, params.getA(), params.getB(), params.getC());
            hgemm(Order, params.getTransA(), params.getTransB(), params.getM(), params.getN(), params.getK(), 1.0f,
                            params.getA(), params.getLda(), params.getB(), params.getLdb(), 0, C, params.getLdc());
        }

        OpExecutionerUtil.checkForAny(C);
    }
@Override
    public void gemm(char Order, char TransA, char TransB, double alpha, INDArray A, INDArray B, double beta,
                    INDArray C) {
        if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL)
            OpProfiler.getInstance().processBlasCall(true, A, B, C);

        GemmParams params = new GemmParams(A, B, C);

        int charOder = Order;
        if (A.data().dataType() == DataBuffer.Type.DOUBLE) {
            DefaultOpExecutioner.validateDataType(DataBuffer.Type.DOUBLE, params.getA(), params.getB(), params.getC());
            dgemm(Order, params.getTransA(), params.getTransB(), params.getM(), params.getN(), params.getK(), 1.0,
                            params.getA(), params.getLda(), params.getB(), params.getLdb(), 0, C, params.getLdc());
        } else if (A.data().dataType() == DataBuffer.Type.FLOAT) {
            DefaultOpExecutioner.validateDataType(DataBuffer.Type.FLOAT, params.getA(), params.getB(), params.getC());
            sgemm(Order, params.getTransA(), params.getTransB(), params.getM(), params.getN(), params.getK(), 1.0f,
                            params.getA(), params.getLda(), params.getB(), params.getLdb(), 0, C, params.getLdc());
        } else {
            DefaultOpExecutioner.validateDataType(DataBuffer.Type.HALF, params.getA(), params.getB(), params.getC());
            hgemm(Order, params.getTransA(), params.getTransB(), params.getM(), params.getN(), params.getK(), 1.0f,
                            params.getA(), params.getLda(), params.getB(), params.getLdb(), 0, C, params.getLdc());
        }

        OpExecutionerUtil.checkForAny(C);
    }
@ Override public void gemm ( char Order , char TransA , char TransB , double alpha , INDArray A , INDArray B , double beta , INDArray C ) { if ( Nd4j . getExecutioner ( ) . getProfilingMode ( ) == OpExecutioner . ProfilingMode . ALL ) OpProfiler . getInstance ( ) . processBlasCall ( true , A , B , C ) ; GemmParams params = new GemmParams ( A , B , C ) ; int charOder = Order ; if ( A . data ( ) . dataType ( ) == DataBuffer . Type . DOUBLE ) { DefaultOpExecutioner . validateDataType ( DataBuffer . Type . DOUBLE , params . getA ( ) , params . getB ( ) , params . getC ( ) ) ; dgemm ( Order , params . getTransA ( ) , params . getTransB ( ) , params . getM ( ) , params . getN ( ) , params . getK ( ) , 1.0 , params . getA ( ) , params . getLda ( ) , params . getB ( ) , params . getLdb ( ) , 0 , C , params . getLdc ( ) ) ; } else if ( A . data ( ) . dataType ( ) == DataBuffer . Type . FLOAT ) { DefaultOpExecutioner . validateDataType ( DataBuffer . Type . FLOAT , params . getA ( ) , params . getB ( ) , params . getC ( ) ) ; sgemm ( Order , params . getTransA ( ) , params . getTransB ( ) , params . getM ( ) , params . getN ( ) , params . getK ( ) , 1.0f , params . getA ( ) , params . getLda ( ) , params . getB ( ) , params . getLdb ( ) , 0 , C , params . getLdc ( ) ) ; } else { DefaultOpExecutioner . validateDataType ( DataBuffer . Type . HALF , params . getA ( ) , params . getB ( ) , params . getC ( ) ) ; hgemm ( Order , params . getTransA ( ) , params . getTransB ( ) , params . getM ( ) , params . getN ( ) , params . getK ( ) , 1.0f , params . getA ( ) , params . getLda ( ) , params . getB ( ) , params . getLdb ( ) , 0 , C , params . getLdc ( ) ) ; } OpExecutionerUtil . checkForAny ( C ) ; }
gemm performs a matrix-matrix operation
c := alpha*op(a)*op(b) + beta*c,
where c is an m-by-n matrix,
op(a) is an m-by-k matrix,
op(b) is a k-by-n matrix.
@param Order
@param TransA
@param TransB
@param alpha
@param A
@param B
@param beta
@param C
gemm performs a matrix - matrix operation c : = alpha * op ( a ) * op ( b ) + beta * c where c is an m - by - n matrix op ( a ) is an m - by - k matrix op ( b ) is a k - by - n matrix .