Created
September 4, 2014 05:29
-
-
Save agibsonccc/5e1319e51622e4a5cbfe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static INDArray gemv(INDArray A, INDArray B, INDArray C, float alpha, float beta) { | |
JCublasNDArray cA = (JCublasNDArray) A; | |
JCublasNDArray cB = (JCublasNDArray) B; | |
JCublasNDArray cC = (JCublasNDArray) C; | |
char trans = 'n'; | |
if (A.rows() == B.columns()) { | |
trans = 'T'; | |
} | |
JCublas.cublasDgemv( | |
'n', //trans | |
A.rows(), // m | |
A.columns(), // n | |
alpha, //alpha | |
cA.pointer(), // A | |
A.rows(), // lda | |
cB.pointer(), // x | |
B.rows(), // incx | |
beta, // beta | |
cC.pointer(), // y | |
1); // incy | |
cC.getData(); | |
return C; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment