Skip to content

Instantly share code, notes, and snippets.

@piotrMocz
Created June 7, 2014 21:28
Show Gist options
  • Save piotrMocz/570f9dbda166cee4f904 to your computer and use it in GitHub Desktop.
Save piotrMocz/570f9dbda166cee4f904 to your computer and use it in GitHub Desktop.
Sgetrf
// 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