Skip to content

Instantly share code, notes, and snippets.

@agibsonccc
Created September 4, 2014 05:32
Show Gist options
  • Save agibsonccc/8bdb733f57525dbdda6e to your computer and use it in GitHub Desktop.
Save agibsonccc/8bdb733f57525dbdda6e to your computer and use it in GitHub Desktop.
public static IComplexNDArray gemm(IComplexNDArray A, IComplexNDArray B, IComplexNDArray C,
float Alpha, float Beta) {
JCublasNDArray cA = (JCublasNDArray) A;
JCublasNDArray cB = (JCublasNDArray) B;
JCublasNDArray cC = (JCublasNDArray) C;
cuDoubleComplex alpha = cuDoubleComplex.cuCmplx(Alpha,0);
cuDoubleComplex beta = cuDoubleComplex.cuCmplx(Beta,0);
JCublas.cublasZgemm(
'n', //trans
'n',
A.rows(), // m
B.columns(), // n
B.rows(), //k,
alpha,
cA.pointer(), // A
A.rows(), // lda
cB.pointer(), // x
B.rows(), // incx
beta, // beta
cC.pointer(), // y
C.rows()); // incy
cC.getData();
return C;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment