Class LibMatrixNative
- java.lang.Object
-
- org.apache.sysds.runtime.matrix.data.LibMatrixNative
-
public class LibMatrixNative extends Object
-
-
Constructor Summary
Constructors Constructor Description LibMatrixNative()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
conv2d(MatrixBlock input, MatrixBlock filter, MatrixBlock outputBlock, DnnParameters params)
This method performs convolution (i.e.static void
conv2dBackwardData(MatrixBlock filter, MatrixBlock dout, MatrixBlock outputBlock, DnnParameters params)
This method computes the backpropagation errors for previous layer of convolution operationstatic void
conv2dBackwardFilter(MatrixBlock input, MatrixBlock dout, MatrixBlock outputBlock, DnnParameters params)
This method computes the backpropogation errors for filter of convolution operationstatic void
fromFloatBuffer(FloatBuffer buff, double[] output)
static boolean
isMatMultMemoryBound(int m1Rlen, int m1Clen, int m2Clen)
static boolean
isSinglePrecision()
static MatrixBlock
matrixMult(MatrixBlock m1, MatrixBlock m2, MatrixBlock ret, int k)
Performs matrix multiplication using native library if BLAS is available or else falls back to Java BLAS.static void
tsmm(MatrixBlock m1, MatrixBlock ret, boolean leftTrans, int k)
-
-
-
Method Detail
-
isMatMultMemoryBound
public static boolean isMatMultMemoryBound(int m1Rlen, int m1Clen, int m2Clen)
-
matrixMult
public static MatrixBlock matrixMult(MatrixBlock m1, MatrixBlock m2, MatrixBlock ret, int k)
Performs matrix multiplication using native library if BLAS is available or else falls back to Java BLAS.- Parameters:
m1
- lhs matrix blockm2
- rhs matrix blockret
- output matrix blockk
- number of threads- Returns:
- the ret matrixBlock if allocated otherwise a new matrixBlock.
-
tsmm
public static void tsmm(MatrixBlock m1, MatrixBlock ret, boolean leftTrans, int k)
-
conv2d
public static void conv2d(MatrixBlock input, MatrixBlock filter, MatrixBlock outputBlock, DnnParameters params)
This method performs convolution (i.e. cross-correlation) operation on input- Parameters:
input
- input batchfilter
- filteroutputBlock
- output of convolutionparams
- convolution parameters
-
conv2dBackwardFilter
public static void conv2dBackwardFilter(MatrixBlock input, MatrixBlock dout, MatrixBlock outputBlock, DnnParameters params)
This method computes the backpropogation errors for filter of convolution operation- Parameters:
input
- input imagedout
- errors from next layeroutputBlock
- output errorsparams
- convolution parameters
-
conv2dBackwardData
public static void conv2dBackwardData(MatrixBlock filter, MatrixBlock dout, MatrixBlock outputBlock, DnnParameters params)
This method computes the backpropagation errors for previous layer of convolution operation- Parameters:
filter
- filter used in conv2ddout
- errors from next layeroutputBlock
- output errorsparams
- convolution parameters
-
isSinglePrecision
public static boolean isSinglePrecision()
-
fromFloatBuffer
public static void fromFloatBuffer(FloatBuffer buff, double[] output)
-
-