public class LibMatrixCUDA extends Object
GPUContext
,
GPUObject
Modifier and Type | Field and Description |
---|---|
static CudaSupportFunctions |
cudaSupportFunctions |
protected static int |
CUDNN_DATA_TYPE |
static String |
customKernelSuffix |
protected static long |
maxNumElementsOfCuDNNTensor |
static int |
sizeOfDataType |
Constructor and Description |
---|
LibMatrixCUDA() |
Modifier and Type | Method and Description |
---|---|
static void |
abs(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
String outputName)
Performs an "abs" operation on a matrix on the GPU
|
static void |
acos(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
String outputName)
Performs an "acos" operation on a matrix on the GPU
|
static void |
asin(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
String outputName)
Performs an "asin" operation on a matrix on the GPU
|
static void |
atan(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
String outputName)
Performs an "atan" operation on a matrix on the GPU
|
static void |
axpy(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
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(GPUContext gCtx,
String instName,
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
|
static void |
biasMultiply(GPUContext gCtx,
String instName,
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
|
static void |
cbind(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in2,
String outputName) |
static void |
ceil(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
String outputName)
Performs an "ceil" operation on a matrix on the GPU
|
static void |
channelSums(GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject input,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject outputBlock,
long C,
long HW)
Perform channel_sums operations: out = rowSums(matrix(colSums(A), rows=C, cols=HW))
|
static void |
cos(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
String outputName)
Performs an "cos" operation on a matrix on the GPU
|
static void |
cosh(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
String outputName)
Performs an "cosh" operation on a matrix on the GPU
|
protected static jcuda.Pointer |
dataTypePointerTo(double value) |
static jcuda.Pointer |
double2float(GPUContext gCtx,
jcuda.Pointer A,
jcuda.Pointer ret,
int numElems) |
static void |
exp(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
String outputName)
Performs an "exp" operation on a matrix on the GPU
|
static jcuda.Pointer |
float2double(GPUContext gCtx,
jcuda.Pointer A,
jcuda.Pointer ret,
int numElems) |
static void |
floor(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
String outputName)
Performs an "floor" operation on a matrix on the GPU
|
protected static jcuda.jcublas.cublasHandle |
getCublasHandle(GPUContext gCtx) |
protected static JCudaKernels |
getCudaKernels(GPUContext gCtx) |
protected static jcuda.jcusparse.cusparseHandle |
getCusparseHandle(GPUContext gCtx) |
protected static org.apache.sysml.runtime.controlprogram.caching.MatrixObject |
getDenseMatrixOutputForGPUInstruction(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
String instName,
String name,
long numRows,
long numCols)
Helper method to get the output block (allocated on the GPU)
Also records performance information into
Statistics |
protected static jcuda.Pointer |
getDensePointer(GPUContext gCtx,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject input,
String instName)
Convenience method to get jcudaDenseMatrixPtr.
|
protected static CSRPointer |
getSparsePointer(GPUContext gCtx,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject input,
String instName)
Convenience method to get the sparse matrix pointer from a
MatrixObject . |
static boolean |
isInSparseFormat(GPUContext gCtx,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject mo) |
static void |
log(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
String outputName)
Performs an "log" operation on a matrix on the GPU
|
static void |
matmultTSMM(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
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 |
matrixMatrixArithmetic(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
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 arithmetic operation specified by op of two input matrices in1 and in2
|
static void |
matrixMatrixRelational(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in2,
String outputName,
org.apache.sysml.runtime.matrix.operators.BinaryOperator op)
Performs elementwise operation relational specified by op of two input matrices in1 and in2
|
static void |
matrixScalarArithmetic(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
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 arithmetic operation specified by op
|
static void |
matrixScalarRelational(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in,
String outputName,
org.apache.sysml.runtime.matrix.operators.ScalarOperator op)
Entry point to perform elementwise matrix-scalar relational operation specified by op
|
static jcuda.Pointer |
one()
Convenience method to get a pointer to value '1.0' on device.
|
static void |
rbind(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in2,
String outputName) |
static void |
reluBackward(GPUContext gCtx,
String instName,
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
|
static void |
resetFloatingPointPrecision()
Sets the internal state based on the DMLScript.DATA_TYPE
|
static void |
round(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
String outputName)
Performs an "round" operation on a matrix on the GPU
|
static void |
sigmoid(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
String outputName)
Performs an "sigmoid" operation on a matrix on the GPU
|
static void |
sign(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
String outputName)
Performs an "sign" operation on a matrix on the GPU
|
static void |
sin(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
String outputName)
Performs an "sin" operation on a matrix on the GPU
|
static void |
sinh(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
String outputName)
Performs an "sinh" operation on a matrix on the GPU
|
protected static void |
sliceDenseDense(GPUContext gCtx,
String instName,
jcuda.Pointer inPointer,
jcuda.Pointer outPointer,
int rl,
int ru,
int cl,
int cu,
int inClen)
Perform slice operation on dense input and output it in dense format
|
static void |
sliceOperations(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
org.apache.sysml.runtime.util.IndexRange ixrange,
String outputName)
Method to perform rightIndex operation for a given lower and upper bounds in row and column dimensions.
|
protected static void |
sliceSparseDense(GPUContext gCtx,
String instName,
CSRPointer inPointer,
jcuda.Pointer outPointer,
int rl,
int ru,
int cl,
int cu,
int inClen)
Perform slice operation on sparse input and output it in dense format
|
static void |
solve(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in2,
String outputName)
Implements the "solve" function for systemml Ax = B (A is of size m*n, B is of size m*1, x is of size n*1)
|
static void |
sqrt(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
String outputName)
Performs an "sqrt" operation on a matrix on the GPU
|
static void |
tan(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
String outputName)
Performs an "tan" operation on a matrix on the GPU
|
static void |
tanh(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1,
String outputName)
Performs an "tanh" operation on a matrix on the GPU
|
static int |
toInt(long num) |
static void |
transpose(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
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,
GPUContext gCtx,
String instName,
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.
|
static jcuda.Pointer |
zero()
Convenience method to get a pointer to value '0.0f' on device.
|
protected static int CUDNN_DATA_TYPE
public static CudaSupportFunctions cudaSupportFunctions
public static int sizeOfDataType
public static String customKernelSuffix
protected static long maxNumElementsOfCuDNNTensor
public static void resetFloatingPointPrecision() throws DMLRuntimeException
DMLRuntimeException
- if errorpublic static boolean isInSparseFormat(GPUContext gCtx, org.apache.sysml.runtime.controlprogram.caching.MatrixObject mo)
protected static jcuda.jcusparse.cusparseHandle getCusparseHandle(GPUContext gCtx) throws DMLRuntimeException
DMLRuntimeException
protected static jcuda.jcublas.cublasHandle getCublasHandle(GPUContext gCtx) throws DMLRuntimeException
DMLRuntimeException
protected static JCudaKernels getCudaKernels(GPUContext gCtx) throws DMLRuntimeException
DMLRuntimeException
public static jcuda.Pointer double2float(GPUContext gCtx, jcuda.Pointer A, jcuda.Pointer ret, int numElems) throws DMLRuntimeException
DMLRuntimeException
public static jcuda.Pointer float2double(GPUContext gCtx, jcuda.Pointer A, jcuda.Pointer ret, int numElems) throws DMLRuntimeException
DMLRuntimeException
public static jcuda.Pointer one()
public static jcuda.Pointer zero()
protected static jcuda.Pointer getDensePointer(GPUContext gCtx, org.apache.sysml.runtime.controlprogram.caching.MatrixObject input, String instName) throws DMLRuntimeException
gCtx
- a valid GPUContext
input
- input matrix objectinstName
- the invoking instruction's name for record Statistics
.DMLRuntimeException
- if error occurs while sparse to dense conversionprotected static CSRPointer getSparsePointer(GPUContext gCtx, org.apache.sysml.runtime.controlprogram.caching.MatrixObject input, String instName) throws DMLRuntimeException
MatrixObject
. Converts dense to sparse if necessary.gCtx
- a valid GPUContext
input
- input matrixinstName
- the invoking instruction's name for record Statistics
.DMLRuntimeException
- if error occursprotected static jcuda.Pointer dataTypePointerTo(double value)
public static void reluBackward(GPUContext gCtx, String instName, 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
gCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.input
- input imagedout
- next layer error propogationoutputBlock
- outputDMLRuntimeException
- if DMLRuntimeException occurspublic static void channelSums(GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject input, org.apache.sysml.runtime.controlprogram.caching.MatrixObject outputBlock, long C, long HW) throws DMLRuntimeException
gCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.input
- input imageoutputBlock
- outputC
- number of channelsHW
- height*widthDMLRuntimeException
- if DMLRuntimeException occurspublic static void biasMultiply(GPUContext gCtx, String instName, 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
gCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.input
- input imagebias
- biasoutputBlock
- outputDMLRuntimeException
- if DMLRuntimeException occurspublic static void biasAdd(GPUContext gCtx, String instName, 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
gCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.input
- input imagebias
- biasoutputBlock
- outputDMLRuntimeException
- if DMLRuntimeException occurspublic static void matmultTSMM(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject left, String outputName, boolean isLeftTransposed) throws DMLRuntimeException
Memory Usage - If dense, input space - rows * cols, no intermediate memory, output - Max(rows*rows, cols*cols) If sparse, calls matmult
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.left
- 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 void unaryAggregate(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, 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 allocatedgCtx
- a valid GPUContext
instName
- name of the invoking instruction to recordStatistics
.in1
- 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 matrixScalarRelational(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in, String outputName, org.apache.sysml.runtime.matrix.operators.ScalarOperator op) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in
- input matrixoutputName
- output matrix nameop
- scalar operatorDMLRuntimeException
- if DMLRuntimeException occurspublic static void matrixScalarArithmetic(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in, String outputName, boolean isInputTransposed, org.apache.sysml.runtime.matrix.operators.ScalarOperator op) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in
- input matrixoutputName
- output matrix nameisInputTransposed
- true if input transposedop
- scalar operatorDMLRuntimeException
- if DMLRuntimeException occurspublic static void matrixMatrixRelational(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in2, String outputName, org.apache.sysml.runtime.matrix.operators.BinaryOperator op) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrix 1in2
- input matrix 2outputName
- output matrix nameop
- binary operatorDMLRuntimeException
- if DMLRuntimeException occurspublic static void matrixMatrixArithmetic(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, 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 contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- 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, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in, String outputName) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in
- input matrixoutputName
- output matrix nameDMLRuntimeException
- if DMLRuntimeException occurspublic static int toInt(long num) throws DMLRuntimeException
DMLRuntimeException
public static void sliceOperations(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, org.apache.sysml.runtime.util.IndexRange ixrange, String outputName) throws DMLRuntimeException
ec
- current execution contextgCtx
- current gpu contextinstName
- name of the instruction for maintaining statisticsin1
- input matrix objectixrange
- index range (0-based)outputName
- output matrix objectDMLRuntimeException
- if error occursprotected static void sliceDenseDense(GPUContext gCtx, String instName, jcuda.Pointer inPointer, jcuda.Pointer outPointer, int rl, int ru, int cl, int cu, int inClen) throws DMLRuntimeException
gCtx
- gpu contextinstName
- instruction nameinPointer
- dense input pointeroutPointer
- dense output pointer (doesnot need to be zeroed out)rl
- row lowerru
- row uppercl
- column lowercu
- column upperinClen
- input number of columnsDMLRuntimeException
- if error occursprotected static void sliceSparseDense(GPUContext gCtx, String instName, CSRPointer inPointer, jcuda.Pointer outPointer, int rl, int ru, int cl, int cu, int inClen) throws DMLRuntimeException
gCtx
- gpu contextinstName
- instruction nameinPointer
- sparse CSR input pointeroutPointer
- dense output pointer (expected to be zeroed out)rl
- row lowerru
- row uppercl
- column lowercu
- column upperinClen
- number of columns of input matrixDMLRuntimeException
- if errorpublic static void cbind(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in2, String outputName) throws DMLRuntimeException
DMLRuntimeException
public static void rbind(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in2, String outputName) throws DMLRuntimeException
DMLRuntimeException
public static void exp(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, String outputName) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix nameDMLRuntimeException
- if DMLRuntimeException occurspublic static void sqrt(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, String outputName) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix nameDMLRuntimeException
- if DMLRuntimeException occurspublic static void round(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, String outputName) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix nameDMLRuntimeException
- if DMLRuntimeException occurspublic static void abs(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, String outputName) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix nameDMLRuntimeException
- if DMLRuntimeException occurspublic static void log(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, String outputName) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix nameDMLRuntimeException
- if DMLRuntimeException occurspublic static void floor(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, String outputName) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix nameDMLRuntimeException
- if DMLRuntimeException occurspublic static void ceil(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, String outputName) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix nameDMLRuntimeException
- if DMLRuntimeException occurspublic static void sin(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, String outputName) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix nameDMLRuntimeException
- if DMLRuntimeException occurspublic static void cos(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, String outputName) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix nameDMLRuntimeException
- if DMLRuntimeException occurspublic static void tan(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, String outputName) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix nameDMLRuntimeException
- if DMLRuntimeException occurspublic static void sinh(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, String outputName) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix nameDMLRuntimeException
- if DMLRuntimeException occurspublic static void cosh(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, String outputName) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix nameDMLRuntimeException
- if DMLRuntimeException occurspublic static void tanh(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, String outputName) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix nameDMLRuntimeException
- if DMLRuntimeException occurspublic static void asin(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, String outputName) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix nameDMLRuntimeException
- if DMLRuntimeException occurspublic static void acos(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, String outputName) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix nameDMLRuntimeException
- if DMLRuntimeException occurspublic static void atan(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, String outputName) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix nameDMLRuntimeException
- if DMLRuntimeException occurspublic static void sign(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, String outputName) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix nameDMLRuntimeException
- if DMLRuntimeException occurspublic static void sigmoid(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, String outputName) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix nameDMLRuntimeException
- if DMLRuntimeException occurspublic static void axpy(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in2, String outputName, double constant) throws DMLRuntimeException
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrix 1in2
- input matrix 2outputName
- output matrix nameconstant
- pointer constantDMLRuntimeException
- if DMLRuntimeException occurspublic static void solve(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in1, org.apache.sysml.runtime.controlprogram.caching.MatrixObject in2, String outputName) throws DMLRuntimeException
ec
- a valid ExecutionContext
gCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrix Ain2
- input matrix BoutputName
- name of the output matrixDMLRuntimeException
- if an error occursprotected static org.apache.sysml.runtime.controlprogram.caching.MatrixObject getDenseMatrixOutputForGPUInstruction(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, String instName, String name, long numRows, long numCols) throws DMLRuntimeException
Statistics
ec
- active ExecutionContext
instName
- the invoking instruction's name for record Statistics
.name
- name of input matrix (that the ExecutionContext
is aware of)numRows
- number of rows of output matrix objectnumCols
- number of columns of output matrix objectDMLRuntimeException
- if an error occursCopyright © 2017 The Apache Software Foundation. All rights reserved.