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 int |
computeNNZ(GPUContext gCtx,
jcuda.Pointer densePtr,
int length)
Utility to compute number of non-zeroes on the GPU
|
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 void |
denseTranspose(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec,
GPUContext gCtx,
String instName,
jcuda.Pointer A,
jcuda.Pointer C,
long numRowsA,
long numColsA)
Computes C = t(A)
|
static void |
deviceCopy(String instName,
jcuda.Pointer src,
jcuda.Pointer dest,
int rlen,
int clen)
Performs a deep copy of input device double pointer corresponding to matrix
|
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) |
static JCudaKernels |
getCudaKernels(GPUContext gCtx) |
protected static jcuda.jcusparse.cusparseHandle |
getCusparseHandle(GPUContext gCtx) |
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 |
static jcuda.Pointer |
getDensePointer(GPUContext gCtx,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject input,
String instName)
Convenience method to get jcudaDenseMatrixPtr.
|
static long |
getNnz(GPUContext gCtx,
String instName,
org.apache.sysml.runtime.controlprogram.caching.MatrixObject mo,
boolean recomputeDenseNNZ)
Note: if the matrix is in dense format, it explicitly re-computes the number of nonzeros.
|
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 |
matrixScalarOp(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)
Utility to do matrix-scalar operation kernel
|
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()
public static boolean isInSparseFormat(GPUContext gCtx, org.apache.sysml.runtime.controlprogram.caching.MatrixObject mo)
public static long getNnz(GPUContext gCtx, String instName, org.apache.sysml.runtime.controlprogram.caching.MatrixObject mo, boolean recomputeDenseNNZ)
gCtx
- a valid GPU contextinstName
- instruction namemo
- matrix objectrecomputeDenseNNZ
- recompute NNZ if denseprotected static jcuda.jcusparse.cusparseHandle getCusparseHandle(GPUContext gCtx)
protected static jcuda.jcublas.cublasHandle getCublasHandle(GPUContext gCtx)
public static JCudaKernels getCudaKernels(GPUContext gCtx) throws DMLRuntimeException
DMLRuntimeException
public static jcuda.Pointer double2float(GPUContext gCtx, jcuda.Pointer A, jcuda.Pointer ret, int numElems)
public static jcuda.Pointer float2double(GPUContext gCtx, jcuda.Pointer A, jcuda.Pointer ret, int numElems)
public static jcuda.Pointer one()
public static jcuda.Pointer zero()
public 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
protected static CSRPointer getSparsePointer(GPUContext gCtx, org.apache.sysml.runtime.controlprogram.caching.MatrixObject input, String instName)
MatrixObject
. Converts dense to sparse if necessary.gCtx
- a valid GPUContext
input
- input matrixinstName
- the invoking instruction's name for record Statistics
.protected 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)
gCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.input
- input imagedout
- next layer error propogationoutputBlock
- outputpublic 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)
gCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.input
- input imageoutputBlock
- outputC
- number of channelsHW
- height*widthpublic 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)
gCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.input
- input imagebias
- biasoutputBlock
- outputpublic 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)
gCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.input
- input imagebias
- biasoutputBlock
- outputpublic 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)
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 transposedpublic 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)
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.public 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)
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in
- input matrixoutputName
- output matrix nameop
- scalar operatorpublic 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)
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 operatorpublic 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)
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 operatorpublic 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)
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 operatorpublic static void matrixScalarOp(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)
gCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.ec
- execution contextin
- input matrixoutputName
- output variable nameisInputTransposed
- true if input is transposedop
- operatorpublic static void deviceCopy(String instName, jcuda.Pointer src, jcuda.Pointer dest, int rlen, int clen)
instName
- the invoking instruction's name for record Statistics
.src
- source matrixdest
- destination matrixrlen
- number of rowsclen
- number of columnspublic static void denseTranspose(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec, GPUContext gCtx, String instName, jcuda.Pointer A, jcuda.Pointer C, long numRowsA, long numColsA) throws DMLRuntimeException
ec
- execution contextgCtx
- gpu contextinstName
- name of the instructionA
- pointer to the input matrixC
- pointer to the output matrixnumRowsA
- number of rows of the input matrixnumColsA
- number of columns of the output matrixDMLRuntimeException
- if errorpublic 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)
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in
- input matrixoutputName
- output matrix namepublic static int toInt(long num)
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)
ec
- current execution contextgCtx
- current gpu contextinstName
- name of the instruction for maintaining statisticsin1
- input matrix objectixrange
- index range (0-based)outputName
- output matrix objectprotected static void sliceDenseDense(GPUContext gCtx, String instName, jcuda.Pointer inPointer, jcuda.Pointer outPointer, int rl, int ru, int cl, int cu, int inClen)
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 columnsprotected static void sliceSparseDense(GPUContext gCtx, String instName, CSRPointer inPointer, jcuda.Pointer outPointer, int rl, int ru, int cl, int cu, int inClen)
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 matrixpublic 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)
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)
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)
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix namepublic 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)
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix namepublic 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)
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix namepublic 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)
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix namepublic 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)
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix namepublic 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)
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix namepublic 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)
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix namepublic 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)
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix namepublic 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)
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix namepublic 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)
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix namepublic 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)
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix namepublic 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)
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix namepublic 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)
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix namepublic 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)
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix namepublic 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)
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix namepublic 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)
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix namepublic 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)
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix namepublic 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)
ec
- execution contextgCtx
- a valid GPUContext
instName
- the invoking instruction's name for record Statistics
.in1
- input matrixoutputName
- output matrix namepublic 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)
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 constantpublic 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)
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 matrixpublic 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)
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 objectpublic static int computeNNZ(GPUContext gCtx, jcuda.Pointer densePtr, int length)
gCtx
- the associated GPUContextdensePtr
- device pointer to the dense matrixlength
- length of the dense pointerCopyright © 2018 The Apache Software Foundation. All rights reserved.