public class LibMatrixCUDA extends Object
Modifier and Type | Field and Description |
---|---|
static jcuda.jcublas.cublasHandle |
cublasHandle |
static jcuda.jcudnn.cudnnHandle |
cudnnHandle |
static jcuda.jcusparse.cusparseHandle |
cusparseHandle |
static JCudaKernels |
kernels |
Constructor and Description |
---|
LibMatrixCUDA() |
Modifier and Type | Method and Description |
---|---|
static void |
axpy(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in2,
String outputName,
double constant)
Performs daxpy operation
|
static void |
biasAdd(org.apache.sysml.runtime.controlprogram.caching.MatrixObject input,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject bias,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject outputBlock)
Performs the operation corresponding to the DML script:
ones = matrix(1, rows=1, cols=Hout*Wout)
output = input + matrix(bias %*% ones, rows=1, cols=F*Hout*Wout)
This operation is often followed by conv2d and hence we have introduced bias_add(input, bias) built-in function
|
protected static void |
bothSparseMatmult(org.apache.sysml.runtime.controlprogram.caching.MatrixObject output,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject left,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject right,
boolean isLeftTransposed,
boolean isRightTransposed)
Sparse C = Sparse op(A) * Sparse op(B)
Reroutes call to sparse matrix-vector mult if needed
|
static void |
conv2d(org.apache.sysml.runtime.controlprogram.caching.MatrixObject image,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject filter,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject outputBlock,
int N,
int C,
int H,
int W,
int K,
int R,
int S,
int pad_h,
int pad_w,
int stride_h,
int stride_w,
int P,
int Q) |
static void |
conv2dBackwardData(org.apache.sysml.runtime.controlprogram.caching.MatrixObject filter,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject dout,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject output,
int N,
int C,
int H,
int W,
int K,
int R,
int S,
int pad_h,
int pad_w,
int stride_h,
int stride_w,
int P,
int Q)
This method computes the backpropogation errors for previous layer of convolution operation
|
static void |
conv2dBackwardFilter(org.apache.sysml.runtime.controlprogram.caching.MatrixObject image,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject dout,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject outputBlock,
int N,
int C,
int H,
int W,
int K,
int R,
int S,
int pad_h,
int pad_w,
int stride_h,
int stride_w,
int P,
int Q)
This method computes the backpropogation errors for filter of convolution operation
|
protected static void |
denseDenseMatmult(org.apache.sysml.runtime.controlprogram.caching.MatrixObject output,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject left1,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject right1,
boolean isLeftTransposed1,
boolean isRightTransposed1)
Dense dense matrix multiply
C = op(A) * op(B), A and B are dense matrices
|
static void |
denseDenseMatmult(jcuda.Pointer output,
int leftRows1,
int leftCols1,
int rightRows1,
int rightCols1,
boolean isLeftTransposed1,
boolean isRightTransposed1,
jcuda.Pointer leftPtr,
jcuda.Pointer rightPtr)
Dense-dense matrix multiply
C = op(A) * op(B), A and B are dense matrices
On the host, the matrices are in row-major format; cuBLAS expects them in column-major format.
|
protected static void |
denseSparseMatmult(org.apache.sysml.runtime.controlprogram.caching.MatrixObject output,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject right,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject left,
boolean isLeftTransposed,
boolean isRightTransposed,
int transA,
int transB,
int m,
int n,
int k)
C = op(A) * op(B) where A is dense and B is sparse
If B is ultrasparse, A is converted to a sparse matrix and
sparseSparseMatmult(MatrixObject, int, int, int, int, int, CSRPointer, CSRPointer) is invoked
otherwise B is converted to a dense matrix and denseDenseMatmult(Pointer, int, int, int, int, boolean, boolean, Pointer, Pointer) is invoked. |
protected static void |
eitherSparseMatmult(org.apache.sysml.runtime.controlprogram.caching.MatrixObject output,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject left,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject right,
boolean isLeftTransposed,
boolean isRightTransposed)
One of the matrices is sparse, the other dense
C = op(A) x op(B)
|
static boolean |
isInSparseFormat(org.apache.sysml.runtime.controlprogram.caching.MatrixObject mo) |
static org.apache.sysml.runtime.controlprogram.caching.MatrixObject |
matmult(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject left1,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject right1,
String outputName,
boolean isLeftTransposed1,
boolean isRightTransposed1)
Matrix multiply on GPU
Examines sparsity and shapes and routes call to appropriate method
from cuBLAS or cuSparse
C = op(A) x op(B)
|
static void |
matmultTSMM(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject left,
String outputName,
boolean isLeftTransposed)
Performs tsmm, A %*% A' or A' %*% A, on GPU by exploiting cublasDsyrk(...)
|
static void |
matrixScalarArithmetic(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in2,
String outputName,
boolean isLeftTransposed,
boolean isRightTransposed,
org.apache.sysml.runtime.matrix.operators.BinaryOperator op)
Performs elementwise operation specified by op of two input matrices in1 and in2
|
static void |
matrixScalarArithmetic(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in,
String outputName,
boolean isInputTransposed,
org.apache.sysml.runtime.matrix.operators.ScalarOperator op)
Entry point to perform elementwise matrix-scalar operation specified by op
|
static void |
maxpooling(org.apache.sysml.runtime.controlprogram.caching.MatrixObject image,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject outputBlock,
int N,
int C,
int H,
int W,
int K,
int R,
int S,
int pad_h,
int pad_w,
int stride_h,
int stride_w,
int P,
int Q)
performs maxpooling on GPU by exploiting cudnnPoolingForward(...)
|
static void |
maxpoolingBackward(org.apache.sysml.runtime.controlprogram.caching.MatrixObject image,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject dout,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject outputBlock,
int N,
int C,
int H,
int W,
int K,
int R,
int S,
int pad_h,
int pad_w,
int stride_h,
int stride_w,
int P,
int Q)
Performs maxpoolingBackward on GPU by exploiting cudnnPoolingBackward(...)
This method computes the backpropogation errors for previous layer of maxpooling operation
|
static jcuda.Pointer |
pointerTo(double value) |
static void |
relu(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in,
String outputName) |
static void |
reluBackward(org.apache.sysml.runtime.controlprogram.caching.MatrixObject input,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject dout,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject outputBlock)
This method computes the backpropagation errors for previous layer of relu operation
|
protected static void |
sparseDenseMatmult(org.apache.sysml.runtime.controlprogram.caching.MatrixObject output,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject left,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject right,
boolean isLeftTransposed,
boolean isRightTransposed,
int transA,
int transB,
int m,
int n,
int k)
* C = op(A) * op(B) where A is sparse and B is dense
If A is ultrasparse, B is converted to a sparse matrix and
sparseSparseMatmult(MatrixObject, int, int, int, int, int, CSRPointer, CSRPointer) is invoked
otherwise A is converted to a dense matrix and denseDenseMatmult(Pointer, int, int, int, int, boolean, boolean, Pointer, Pointer) is invoked. |
protected static void |
sparseMatrixDenseVectorMult(org.apache.sysml.runtime.controlprogram.caching.MatrixObject output,
JCudaObject.CSRPointer A,
jcuda.Pointer B_dense,
int transA,
int m,
int k)
C = op(A) x B
A is a sparse matrix, B is a dense vector
|
protected static void |
sparseMatrixVectorMult(org.apache.sysml.runtime.controlprogram.caching.MatrixObject output,
int transA,
int m,
int n,
int k,
JCudaObject.CSRPointer A,
JCudaObject.CSRPointer B)
Does a sparse matrix-vector multiply.
|
protected static void |
sparseSparseMatmult(org.apache.sysml.runtime.controlprogram.caching.MatrixObject output,
int transA,
int transB,
int m,
int n,
int k,
JCudaObject.CSRPointer A,
JCudaObject.CSRPointer B)
Does a sparse-sparse Matrix multiply
C = op(A) x op(B), A, B are sparse matrices
|
static void |
transpose(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in,
String outputName)
Transposes the input matrix using cublasDgeam
|
static void |
unaryAggregate(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
String output,
org.apache.sysml.runtime.matrix.operators.AggregateUnaryOperator op)
Entry point to perform Unary aggregate operations on the GPU.
|
public static jcuda.jcudnn.cudnnHandle cudnnHandle
public static jcuda.jcublas.cublasHandle cublasHandle
public static jcuda.jcusparse.cusparseHandle cusparseHandle
public static JCudaKernels kernels
public static void conv2d(org.apache.sysml.runtime.controlprogram.caching.MatrixObject image, org.apache.sysml.runtime.controlprogram.caching.MatrixObject filter, org.apache.sysml.runtime.controlprogram.caching.MatrixObject outputBlock, int N, int C, int H, int W, int K, int R, int S, int pad_h, int pad_w, int stride_h, int stride_w, int P, int Q) throws DMLRuntimeException
DMLRuntimeException
public static jcuda.Pointer pointerTo(double value)
public static void reluBackward(org.apache.sysml.runtime.controlprogram.caching.MatrixObject input, org.apache.sysml.runtime.controlprogram.caching.MatrixObject dout, org.apache.sysml.runtime.controlprogram.caching.MatrixObject outputBlock) throws DMLRuntimeException
input
- input imagedout
- next layer error propogationoutputBlock
- outputDMLRuntimeException
- if DMLRuntimeException occurspublic static void biasAdd(org.apache.sysml.runtime.controlprogram.caching.MatrixObject input, org.apache.sysml.runtime.controlprogram.caching.MatrixObject bias, org.apache.sysml.runtime.controlprogram.caching.MatrixObject outputBlock) throws DMLRuntimeException
input
- input imagebias
- biasoutputBlock
- outputDMLRuntimeException
- if DMLRuntimeException occurspublic static void conv2dBackwardFilter(org.apache.sysml.runtime.controlprogram.caching.MatrixObject image, org.apache.sysml.runtime.controlprogram.caching.MatrixObject dout, org.apache.sysml.runtime.controlprogram.caching.MatrixObject outputBlock, int N, int C, int H, int W, int K, int R, int S, int pad_h, int pad_w, int stride_h, int stride_w, int P, int Q) throws DMLRuntimeException
image
- input imagedout
- errors from next layeroutputBlock
- output errorsN
- number of imagesC
- number of channelsH
- heightW
- widthK
- number of filtersR
- filter heightS
- filter widthpad_h
- pad heightpad_w
- pad widthstride_h
- stride heightstride_w
- stride widthP
- output activation heightQ
- output activation widthDMLRuntimeException
- if DMLRuntimeException occurspublic static void relu(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in, String outputName) throws DMLRuntimeException
DMLRuntimeException
public static void matmultTSMM(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, org.apache.sysml.runtime.controlprogram.caching.MatrixObject left, String outputName, boolean isLeftTransposed) throws DMLRuntimeException
ec
- execution contextleft
- input matrix, as in a tsmm expression like A %*% A' or A' %*% A, we just need to check whether the left one is transposed or not, I named it 'left'outputName
- output matrix nameisLeftTransposed
- if true, left transposedDMLRuntimeException
- if DMLRuntimeException occurspublic static org.apache.sysml.runtime.controlprogram.caching.MatrixObject matmult(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, org.apache.sysml.runtime.controlprogram.caching.MatrixObject left1, org.apache.sysml.runtime.controlprogram.caching.MatrixObject right1, String outputName, boolean isLeftTransposed1, boolean isRightTransposed1) throws DMLRuntimeException
ec
- Current ExecutionContext
instanceleft1
- Matrix Aright1
- Matrix BoutputName
- Name of the output matrix C (in code generated after LOP layer)isLeftTransposed1
- op for A, transposed or notisRightTransposed1
- op for B, tranposed or notDMLRuntimeException
- if DMLRuntimeException occursprotected static void eitherSparseMatmult(org.apache.sysml.runtime.controlprogram.caching.MatrixObject output, org.apache.sysml.runtime.controlprogram.caching.MatrixObject left, org.apache.sysml.runtime.controlprogram.caching.MatrixObject right, boolean isLeftTransposed, boolean isRightTransposed) throws DMLRuntimeException
output
- allocated output object for C on host to which GPU output will be attachedleft
- Matrix A on hostright
- Matrix B on hostisLeftTransposed
- op for A, tranposed or notisRightTransposed
- op for B, transposed or notDMLRuntimeException
- if DMLRuntimeException occursprotected static void denseSparseMatmult(org.apache.sysml.runtime.controlprogram.caching.MatrixObject output, org.apache.sysml.runtime.controlprogram.caching.MatrixObject right, org.apache.sysml.runtime.controlprogram.caching.MatrixObject left, boolean isLeftTransposed, boolean isRightTransposed, int transA, int transB, int m, int n, int k) throws DMLRuntimeException
sparseSparseMatmult(MatrixObject, int, int, int, int, int, CSRPointer, CSRPointer)
is invoked
otherwise B is converted to a dense matrix and denseDenseMatmult(Pointer, int, int, int, int, boolean, boolean, Pointer, Pointer)
is invoked.output
- ?right
- ?left
- ?isLeftTransposed
- ?isRightTransposed
- ?transA
- ?transB
- ?m
- ?n
- ?k
- ?DMLRuntimeException
- if DMLRuntimeException occursprotected static void sparseDenseMatmult(org.apache.sysml.runtime.controlprogram.caching.MatrixObject output, org.apache.sysml.runtime.controlprogram.caching.MatrixObject left, org.apache.sysml.runtime.controlprogram.caching.MatrixObject right, boolean isLeftTransposed, boolean isRightTransposed, int transA, int transB, int m, int n, int k) throws DMLRuntimeException
sparseSparseMatmult(MatrixObject, int, int, int, int, int, CSRPointer, CSRPointer)
is invoked
otherwise A is converted to a dense matrix and denseDenseMatmult(Pointer, int, int, int, int, boolean, boolean, Pointer, Pointer)
is invoked.output
- ?left
- ?right
- ?isLeftTransposed
- ?isRightTransposed
- ?transA
- ?transB
- ?m
- ?n
- ?k
- ?DMLRuntimeException
- if DMLRuntimeException occursprotected static void sparseMatrixDenseVectorMult(org.apache.sysml.runtime.controlprogram.caching.MatrixObject output, JCudaObject.CSRPointer A, jcuda.Pointer B_dense, int transA, int m, int k) throws DMLRuntimeException
output
- allocated output on the host, to which the GPU output C will be attachedA
- sparse matrix A on the GPUB_dense
- dense matrix/vector B on the GPUtransA
- op for A, tranposed or notm
- number of rows in A (not op(A))k
- number of cols in A or number of rows in B (not op(A) or op(B))DMLRuntimeException
- if DMLRuntimeException occursprotected static void bothSparseMatmult(org.apache.sysml.runtime.controlprogram.caching.MatrixObject output, org.apache.sysml.runtime.controlprogram.caching.MatrixObject left, org.apache.sysml.runtime.controlprogram.caching.MatrixObject right, boolean isLeftTransposed, boolean isRightTransposed) throws DMLRuntimeException
output
- ?left
- ?right
- ?isLeftTransposed
- ?isRightTransposed
- ?DMLRuntimeException
- if DMLRuntimeException occursprotected static void sparseMatrixVectorMult(org.apache.sysml.runtime.controlprogram.caching.MatrixObject output, int transA, int m, int n, int k, JCudaObject.CSRPointer A, JCudaObject.CSRPointer B) throws DMLRuntimeException
output
- allocated output object C to which the GPU output matrix will be attachedtransA
- if A is to be transposed or not (the op in op(A))m
- number of rows in A (not op(A))n
- number of cols in A (not op(A))k
- number of rows in B, (cols in B is assumed to be 1)A
- left sparse matrix on GPUB
- right sparse vector on GPUDMLRuntimeException
- if DMLRuntimeException occursprotected static void sparseSparseMatmult(org.apache.sysml.runtime.controlprogram.caching.MatrixObject output, int transA, int transB, int m, int n, int k, JCudaObject.CSRPointer A, JCudaObject.CSRPointer B) throws DMLRuntimeException
output
- allocated output object on host to which the GPU output matrix will be attachedtransA
- op for A - to be transposed or nottransB
- op for Bm
- number of rows in op(A)n
- number of cols in op(B)k
- number of cols in op(A) or rows in op(B)A
- left sparse matrix on GPUB
- right sparse matrix on GPUDMLRuntimeException
- if DMLRuntimeException occursprotected static void denseDenseMatmult(org.apache.sysml.runtime.controlprogram.caching.MatrixObject output, org.apache.sysml.runtime.controlprogram.caching.MatrixObject left1, org.apache.sysml.runtime.controlprogram.caching.MatrixObject right1, boolean isLeftTransposed1, boolean isRightTransposed1) throws DMLRuntimeException
output
- output object C on host with GPU data allocatedleft1
- left matrix A on host (in row-major order)right1
- right matrix B on host (in row-major order)isLeftTransposed1
- op for A, transposed or notisRightTransposed1
- op for B, transposed or notDMLRuntimeException
- if DMLRuntimeException occurspublic static void denseDenseMatmult(jcuda.Pointer output, int leftRows1, int leftCols1, int rightRows1, int rightCols1, boolean isLeftTransposed1, boolean isRightTransposed1, jcuda.Pointer leftPtr, jcuda.Pointer rightPtr) throws DMLRuntimeException
output
- output allocated on GPU in column major formatleftRows1
- number of rows in AleftCols1
- number of cols in ArightRows1
- number of rows in BrightCols1
- number of cols in BisLeftTransposed1
- op for A, transposed or notisRightTransposed1
- op for B, transposed or notleftPtr
- A allocated on the GPU in row-major formatrightPtr
- B allocated on the GPU in row-major formatDMLRuntimeException
- if DMLRuntimeException occurspublic static void unaryAggregate(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, String output, org.apache.sysml.runtime.matrix.operators.AggregateUnaryOperator op) throws DMLRuntimeException
ec
- Instance of ExecutionContext
, from which the output variable will be allocatedin1
- input matrixoutput
- output matrix/scalar nameop
- Instance of AggregateUnaryOperator
which encapsulates the direction of reduction/aggregation and the reduction operation.DMLRuntimeException
- if DMLRuntimeException
occurspublic static void conv2dBackwardData(org.apache.sysml.runtime.controlprogram.caching.MatrixObject filter, org.apache.sysml.runtime.controlprogram.caching.MatrixObject dout, org.apache.sysml.runtime.controlprogram.caching.MatrixObject output, int N, int C, int H, int W, int K, int R, int S, int pad_h, int pad_w, int stride_h, int stride_w, int P, int Q) throws DMLRuntimeException
filter
- filter used in conv2ddout
- errors from next layeroutput
- output errorsN
- number of imagesC
- number of channelsH
- heightW
- widthK
- number of filtersR
- filter heightS
- filter widthpad_h
- pad heightpad_w
- pad widthstride_h
- stride heightstride_w
- stride widthP
- output activation heightQ
- output activation widthDMLRuntimeException
- if DMLRuntimeException occurspublic static void maxpooling(org.apache.sysml.runtime.controlprogram.caching.MatrixObject image, org.apache.sysml.runtime.controlprogram.caching.MatrixObject outputBlock, int N, int C, int H, int W, int K, int R, int S, int pad_h, int pad_w, int stride_h, int stride_w, int P, int Q) throws DMLRuntimeException
image
- image as matrix objectoutputBlock
- output matrixN
- batch sizeC
- number of channelsH
- height of imageW
- width of imageK
- number of filtersR
- height of filterS
- width of filterpad_h
- vertical paddingpad_w
- horizontal paddingstride_h
- horizontal stridestride_w
- vertical strideP
- (H - R + 1 + 2*pad_h)/stride_hQ
- (W - S + 1 + 2*pad_w)/stride_wDMLRuntimeException
- if DMLRuntimeException occurspublic static void maxpoolingBackward(org.apache.sysml.runtime.controlprogram.caching.MatrixObject image, org.apache.sysml.runtime.controlprogram.caching.MatrixObject dout, org.apache.sysml.runtime.controlprogram.caching.MatrixObject outputBlock, int N, int C, int H, int W, int K, int R, int S, int pad_h, int pad_w, int stride_h, int stride_w, int P, int Q) throws DMLRuntimeException
image
- image as matrix objectdout
- delta matrix, output of previous layeroutputBlock
- output matrixN
- batch sizeC
- number of channelsH
- height of imageW
- width of imageK
- number of filtersR
- height of filterS
- width of filterpad_h
- vertical paddingpad_w
- horizontal paddingstride_h
- horizontal stridestride_w
- vertical strideP
- (H - R + 1 + 2*pad_h)/stride_hQ
- (W - S + 1 + 2*pad_w)/stride_wDMLRuntimeException
- if DMLRuntimeException occurspublic static boolean isInSparseFormat(org.apache.sysml.runtime.controlprogram.caching.MatrixObject mo)
public static void matrixScalarArithmetic(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in, String outputName, boolean isInputTransposed, org.apache.sysml.runtime.matrix.operators.ScalarOperator op) throws DMLRuntimeException
ec
- execution contextin
- input matrixoutputName
- output matrix nameisInputTransposed
- true if input transposedop
- scalar operatorDMLRuntimeException
- if DMLRuntimeException occurspublic static void axpy(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in2, String outputName, double constant) throws DMLRuntimeException
ec
- execution contextin1
- input matrix 1in2
- input matrix 2outputName
- output matrix nameconstant
- pointer constantDMLRuntimeException
- if DMLRuntimeException occurspublic static void matrixScalarArithmetic(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in2, String outputName, boolean isLeftTransposed, boolean isRightTransposed, org.apache.sysml.runtime.matrix.operators.BinaryOperator op) throws DMLRuntimeException
ec
- execution contextin1
- input matrix 1in2
- input matrix 2outputName
- output matrix nameisLeftTransposed
- true if left-transposedisRightTransposed
- true if right-transposedop
- binary operatorDMLRuntimeException
- if DMLRuntimeException occurspublic static void transpose(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in, String outputName) throws DMLRuntimeException
ec
- execution contextin
- input matrixoutputName
- output matrix nameDMLRuntimeException
- if DMLRuntimeException occursCopyright © 2017 The Apache Software Foundation. All rights reserved.