!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!  This file is AUTOMATICALLY GENERATED by:
!!  tools/fortran_wrappers.pl include/magma_z.i
!!  Do not edit.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

module magma_zfortran

use magma_param

implicit none

!---- Fortran interfaces to MAGMA subroutines ----
interface

integer function magmaf_get_zpotrf_nb( n )
    integer          :: n
end

integer function magmaf_get_zgetrf_nb( m, n )
    integer          :: m
    integer          :: n
end

integer function magmaf_get_zgetri_nb( n )
    integer          :: n
end

integer function magmaf_get_zhetrf_nb( n )
    integer          :: n
end

integer function magmaf_get_zhetrf_nopiv_nb( n )
    integer          :: n
end

integer function magmaf_get_zhetrf_aasen_nb( n )
    integer          :: n
end

integer function magmaf_get_zgeqp3_nb( m, n )
    integer          :: m
    integer          :: n
end

integer function magmaf_get_zgeqrf_nb( m, n )
    integer          :: m
    integer          :: n
end

integer function magmaf_get_zgeqlf_nb( m, n )
    integer          :: m
    integer          :: n
end

integer function magmaf_get_zgelqf_nb( m, n )
    integer          :: m
    integer          :: n
end

integer function magmaf_get_zgehrd_nb( n )
    integer          :: n
end

integer function magmaf_get_zhetrd_nb( n )
    integer          :: n
end

integer function magmaf_get_zhegst_nb( n )
    integer          :: n
end

integer function magmaf_get_zhegst_m_nb( n )
    integer          :: n
end

integer function magmaf_get_zgebrd_nb( m, n )
    integer          :: m
    integer          :: n
end

integer function magmaf_get_zgesvd_nb( m, n )
    integer          :: m
    integer          :: n
end

integer function magmaf_get_zbulge_nb( n, nbthreads )
    integer          :: n
    integer          :: nbthreads
end

integer function magmaf_get_zbulge_vblksiz( n, nb, nbthreads )
    integer          :: n
    integer          :: nb
    integer          :: nbthreads
end

integer function magmaf_get_zbulge_gcperf(  )
end

subroutine magmaf_zgebrd( m, n, A, lda, d, e, tauq, taup, work, lwork, info )
    integer          :: m
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    double precision :: d(*)
    double precision :: e(*)
    complex*16       :: tauq(*)
    complex*16       :: taup(*)
    complex*16       :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zgeev( jobvl, jobvr, n, A, lda, w, VL, ldvl, VR, ldvr, work, lwork,  &
        rwork, info )
    character        :: jobvl
    character        :: jobvr
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: w(*)
    complex*16       :: VL(*)
    integer          :: ldvl
    complex*16       :: VR(*)
    integer          :: ldvr
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: info
end

subroutine magmaf_zgeev_m( jobvl, jobvr, n, A, lda, w, VL, ldvl, VR, ldvr, work, lwork,  &
        rwork, info )
    character        :: jobvl
    character        :: jobvr
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: w(*)
    complex*16       :: VL(*)
    integer          :: ldvl
    complex*16       :: VR(*)
    integer          :: ldvr
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: info
end

subroutine magmaf_zgegqr_gpu( ikind, m, n, dA, ldda, dwork, work, info )
    integer          :: ikind
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dwork
    complex*16       :: work(*)
    integer          :: info
end

subroutine magmaf_zgehrd( n, ilo, ihi, A, lda, tau, work, lwork, dT, info )
    integer          :: n
    integer          :: ilo
    integer          :: ihi
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    complex*16       :: work(*)
    integer          :: lwork
    magma_devptr_t   :: dT
    integer          :: info
end

subroutine magmaf_zgehrd_m( n, ilo, ihi, A, lda, tau, work, lwork, T, info )
    integer          :: n
    integer          :: ilo
    integer          :: ihi
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    complex*16       :: work(*)
    integer          :: lwork
    complex*16       :: T(*)
    integer          :: info
end

subroutine magmaf_zgehrd2( n, ilo, ihi, A, lda, tau, work, lwork, info )
    integer          :: n
    integer          :: ilo
    integer          :: ihi
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    complex*16       :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zgelqf( m, n, A, lda, tau, work, lwork, info )
    integer          :: m
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    complex*16       :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zgelqf_gpu( m, n, dA, ldda, tau, work, lwork, info )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    complex*16       :: tau(*)
    complex*16       :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zgels( trans, m, n, nrhs, A, lda, B, ldb, hwork, lwork, info )
    character        :: trans
    integer          :: m
    integer          :: n
    integer          :: nrhs
    magma_devptr_t   :: A
    integer          :: lda
    magma_devptr_t   :: B
    integer          :: ldb
    complex*16       :: hwork(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zggrqf( m, p, n, A, lda, taua, B, ldb, taub, work, lwork, info )
    integer          :: m
    integer          :: p
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: taua(*)
    complex*16       :: B(*)
    integer          :: ldb
    complex*16       :: taub(*)
    complex*16       :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zgglse( m, n, p, A, lda, B, ldb, c, d, x, work, lwork, info )
    integer          :: m
    integer          :: n
    integer          :: p
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: B(*)
    integer          :: ldb
    complex*16       :: c(*)
    complex*16       :: d(*)
    complex*16       :: x(*)
    complex*16       :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zgels_gpu( trans, m, n, nrhs, dA, ldda, dB, lddb, hwork, lwork, info )
    character        :: trans
    integer          :: m
    integer          :: n
    integer          :: nrhs
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    complex*16       :: hwork(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zgels3_gpu( trans, m, n, nrhs, dA, ldda, dB, lddb, hwork, lwork, info )
    character        :: trans
    integer          :: m
    integer          :: n
    integer          :: nrhs
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    complex*16       :: hwork(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zgeqlf( m, n, A, lda, tau, work, lwork, info )
    integer          :: m
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    complex*16       :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zgeqp3( m, n, A, lda, jpvt, tau, work, lwork, rwork, info )
    integer          :: m
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    integer          :: jpvt(*)
    complex*16       :: tau(*)
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: info
end

subroutine magmaf_zgeqp3_gpu( m, n, dA, ldda, jpvt, tau, dwork, lwork, rwork, info )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    integer          :: jpvt(*)
    complex*16       :: tau(*)
    magma_devptr_t   :: dwork
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: info
end

subroutine magmaf_zgeqr2x_gpu( m, n, dA, ldda, dtau, dT, ddA, dwork, info )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dtau
    magma_devptr_t   :: dT
    magma_devptr_t   :: ddA
    magma_devptr_t   :: dwork
    integer          :: info
end

subroutine magmaf_zgeqr2x2_gpu( m, n, dA, ldda, dtau, dT, ddA, dwork, info )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dtau
    magma_devptr_t   :: dT
    magma_devptr_t   :: ddA
    magma_devptr_t   :: dwork
    integer          :: info
end

subroutine magmaf_zgeqr2x3_gpu( m, n, dA, ldda, dtau, dT, ddA, dwork, info )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dtau
    magma_devptr_t   :: dT
    magma_devptr_t   :: ddA
    magma_devptr_t   :: dwork
    integer          :: info
end

subroutine magmaf_zgeqr2x4_gpu( m, n, dA, ldda, dtau, dT, ddA, dwork, queue, info )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dtau
    magma_devptr_t   :: dT
    magma_devptr_t   :: ddA
    magma_devptr_t   :: dwork
    magma_devptr_t   :: queue
    integer          :: info
end

subroutine magmaf_zgeqrf( m, n, A, lda, tau, work, lwork, info )
    integer          :: m
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    complex*16       :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zgeqrf_gpu( m, n, dA, ldda, tau, dT, info )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    complex*16       :: tau(*)
    magma_devptr_t   :: dT
    integer          :: info
end

subroutine magmaf_zgeqrf_m( ngpu, m, n, A, lda, tau, work, lwork, info )
    integer          :: ngpu
    integer          :: m
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    complex*16       :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zgeqrf_ooc( m, n, A, lda, tau, work, lwork, info )
    integer          :: m
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    complex*16       :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zgeqrf2_gpu( m, n, dA, ldda, tau, info )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    complex*16       :: tau(*)
    integer          :: info
end

subroutine magmaf_zgeqrf3_gpu( m, n, dA, ldda, tau, dT, info )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    complex*16       :: tau(*)
    magma_devptr_t   :: dT
    integer          :: info
end

subroutine magmaf_zgeqrs_gpu( m, n, nrhs, dA, ldda, tau, dT, dB, lddb, hwork, lwork, info  &
        )
    integer          :: m
    integer          :: n
    integer          :: nrhs
    magma_devptr_t   :: dA
    integer          :: ldda
    complex*16       :: tau(*)
    magma_devptr_t   :: dT
    magma_devptr_t   :: dB
    integer          :: lddb
    complex*16       :: hwork(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zgeqrs3_gpu( m, n, nrhs, dA, ldda, tau, dT, dB, lddb, hwork, lwork,  &
        info )
    integer          :: m
    integer          :: n
    integer          :: nrhs
    magma_devptr_t   :: dA
    integer          :: ldda
    complex*16       :: tau(*)
    magma_devptr_t   :: dT
    magma_devptr_t   :: dB
    integer          :: lddb
    complex*16       :: hwork(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zgerbt_gpu( gen, n, nrhs, dA, ldda, dB, lddb, U, V, info )
    character        :: gen
    integer          :: n
    integer          :: nrhs
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    complex*16       :: U(*)
    complex*16       :: V(*)
    integer          :: info
end

subroutine magmaf_zgerfs_nopiv_gpu( trans, n, nrhs, dA, ldda, dB, lddb, dX, lddx, dworkd,  &
        dAF, iter, info )
    character        :: trans
    integer          :: n
    integer          :: nrhs
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    magma_devptr_t   :: dX
    integer          :: lddx
    magma_devptr_t   :: dworkd
    magma_devptr_t   :: dAF
    integer          :: iter
    integer          :: info
end

subroutine magmaf_zgesdd( jobz, m, n, A, lda, s, U, ldu, VT, ldvt, work, lwork, rwork,  &
        iwork, info )
    character        :: jobz
    integer          :: m
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    double precision :: s(*)
    complex*16       :: U(*)
    integer          :: ldu
    complex*16       :: VT(*)
    integer          :: ldvt
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: iwork(*)
    integer          :: info
end

subroutine magmaf_zgesv( n, nrhs, A, lda, ipiv, B, ldb, info )
    integer          :: n
    integer          :: nrhs
    complex*16       :: A(*)
    integer          :: lda
    integer          :: ipiv(*)
    complex*16       :: B(*)
    integer          :: ldb
    integer          :: info
end

subroutine magmaf_zgesv_gpu( n, nrhs, dA, ldda, ipiv, dB, lddb, info )
    integer          :: n
    integer          :: nrhs
    magma_devptr_t   :: dA
    integer          :: ldda
    integer          :: ipiv(*)
    magma_devptr_t   :: dB
    integer          :: lddb
    integer          :: info
end

subroutine magmaf_zgesv_nopiv_gpu( n, nrhs, dA, ldda, dB, lddb, info )
    integer          :: n
    integer          :: nrhs
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    integer          :: info
end

subroutine magmaf_zgesv_rbt( ref, n, nrhs, A, lda, B, ldb, info )
    character        :: ref
    integer          :: n
    integer          :: nrhs
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: B(*)
    integer          :: ldb
    integer          :: info
end

subroutine magmaf_zgesvd( jobu, jobvt, m, n, A, lda, s, U, ldu, VT, ldvt, work, lwork,  &
        rwork, info )
    character        :: jobu
    character        :: jobvt
    integer          :: m
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    double precision :: s(*)
    complex*16       :: U(*)
    integer          :: ldu
    complex*16       :: VT(*)
    integer          :: ldvt
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: info
end

subroutine magmaf_zgetf2_gpu( m, n, dA, ldda, ipiv, queue, info )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    integer          :: ipiv(*)
    magma_devptr_t   :: queue
    integer          :: info
end

subroutine magmaf_zgetf2_nopiv( m, n, A, lda, info )
    integer          :: m
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    integer          :: info
end

subroutine magmaf_zgetrf( m, n, A, lda, ipiv, info )
    integer          :: m
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    integer          :: ipiv(*)
    integer          :: info
end

subroutine magmaf_zgetrf_gpu( m, n, dA, ldda, ipiv, info )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    integer          :: ipiv(*)
    integer          :: info
end

subroutine magmaf_zgetrf_m( ngpu, m, n, A, lda, ipiv, info )
    integer          :: ngpu
    integer          :: m
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    integer          :: ipiv(*)
    integer          :: info
end

subroutine magmaf_zgetrf_nopiv( m, n, A, lda, info )
    integer          :: m
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    integer          :: info
end

subroutine magmaf_zgetrf_nopiv_gpu( m, n, dA, ldda, info )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    integer          :: info
end

subroutine magmaf_zgetri_gpu( n, dA, ldda, ipiv, dwork, lwork, info )
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    integer          :: ipiv(*)
    magma_devptr_t   :: dwork
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zgetrs_gpu( trans, n, nrhs, dA, ldda, ipiv, dB, lddb, info )
    character        :: trans
    integer          :: n
    integer          :: nrhs
    magma_devptr_t   :: dA
    integer          :: ldda
    integer          :: ipiv(*)
    magma_devptr_t   :: dB
    integer          :: lddb
    integer          :: info
end

subroutine magmaf_zgetrs_nopiv_gpu( trans, n, nrhs, dA, ldda, dB, lddb, info )
    character        :: trans
    integer          :: n
    integer          :: nrhs
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    integer          :: info
end

subroutine magmaf_zheevd( jobz, uplo, n, A, lda, w, work, lwork, rwork, lrwork, iwork,  &
        liwork, info )
    character        :: jobz
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    double precision :: w(*)
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: lrwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_zheevd_gpu( jobz, uplo, n, dA, ldda, w, wA, ldwa, work, lwork, rwork,  &
        lrwork, iwork, liwork, info )
    character        :: jobz
    character        :: uplo
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    double precision :: w(*)
    complex*16       :: wA(*)
    integer          :: ldwa
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: lrwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_zheevd_m( ngpu, jobz, uplo, n, A, lda, w, work, lwork, rwork, lrwork,  &
        iwork, liwork, info )
    integer          :: ngpu
    character        :: jobz
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    double precision :: w(*)
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: lrwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_zheevdx( jobz, range, uplo, n, A, lda, vl, vu, il, iu, mout, w, work,  &
        lwork, rwork, lrwork, iwork, liwork, info )
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    double precision :: vl
    double precision :: vu
    integer          :: il
    integer          :: iu
    integer          :: mout(*)
    double precision :: w(*)
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: lrwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_zheevdx_gpu( jobz, range, uplo, n, dA, ldda, vl, vu, il, iu, mout, w,  &
        wA, ldwa, work, lwork, rwork, lrwork, iwork, liwork, info )
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    double precision :: vl
    double precision :: vu
    integer          :: il
    integer          :: iu
    integer          :: mout(*)
    double precision :: w(*)
    complex*16       :: wA(*)
    integer          :: ldwa
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: lrwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_zheevdx_m( ngpu, jobz, range, uplo, n, A, lda, vl, vu, il, iu, mout, w,  &
        work, lwork, rwork, lrwork, iwork, liwork, info )
    integer          :: ngpu
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    double precision :: vl
    double precision :: vu
    integer          :: il
    integer          :: iu
    integer          :: mout(*)
    double precision :: w(*)
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: lrwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_zheevdx_2stage( jobz, range, uplo, n, A, lda, vl, vu, il, iu, mout, w,  &
        work, lwork, rwork, lrwork, iwork, liwork, info )
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    double precision :: vl
    double precision :: vu
    integer          :: il
    integer          :: iu
    integer          :: mout(*)
    double precision :: w(*)
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: lrwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_zheevdx_2stage_m( ngpu, jobz, range, uplo, n, A, lda, vl, vu, il, iu,  &
        mout, w, work, lwork, rwork, lrwork, iwork, liwork, info )
    integer          :: ngpu
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    double precision :: vl
    double precision :: vu
    integer          :: il
    integer          :: iu
    integer          :: mout(*)
    double precision :: w(*)
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: lrwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_zheevr( jobz, range, uplo, n, A, lda, vl, vu, il, iu, abstol, mout, w,  &
        Z, ldz, isuppz, work, lwork, rwork, lrwork, iwork, liwork, info )
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    double precision :: vl
    double precision :: vu
    integer          :: il
    integer          :: iu
    double precision :: abstol
    integer          :: mout(*)
    double precision :: w(*)
    complex*16       :: Z(*)
    integer          :: ldz
    integer          :: isuppz(*)
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: lrwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_zheevr_gpu( jobz, range, uplo, n, dA, ldda, vl, vu, il, iu, abstol,  &
        mout, w, dZ, lddz, isuppz, wA, ldwa, wZ, ldwz, work, lwork, rwork, lrwork, iwork,  &
        liwork, info )
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    double precision :: vl
    double precision :: vu
    integer          :: il
    integer          :: iu
    double precision :: abstol
    integer          :: mout(*)
    double precision :: w(*)
    magma_devptr_t   :: dZ
    integer          :: lddz
    integer          :: isuppz(*)
    complex*16       :: wA(*)
    integer          :: ldwa
    complex*16       :: wZ(*)
    integer          :: ldwz
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: lrwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_zheevx( jobz, range, uplo, n, A, lda, vl, vu, il, iu, abstol, mout, w,  &
        Z, ldz, work, lwork, rwork, iwork, ifail, info )
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    double precision :: vl
    double precision :: vu
    integer          :: il
    integer          :: iu
    double precision :: abstol
    integer          :: mout(*)
    double precision :: w(*)
    complex*16       :: Z(*)
    integer          :: ldz
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: iwork(*)
    integer          :: ifail(*)
    integer          :: info
end

subroutine magmaf_zheevx_gpu( jobz, range, uplo, n, dA, ldda, vl, vu, il, iu, abstol,  &
        mout, w, dZ, lddz, wA, ldwa, wZ, ldwz, work, lwork, rwork, iwork, ifail, info )
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    double precision :: vl
    double precision :: vu
    integer          :: il
    integer          :: iu
    double precision :: abstol
    integer          :: mout(*)
    double precision :: w(*)
    magma_devptr_t   :: dZ
    integer          :: lddz
    complex*16       :: wA(*)
    integer          :: ldwa
    complex*16       :: wZ(*)
    integer          :: ldwz
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: iwork(*)
    integer          :: ifail(*)
    integer          :: info
end

subroutine magmaf_zhegst( itype, uplo, n, A, lda, B, ldb, info )
    integer          :: itype
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: B(*)
    integer          :: ldb
    integer          :: info
end

subroutine magmaf_zhegst_gpu( itype, uplo, n, dA, ldda, dB, lddb, info )
    integer          :: itype
    character        :: uplo
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    integer          :: info
end

subroutine magmaf_zhegst_m( ngpu, itype, uplo, n, A, lda, B, ldb, info )
    integer          :: ngpu
    integer          :: itype
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: B(*)
    integer          :: ldb
    integer          :: info
end

subroutine magmaf_zhegvd( itype, jobz, uplo, n, A, lda, B, ldb, w, work, lwork, rwork,  &
        lrwork, iwork, liwork, info )
    integer          :: itype
    character        :: jobz
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: B(*)
    integer          :: ldb
    double precision :: w(*)
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: lrwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_zhegvd_m( ngpu, itype, jobz, uplo, n, A, lda, B, ldb, w, work, lwork,  &
        rwork, lrwork, iwork, liwork, info )
    integer          :: ngpu
    integer          :: itype
    character        :: jobz
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: B(*)
    integer          :: ldb
    double precision :: w(*)
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: lrwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_zhegvdx( itype, jobz, range, uplo, n, A, lda, B, ldb, vl, vu, il, iu,  &
        mout, w, work, lwork, rwork, lrwork, iwork, liwork, info )
    integer          :: itype
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: B(*)
    integer          :: ldb
    double precision :: vl
    double precision :: vu
    integer          :: il
    integer          :: iu
    integer          :: mout(*)
    double precision :: w(*)
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: lrwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_zhegvdx_m( ngpu, itype, jobz, range, uplo, n, A, lda, B, ldb, vl, vu,  &
        il, iu, mout, w, work, lwork, rwork, lrwork, iwork, liwork, info )
    integer          :: ngpu
    integer          :: itype
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: B(*)
    integer          :: ldb
    double precision :: vl
    double precision :: vu
    integer          :: il
    integer          :: iu
    integer          :: mout(*)
    double precision :: w(*)
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: lrwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_zhegvdx_2stage( itype, jobz, range, uplo, n, A, lda, B, ldb, vl, vu,  &
        il, iu, mout, w, work, lwork, rwork, lrwork, iwork, liwork, info )
    integer          :: itype
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: B(*)
    integer          :: ldb
    double precision :: vl
    double precision :: vu
    integer          :: il
    integer          :: iu
    integer          :: mout(*)
    double precision :: w(*)
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: lrwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_zhegvdx_2stage_m( ngpu, itype, jobz, range, uplo, n, A, lda, B, ldb,  &
        vl, vu, il, iu, mout, w, work, lwork, rwork, lrwork, iwork, liwork, info )
    integer          :: ngpu
    integer          :: itype
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: B(*)
    integer          :: ldb
    double precision :: vl
    double precision :: vu
    integer          :: il
    integer          :: iu
    integer          :: mout(*)
    double precision :: w(*)
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: lrwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_zhegvr( itype, jobz, range, uplo, n, A, lda, B, ldb, vl, vu, il, iu,  &
        abstol, mout, w, Z, ldz, isuppz, work, lwork, rwork, lrwork, iwork, liwork, info  &
        )
    integer          :: itype
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: B(*)
    integer          :: ldb
    double precision :: vl
    double precision :: vu
    integer          :: il
    integer          :: iu
    double precision :: abstol
    integer          :: mout(*)
    double precision :: w(*)
    complex*16       :: Z(*)
    integer          :: ldz
    integer          :: isuppz(*)
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: lrwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_zhegvx( itype, jobz, range, uplo, n, A, lda, B, ldb, vl, vu, il, iu,  &
        abstol, mout, w, Z, ldz, work, lwork, rwork, iwork, ifail, info )
    integer          :: itype
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: B(*)
    integer          :: ldb
    double precision :: vl
    double precision :: vu
    integer          :: il
    integer          :: iu
    double precision :: abstol
    integer          :: mout(*)
    double precision :: w(*)
    complex*16       :: Z(*)
    integer          :: ldz
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: iwork(*)
    integer          :: ifail(*)
    integer          :: info
end

subroutine magmaf_zhesv( uplo, n, nrhs, A, lda, ipiv, B, ldb, info )
    character        :: uplo
    integer          :: n
    integer          :: nrhs
    complex*16       :: A(*)
    integer          :: lda
    integer          :: ipiv(*)
    complex*16       :: B(*)
    integer          :: ldb
    integer          :: info
end

subroutine magmaf_zhesv_nopiv_gpu( uplo, n, nrhs, dA, ldda, dB, lddb, info )
    character        :: uplo
    integer          :: n
    integer          :: nrhs
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    integer          :: info
end

subroutine magmaf_zhetrd( uplo, n, A, lda, d, e, tau, work, lwork, info )
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    double precision :: d(*)
    double precision :: e(*)
    complex*16       :: tau(*)
    complex*16       :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zhetrd_gpu( uplo, n, dA, ldda, d, e, tau, wA, ldwa, work, lwork, info )
    character        :: uplo
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    double precision :: d(*)
    double precision :: e(*)
    complex*16       :: tau(*)
    complex*16       :: wA(*)
    integer          :: ldwa
    complex*16       :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zhetrd2_gpu( uplo, n, dA, ldda, d, e, tau, wA, ldwa, work, lwork,  &
        dwork, ldwork, info )
    character        :: uplo
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    double precision :: d(*)
    double precision :: e(*)
    complex*16       :: tau(*)
    complex*16       :: wA(*)
    integer          :: ldwa
    complex*16       :: work(*)
    integer          :: lwork
    magma_devptr_t   :: dwork
    integer          :: ldwork
    integer          :: info
end

integer function magmaf_zhetrd_hb2st( uplo, n, nb, Vblksiz, A, lda, d, e, V, ldv, TAU,  &
        compT, T, ldt )
    character        :: uplo
    integer          :: n
    integer          :: nb
    integer          :: Vblksiz
    complex*16       :: A(*)
    integer          :: lda
    double precision :: d(*)
    double precision :: e(*)
    complex*16       :: V(*)
    integer          :: ldv
    complex*16       :: TAU(*)
    integer          :: compT
    complex*16       :: T(*)
    integer          :: ldt
end

subroutine magmaf_zhetrd_he2hb( uplo, n, nb, A, lda, tau, work, lwork, dT, info )
    character        :: uplo
    integer          :: n
    integer          :: nb
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    complex*16       :: work(*)
    integer          :: lwork
    magma_devptr_t   :: dT
    integer          :: info
end

subroutine magmaf_zhetrf( uplo, n, A, lda, ipiv, info )
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    integer          :: ipiv(*)
    integer          :: info
end

subroutine magmaf_zhetrf_aasen( uplo, cpu_panel, n, A, lda, ipiv, info )
    character        :: uplo
    integer          :: cpu_panel
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    integer          :: ipiv(*)
    integer          :: info
end

subroutine magmaf_zhetrf_nopiv( uplo, n, A, lda, info )
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    integer          :: info
end

subroutine magmaf_zhetrf_nopiv_cpu( uplo, n, ib, A, lda, info )
    character        :: uplo
    integer          :: n
    integer          :: ib
    complex*16       :: A(*)
    integer          :: lda
    integer          :: info
end

subroutine magmaf_zhetrf_nopiv_gpu( uplo, n, dA, ldda, info )
    character        :: uplo
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    integer          :: info
end

subroutine magmaf_zhetrs_nopiv_gpu( uplo, n, nrhs, dA, ldda, dB, lddb, info )
    character        :: uplo
    integer          :: n
    integer          :: nrhs
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    integer          :: info
end

integer function magmaf_zlarf_gpu( m, n, dv, dtau, dC, lddc, queue )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dv
    magma_devptr_t   :: dtau
    magma_devptr_t   :: dC
    integer          :: lddc
    magma_devptr_t   :: queue
end

integer function magmaf_zlarfb2_gpu( m, n, k, dV, lddv, dT, lddt, dC, lddc, dwork,  &
        ldwork, queue )
    integer          :: m
    integer          :: n
    integer          :: k
    magma_devptr_t   :: dV
    integer          :: lddv
    magma_devptr_t   :: dT
    integer          :: lddt
    magma_devptr_t   :: dC
    integer          :: lddc
    magma_devptr_t   :: dwork
    integer          :: ldwork
    magma_devptr_t   :: queue
end

subroutine magmaf_zlatrsd( uplo, trans, diag, normin, n, A, lda, lambda, x, scale, cnorm,  &
        info )
    character        :: uplo
    character        :: trans
    character        :: diag
    character        :: normin
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: lambda
    complex*16       :: x(*)
    double precision :: scale(*)
    double precision :: cnorm(*)
    integer          :: info
end

subroutine magmaf_zlauum( uplo, n, A, lda, info )
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    integer          :: info
end

subroutine magmaf_zlauum_gpu( uplo, n, dA, ldda, info )
    character        :: uplo
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    integer          :: info
end

subroutine magmaf_zposv( uplo, n, nrhs, A, lda, B, ldb, info )
    character        :: uplo
    integer          :: n
    integer          :: nrhs
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: B(*)
    integer          :: ldb
    integer          :: info
end

subroutine magmaf_zposv_gpu( uplo, n, nrhs, dA, ldda, dB, lddb, info )
    character        :: uplo
    integer          :: n
    integer          :: nrhs
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    integer          :: info
end

subroutine magmaf_zpotf2_gpu( uplo, n, dA, ldda, queue, info )
    character        :: uplo
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: queue
    integer          :: info
end

subroutine magmaf_zpotrf( uplo, n, A, lda, info )
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    integer          :: info
end

subroutine magmaf_zpotrf_gpu( uplo, n, dA, ldda, info )
    character        :: uplo
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    integer          :: info
end

subroutine magmaf_zpotrf_m( ngpu, uplo, n, A, lda, info )
    integer          :: ngpu
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    integer          :: info
end

subroutine magmaf_zpotri( uplo, n, A, lda, info )
    character        :: uplo
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    integer          :: info
end

subroutine magmaf_zpotri_gpu( uplo, n, dA, ldda, info )
    character        :: uplo
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    integer          :: info
end

subroutine magmaf_zpotrs_gpu( uplo, n, nrhs, dA, ldda, dB, lddb, info )
    character        :: uplo
    integer          :: n
    integer          :: nrhs
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    integer          :: info
end

subroutine magmaf_zsysv_nopiv_gpu( uplo, n, nrhs, dA, ldda, dB, lddb, info )
    character        :: uplo
    integer          :: n
    integer          :: nrhs
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    integer          :: info
end

subroutine magmaf_zsytrf_nopiv_cpu( uplo, n, ib, A, lda, info )
    character        :: uplo
    integer          :: n
    integer          :: ib
    complex*16       :: A(*)
    integer          :: lda
    integer          :: info
end

subroutine magmaf_zsytrf_nopiv_gpu( uplo, n, dA, ldda, info )
    character        :: uplo
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    integer          :: info
end

subroutine magmaf_zsytrs_nopiv_gpu( uplo, n, nrhs, dA, ldda, dB, lddb, info )
    character        :: uplo
    integer          :: n
    integer          :: nrhs
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    integer          :: info
end

subroutine magmaf_zstedx( range, n, vl, vu, il, iu, d, e, Z, ldz, rwork, lrwork, iwork,  &
        liwork, dwork, info )
    character        :: range
    integer          :: n
    double precision :: vl
    double precision :: vu
    integer          :: il
    integer          :: iu
    double precision :: d(*)
    double precision :: e(*)
    complex*16       :: Z(*)
    integer          :: ldz
    double precision :: rwork(*)
    integer          :: lrwork
    integer          :: iwork(*)
    integer          :: liwork
    magma_devptr_t   :: dwork
    integer          :: info
end

subroutine magmaf_zstedx_m( ngpu, range, n, vl, vu, il, iu, d, e, Z, ldz, rwork, lrwork,  &
        iwork, liwork, info )
    integer          :: ngpu
    character        :: range
    integer          :: n
    double precision :: vl
    double precision :: vu
    integer          :: il
    integer          :: iu
    double precision :: d(*)
    double precision :: e(*)
    complex*16       :: Z(*)
    integer          :: ldz
    double precision :: rwork(*)
    integer          :: lrwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_ztrevc3( side, howmany, select, n, T, ldt, VL, ldvl, VR, ldvr, mm,  &
        mout, work, lwork, rwork, info )
    character        :: side
    character        :: howmany
    integer          :: select(*)
    integer          :: n
    complex*16       :: T(*)
    integer          :: ldt
    complex*16       :: VL(*)
    integer          :: ldvl
    complex*16       :: VR(*)
    integer          :: ldvr
    integer          :: mm
    integer          :: mout(*)
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: info
end

subroutine magmaf_ztrevc3_mt( side, howmany, select, n, T, ldt, VL, ldvl, VR, ldvr, mm,  &
        mout, work, lwork, rwork, info )
    character        :: side
    character        :: howmany
    integer          :: select(*)
    integer          :: n
    complex*16       :: T(*)
    integer          :: ldt
    complex*16       :: VL(*)
    integer          :: ldvl
    complex*16       :: VR(*)
    integer          :: ldvr
    integer          :: mm
    integer          :: mout(*)
    complex*16       :: work(*)
    integer          :: lwork
    double precision :: rwork(*)
    integer          :: info
end

integer function magmaf_ztrsm_m( ngpu, side, uplo, transa, diag, m, n, alpha, A, lda, B,  &
        ldb )
    integer          :: ngpu
    character        :: side
    character        :: uplo
    character        :: transa
    character        :: diag
    integer          :: m
    integer          :: n
    complex*16       :: alpha
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: B(*)
    integer          :: ldb
end

subroutine magmaf_ztrtri( uplo, diag, n, A, lda, info )
    character        :: uplo
    character        :: diag
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    integer          :: info
end

subroutine magmaf_ztrtri_gpu( uplo, diag, n, dA, ldda, info )
    character        :: uplo
    character        :: diag
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    integer          :: info
end

subroutine magmaf_zungbr( vect, m, n, k, A, lda, tau, work, lwork, info )
    character        :: vect
    integer          :: m
    integer          :: n
    integer          :: k
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    complex*16       :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zunghr( n, ilo, ihi, A, lda, tau, dT, nb, info )
    integer          :: n
    integer          :: ilo
    integer          :: ihi
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    magma_devptr_t   :: dT
    integer          :: nb
    integer          :: info
end

subroutine magmaf_zunghr_m( n, ilo, ihi, A, lda, tau, T, nb, info )
    integer          :: n
    integer          :: ilo
    integer          :: ihi
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    complex*16       :: T(*)
    integer          :: nb
    integer          :: info
end

subroutine magmaf_zunglq( m, n, k, A, lda, tau, dT, nb, info )
    integer          :: m
    integer          :: n
    integer          :: k
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    magma_devptr_t   :: dT
    integer          :: nb
    integer          :: info
end

subroutine magmaf_zungqr( m, n, k, A, lda, tau, dT, nb, info )
    integer          :: m
    integer          :: n
    integer          :: k
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    magma_devptr_t   :: dT
    integer          :: nb
    integer          :: info
end

subroutine magmaf_zungqr_gpu( m, n, k, dA, ldda, tau, dT, nb, info )
    integer          :: m
    integer          :: n
    integer          :: k
    magma_devptr_t   :: dA
    integer          :: ldda
    complex*16       :: tau(*)
    magma_devptr_t   :: dT
    integer          :: nb
    integer          :: info
end

subroutine magmaf_zungqr_m( m, n, k, A, lda, tau, T, nb, info )
    integer          :: m
    integer          :: n
    integer          :: k
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    complex*16       :: T(*)
    integer          :: nb
    integer          :: info
end

subroutine magmaf_zungqr2( m, n, k, A, lda, tau, info )
    integer          :: m
    integer          :: n
    integer          :: k
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    integer          :: info
end

subroutine magmaf_zunmbr( vect, side, trans, m, n, k, A, lda, tau, C, ldc, work, lwork,  &
        info )
    character        :: vect
    character        :: side
    character        :: trans
    integer          :: m
    integer          :: n
    integer          :: k
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    complex*16       :: C(*)
    integer          :: ldc
    complex*16       :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zunmlq( side, trans, m, n, k, A, lda, tau, C, ldc, work, lwork, info )
    character        :: side
    character        :: trans
    integer          :: m
    integer          :: n
    integer          :: k
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    complex*16       :: C(*)
    integer          :: ldc
    complex*16       :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zunmrq( side, trans, m, n, k, A, lda, tau, C, ldc, work, lwork, info )
    character        :: side
    character        :: trans
    integer          :: m
    integer          :: n
    integer          :: k
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    complex*16       :: C(*)
    integer          :: ldc
    complex*16       :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zunmql( side, trans, m, n, k, A, lda, tau, C, ldc, work, lwork, info )
    character        :: side
    character        :: trans
    integer          :: m
    integer          :: n
    integer          :: k
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    complex*16       :: C(*)
    integer          :: ldc
    complex*16       :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zunmql2_gpu( side, trans, m, n, k, dA, ldda, tau, dC, lddc, wA, ldwa,  &
        info )
    character        :: side
    character        :: trans
    integer          :: m
    integer          :: n
    integer          :: k
    magma_devptr_t   :: dA
    integer          :: ldda
    complex*16       :: tau(*)
    magma_devptr_t   :: dC
    integer          :: lddc
    complex*16       :: wA(*)
    integer          :: ldwa
    integer          :: info
end

subroutine magmaf_zunmqr( side, trans, m, n, k, A, lda, tau, C, ldc, work, lwork, info )
    character        :: side
    character        :: trans
    integer          :: m
    integer          :: n
    integer          :: k
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    complex*16       :: C(*)
    integer          :: ldc
    complex*16       :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zunmqr_gpu( side, trans, m, n, k, dA, ldda, tau, dC, lddc, hwork,  &
        lwork, dT, nb, info )
    character        :: side
    character        :: trans
    integer          :: m
    integer          :: n
    integer          :: k
    magma_devptr_t   :: dA
    integer          :: ldda
    complex*16       :: tau(*)
    magma_devptr_t   :: dC
    integer          :: lddc
    complex*16       :: hwork(*)
    integer          :: lwork
    magma_devptr_t   :: dT
    integer          :: nb
    integer          :: info
end

subroutine magmaf_zunmqr2_gpu( side, trans, m, n, k, dA, ldda, tau, dC, lddc, wA, ldwa,  &
        info )
    character        :: side
    character        :: trans
    integer          :: m
    integer          :: n
    integer          :: k
    magma_devptr_t   :: dA
    integer          :: ldda
    complex*16       :: tau(*)
    magma_devptr_t   :: dC
    integer          :: lddc
    complex*16       :: wA(*)
    integer          :: ldwa
    integer          :: info
end

subroutine magmaf_zunmqr_m( ngpu, side, trans, m, n, k, A, lda, tau, C, ldc, work, lwork,  &
        info )
    integer          :: ngpu
    character        :: side
    character        :: trans
    integer          :: m
    integer          :: n
    integer          :: k
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    complex*16       :: C(*)
    integer          :: ldc
    complex*16       :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zunmtr( side, uplo, trans, m, n, A, lda, tau, C, ldc, work, lwork, info  &
        )
    character        :: side
    character        :: uplo
    character        :: trans
    integer          :: m
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    complex*16       :: C(*)
    integer          :: ldc
    complex*16       :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_zunmtr_gpu( side, uplo, trans, m, n, dA, ldda, tau, dC, lddc, wA, ldwa,  &
        info )
    character        :: side
    character        :: uplo
    character        :: trans
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    complex*16       :: tau(*)
    magma_devptr_t   :: dC
    integer          :: lddc
    complex*16       :: wA(*)
    integer          :: ldwa
    integer          :: info
end

subroutine magmaf_zunmtr_m( ngpu, side, uplo, trans, m, n, A, lda, tau, C, ldc, work,  &
        lwork, info )
    integer          :: ngpu
    character        :: side
    character        :: uplo
    character        :: trans
    integer          :: m
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: tau(*)
    complex*16       :: C(*)
    integer          :: ldc
    complex*16       :: work(*)
    integer          :: lwork
    integer          :: info
end

integer function magmaf_z_isnan( x )
    complex*16       :: x
end

integer function magmaf_z_isinf( x )
    complex*16       :: x
end

integer function magmaf_z_isnan_inf( x )
    complex*16       :: x
end

integer function magmaf_znan_inf( uplo, m, n, A, lda, cnt_nan, cnt_inf )
    character        :: uplo
    integer          :: m
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
    integer          :: cnt_nan(*)
    integer          :: cnt_inf(*)
end

integer function magmaf_znan_inf_gpu( uplo, m, n, dA, ldda, cnt_nan, cnt_inf, queue )
    character        :: uplo
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    integer          :: cnt_nan(*)
    integer          :: cnt_inf(*)
    magma_devptr_t   :: queue
end

subroutine magmaf_zprint( m, n, A, lda )
    integer          :: m
    integer          :: n
    complex*16       :: A(*)
    integer          :: lda
end

subroutine magmaf_zprint_gpu( m, n, dA, ldda, queue )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: queue
end

subroutine magmaf_zpanel_to_q( uplo, ib, A, lda, work )
    character        :: uplo
    integer          :: ib
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: work(*)
end

subroutine magmaf_zq_to_panel( uplo, ib, A, lda, work )
    character        :: uplo
    integer          :: ib
    complex*16       :: A(*)
    integer          :: lda
    complex*16       :: work(*)
end

end interface

end module magma_zfortran
