I have been converting some Fortran code from CPU (Lapack) to GPU operation (MAGMA). In the code I call magmaf_zgetrs_gpu twice using the same factorization to solve two problems with different input right hand sides.
Code: Select all
! fpm23 is the nrhs
call cublas_set_matrix(n, fpm23, size_of_elt, Zwork2, N, devptrB, ldda)
call cublas_set_matrix(n, n, size_of_elt, Z, size, devptrY, ldda)
call magmaf_zgetrs_gpu('N', n, 1, devptrY, ldda, ipiv, devptrB, ldda, info_gpu)
call cublas_get_matrix(n, fpm23, size_of_elt, devptrB, ldda, Zwork2, N)
!
! some cpu only code which has changed Zwork2 but not Z and ipiv.
!
call cublas_set_matrix(n, fpm23, size_of_elt, Zwork2, N, devptrB, ldda)
call cublas_set_matrix(n, n, size_of_elt, Z, size, devptrY, ldda)
call magmaf_zgetrs_gpu('C', n, 1, devptrY, ldda, ipiv, devptrB, ldda, info_gpu)
call cublas_get_matrix(n, fpm23, size_of_elt, devptrB, ldda, Zwork2, N)
That leads me to ask what assumptions can be made about the memory used by a call to cublas_set_matrix? How long is it valid?
I am working with a GPU which is also used to run a display, which I guess may also make use of the memory I am using for CUDA. Magma 1.6.2
Thanks
John