-
-
Save dlwh/c572fdde70fec7c27fbe to your computer and use it in GitHub Desktop.
This file contains 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
import breeze.linalg._ | |
import gust.linalg.cuda._ | |
import jcuda.jcublas._ | |
implicit val handle = new cublasHandle() | |
JCublas2.cublasCreate(handle) | |
// an extract from a REPL session | |
val A = CuMatrix.fromDense(DenseMatrix((1.0f, 1.0f, 2.0f, 1.0f), (1.0f, 2.0f, 1.0f, -2.0f), (3.0f, -1.0f, 3.0f, -2.0f), (-2.0f, 3.0f, -1.0f, 1.0f))) | |
val N = 4 | |
val Aarray = jcuda.Pointer.to(A.offsetPointer) // this is the one I'm most uncertain about | |
val P = CuMatrix.create[Int](N, 1) // but I'm not sure about those 2 either | |
val info = CuMatrix.create[Int](N,1) | |
JCublas2.cublasSgetrfBatched(handle, N, Aarray, N, P.offsetPointer, info.offsetPointer, 1) // this call returns success (0), | |
// but A is zeroed-out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment