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

module magma_sfortran

use magma_param

implicit none

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

integer function magmaf_get_slaex3_m_nb(  )
end

integer function magmaf_get_spotrf_nb( n )
    integer          :: n
end

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

integer function magmaf_get_sgetri_nb( n )
    integer          :: n
end

integer function magmaf_get_ssytrf_nb( n )
    integer          :: n
end

integer function magmaf_get_ssytrf_nopiv_nb( n )
    integer          :: n
end

integer function magmaf_get_ssytrf_aasen_nb( n )
    integer          :: n
end

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

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

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

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

integer function magmaf_get_sgehrd_nb( n )
    integer          :: n
end

integer function magmaf_get_ssytrd_nb( n )
    integer          :: n
end

integer function magmaf_get_ssygst_nb( n )
    integer          :: n
end

integer function magmaf_get_ssygst_m_nb( n )
    integer          :: n
end

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

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

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

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

integer function magmaf_get_sbulge_gcperf(  )
end

subroutine magmaf_smove_eig( range, n, w, il, iu, vl, vu, mout )
    character        :: range
    integer          :: n
    real             :: w(*)
    integer          :: il(*)
    integer          :: iu(*)
    real             :: vl
    real             :: vu
    integer          :: mout(*)
end

subroutine magmaf_svrange( k, d, il, iu, vl, vu )
    integer          :: k
    real             :: d(*)
    integer          :: il(*)
    integer          :: iu(*)
    real             :: vl
    real             :: vu
end

subroutine magmaf_sirange( k, indxq, iil, iiu, il, iu )
    integer          :: k
    integer          :: indxq(*)
    integer          :: iil(*)
    integer          :: iiu(*)
    integer          :: il
    integer          :: iu
end

subroutine magmaf_sgebrd( m, n, A, lda, d, e, tauq, taup, work, lwork, info )
    integer          :: m
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: d(*)
    real             :: e(*)
    real             :: tauq(*)
    real             :: taup(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_sgeev( jobvl, jobvr, n, A, lda, wr, wi, VL, ldvl, VR, ldvr, work,  &
        lwork, info )
    character        :: jobvl
    character        :: jobvr
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: wr(*)
    real             :: wi(*)
    real             :: VL(*)
    integer          :: ldvl
    real             :: VR(*)
    integer          :: ldvr
    real             :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_sgeev_m( jobvl, jobvr, n, A, lda, wr, wi, VL, ldvl, VR, ldvr, work,  &
        lwork, info )
    character        :: jobvl
    character        :: jobvr
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: wr(*)
    real             :: wi(*)
    real             :: VL(*)
    integer          :: ldvl
    real             :: VR(*)
    integer          :: ldvr
    real             :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_sgegqr_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
    real             :: work(*)
    integer          :: info
end

subroutine magmaf_sgehrd( n, ilo, ihi, A, lda, tau, work, lwork, dT, info )
    integer          :: n
    integer          :: ilo
    integer          :: ihi
    real             :: A(*)
    integer          :: lda
    real             :: tau(*)
    real             :: work(*)
    integer          :: lwork
    magma_devptr_t   :: dT
    integer          :: info
end

subroutine magmaf_sgehrd_m( n, ilo, ihi, A, lda, tau, work, lwork, T, info )
    integer          :: n
    integer          :: ilo
    integer          :: ihi
    real             :: A(*)
    integer          :: lda
    real             :: tau(*)
    real             :: work(*)
    integer          :: lwork
    real             :: T(*)
    integer          :: info
end

subroutine magmaf_sgehrd2( n, ilo, ihi, A, lda, tau, work, lwork, info )
    integer          :: n
    integer          :: ilo
    integer          :: ihi
    real             :: A(*)
    integer          :: lda
    real             :: tau(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_sgelqf( m, n, A, lda, tau, work, lwork, info )
    integer          :: m
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: tau(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_sgelqf_gpu( m, n, dA, ldda, tau, work, lwork, info )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    real             :: tau(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_sgels( 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
    real             :: hwork(*)
    integer          :: lwork
    integer          :: info
end

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

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

subroutine magmaf_sgels_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
    real             :: hwork(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_sgels3_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
    real             :: hwork(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_sgeqlf( m, n, A, lda, tau, work, lwork, info )
    integer          :: m
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: tau(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_sgeqp3( m, n, A, lda, jpvt, tau, work, lwork, info )
    integer          :: m
    integer          :: n
    real             :: A(*)
    integer          :: lda
    integer          :: jpvt(*)
    real             :: tau(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_sgeqp3_gpu( m, n, dA, ldda, jpvt, tau, dwork, lwork, info )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    integer          :: jpvt(*)
    real             :: tau(*)
    magma_devptr_t   :: dwork
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_sgeqr2x_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_sgeqr2x2_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_sgeqr2x3_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_sgeqr2x4_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_sgeqrf( m, n, A, lda, tau, work, lwork, info )
    integer          :: m
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: tau(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_sgeqrf_gpu( m, n, dA, ldda, tau, dT, info )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    real             :: tau(*)
    magma_devptr_t   :: dT
    integer          :: info
end

subroutine magmaf_sgeqrf_m( ngpu, m, n, A, lda, tau, work, lwork, info )
    integer          :: ngpu
    integer          :: m
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: tau(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_sgeqrf_ooc( m, n, A, lda, tau, work, lwork, info )
    integer          :: m
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: tau(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_sgeqrf2_gpu( m, n, dA, ldda, tau, info )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    real             :: tau(*)
    integer          :: info
end

subroutine magmaf_sgeqrf3_gpu( m, n, dA, ldda, tau, dT, info )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    real             :: tau(*)
    magma_devptr_t   :: dT
    integer          :: info
end

subroutine magmaf_sgeqrs_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
    real             :: tau(*)
    magma_devptr_t   :: dT
    magma_devptr_t   :: dB
    integer          :: lddb
    real             :: hwork(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_sgeqrs3_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
    real             :: tau(*)
    magma_devptr_t   :: dT
    magma_devptr_t   :: dB
    integer          :: lddb
    real             :: hwork(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_sgerbt_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
    real             :: U(*)
    real             :: V(*)
    integer          :: info
end

subroutine magmaf_sgerfs_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_sgesdd( jobz, m, n, A, lda, s, U, ldu, VT, ldvt, work, lwork, iwork,  &
        info )
    character        :: jobz
    integer          :: m
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: s(*)
    real             :: U(*)
    integer          :: ldu
    real             :: VT(*)
    integer          :: ldvt
    real             :: work(*)
    integer          :: lwork
    integer          :: iwork(*)
    integer          :: info
end

subroutine magmaf_sgesv( n, nrhs, A, lda, ipiv, B, ldb, info )
    integer          :: n
    integer          :: nrhs
    real             :: A(*)
    integer          :: lda
    integer          :: ipiv(*)
    real             :: B(*)
    integer          :: ldb
    integer          :: info
end

subroutine magmaf_sgesv_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_sgesv_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_sgesv_rbt( ref, n, nrhs, A, lda, B, ldb, info )
    character        :: ref
    integer          :: n
    integer          :: nrhs
    real             :: A(*)
    integer          :: lda
    real             :: B(*)
    integer          :: ldb
    integer          :: info
end

subroutine magmaf_sgesvd( jobu, jobvt, m, n, A, lda, s, U, ldu, VT, ldvt, work, lwork,  &
        info )
    character        :: jobu
    character        :: jobvt
    integer          :: m
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: s(*)
    real             :: U(*)
    integer          :: ldu
    real             :: VT(*)
    integer          :: ldvt
    real             :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_sgetf2_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_sgetf2_nopiv( m, n, A, lda, info )
    integer          :: m
    integer          :: n
    real             :: A(*)
    integer          :: lda
    integer          :: info
end

subroutine magmaf_sgetrf( m, n, A, lda, ipiv, info )
    integer          :: m
    integer          :: n
    real             :: A(*)
    integer          :: lda
    integer          :: ipiv(*)
    integer          :: info
end

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

subroutine magmaf_sgetrf_m( ngpu, m, n, A, lda, ipiv, info )
    integer          :: ngpu
    integer          :: m
    integer          :: n
    real             :: A(*)
    integer          :: lda
    integer          :: ipiv(*)
    integer          :: info
end

subroutine magmaf_sgetrf_nopiv( m, n, A, lda, info )
    integer          :: m
    integer          :: n
    real             :: A(*)
    integer          :: lda
    integer          :: info
end

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

subroutine magmaf_sgetri_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_sgetrs_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_sgetrs_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_ssyevd( jobz, uplo, n, A, lda, w, work, lwork, iwork, liwork, info )
    character        :: jobz
    character        :: uplo
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: w(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_ssyevd_gpu( jobz, uplo, n, dA, ldda, w, wA, ldwa, work, lwork, iwork,  &
        liwork, info )
    character        :: jobz
    character        :: uplo
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    real             :: w(*)
    real             :: wA(*)
    integer          :: ldwa
    real             :: work(*)
    integer          :: lwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_ssyevd_m( ngpu, jobz, uplo, n, A, lda, w, work, lwork, iwork, liwork,  &
        info )
    integer          :: ngpu
    character        :: jobz
    character        :: uplo
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: w(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_ssyevdx( jobz, range, uplo, n, A, lda, vl, vu, il, iu, mout, w, work,  &
        lwork, iwork, liwork, info )
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: vl
    real             :: vu
    integer          :: il
    integer          :: iu
    integer          :: mout(*)
    real             :: w(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_ssyevdx_gpu( jobz, range, uplo, n, dA, ldda, vl, vu, il, iu, mout, w,  &
        wA, ldwa, work, lwork, iwork, liwork, info )
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    real             :: vl
    real             :: vu
    integer          :: il
    integer          :: iu
    integer          :: mout(*)
    real             :: w(*)
    real             :: wA(*)
    integer          :: ldwa
    real             :: work(*)
    integer          :: lwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_ssyevdx_m( ngpu, jobz, range, uplo, n, A, lda, vl, vu, il, iu, mout, w,  &
        work, lwork, iwork, liwork, info )
    integer          :: ngpu
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: vl
    real             :: vu
    integer          :: il
    integer          :: iu
    integer          :: mout(*)
    real             :: w(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_ssyevdx_2stage( jobz, range, uplo, n, A, lda, vl, vu, il, iu, mout, w,  &
        work, lwork, iwork, liwork, info )
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: vl
    real             :: vu
    integer          :: il
    integer          :: iu
    integer          :: mout(*)
    real             :: w(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_ssyevdx_2stage_m( ngpu, jobz, range, uplo, n, A, lda, vl, vu, il, iu,  &
        mout, w, work, lwork, iwork, liwork, info )
    integer          :: ngpu
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: vl
    real             :: vu
    integer          :: il
    integer          :: iu
    integer          :: mout(*)
    real             :: w(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_ssygst( itype, uplo, n, A, lda, B, ldb, info )
    integer          :: itype
    character        :: uplo
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: B(*)
    integer          :: ldb
    integer          :: info
end

subroutine magmaf_ssygst_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_ssygst_m( ngpu, itype, uplo, n, A, lda, B, ldb, info )
    integer          :: ngpu
    integer          :: itype
    character        :: uplo
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: B(*)
    integer          :: ldb
    integer          :: info
end

subroutine magmaf_ssygvd( itype, jobz, uplo, n, A, lda, B, ldb, w, work, lwork, iwork,  &
        liwork, info )
    integer          :: itype
    character        :: jobz
    character        :: uplo
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: B(*)
    integer          :: ldb
    real             :: w(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_ssygvd_m( ngpu, itype, jobz, uplo, n, A, lda, B, ldb, w, work, lwork,  &
        iwork, liwork, info )
    integer          :: ngpu
    integer          :: itype
    character        :: jobz
    character        :: uplo
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: B(*)
    integer          :: ldb
    real             :: w(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_ssygvdx( itype, jobz, range, uplo, n, A, lda, B, ldb, vl, vu, il, iu,  &
        mout, w, work, lwork, iwork, liwork, info )
    integer          :: itype
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: B(*)
    integer          :: ldb
    real             :: vl
    real             :: vu
    integer          :: il
    integer          :: iu
    integer          :: mout(*)
    real             :: w(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_ssygvdx_m( ngpu, itype, jobz, range, uplo, n, A, lda, B, ldb, vl, vu,  &
        il, iu, mout, w, work, lwork, iwork, liwork, info )
    integer          :: ngpu
    integer          :: itype
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: B(*)
    integer          :: ldb
    real             :: vl
    real             :: vu
    integer          :: il
    integer          :: iu
    integer          :: mout(*)
    real             :: w(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_ssygvdx_2stage( itype, jobz, range, uplo, n, A, lda, B, ldb, vl, vu,  &
        il, iu, mout, w, work, lwork, iwork, liwork, info )
    integer          :: itype
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: B(*)
    integer          :: ldb
    real             :: vl
    real             :: vu
    integer          :: il
    integer          :: iu
    integer          :: mout(*)
    real             :: w(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_ssygvdx_2stage_m( ngpu, itype, jobz, range, uplo, n, A, lda, B, ldb,  &
        vl, vu, il, iu, mout, w, work, lwork, iwork, liwork, info )
    integer          :: ngpu
    integer          :: itype
    character        :: jobz
    character        :: range
    character        :: uplo
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: B(*)
    integer          :: ldb
    real             :: vl
    real             :: vu
    integer          :: il
    integer          :: iu
    integer          :: mout(*)
    real             :: w(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_ssysv( uplo, n, nrhs, A, lda, ipiv, B, ldb, info )
    character        :: uplo
    integer          :: n
    integer          :: nrhs
    real             :: A(*)
    integer          :: lda
    integer          :: ipiv(*)
    real             :: B(*)
    integer          :: ldb
    integer          :: info
end

subroutine magmaf_ssysv_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_ssytrd( uplo, n, A, lda, d, e, tau, work, lwork, info )
    character        :: uplo
    integer          :: n
    real             :: A(*)
    integer          :: lda
    real             :: d(*)
    real             :: e(*)
    real             :: tau(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_ssytrd_gpu( uplo, n, dA, ldda, d, e, tau, wA, ldwa, work, lwork, info )
    character        :: uplo
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    real             :: d(*)
    real             :: e(*)
    real             :: tau(*)
    real             :: wA(*)
    integer          :: ldwa
    real             :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_ssytrd2_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
    real             :: d(*)
    real             :: e(*)
    real             :: tau(*)
    real             :: wA(*)
    integer          :: ldwa
    real             :: work(*)
    integer          :: lwork
    magma_devptr_t   :: dwork
    integer          :: ldwork
    integer          :: info
end

integer function magmaf_ssytrd_sb2st( uplo, n, nb, Vblksiz, A, lda, d, e, V, ldv, TAU,  &
        compT, T, ldt )
    character        :: uplo
    integer          :: n
    integer          :: nb
    integer          :: Vblksiz
    real             :: A(*)
    integer          :: lda
    real             :: d(*)
    real             :: e(*)
    real             :: V(*)
    integer          :: ldv
    real             :: TAU(*)
    integer          :: compT
    real             :: T(*)
    integer          :: ldt
end

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

subroutine magmaf_ssytrf( uplo, n, A, lda, ipiv, info )
    character        :: uplo
    integer          :: n
    real             :: A(*)
    integer          :: lda
    integer          :: ipiv(*)
    integer          :: info
end

subroutine magmaf_ssytrf_aasen( uplo, cpu_panel, n, A, lda, ipiv, info )
    character        :: uplo
    integer          :: cpu_panel
    integer          :: n
    real             :: A(*)
    integer          :: lda
    integer          :: ipiv(*)
    integer          :: info
end

subroutine magmaf_ssytrf_nopiv( uplo, n, A, lda, info )
    character        :: uplo
    integer          :: n
    real             :: A(*)
    integer          :: lda
    integer          :: info
end

subroutine magmaf_ssytrf_nopiv_cpu( uplo, n, ib, A, lda, info )
    character        :: uplo
    integer          :: n
    integer          :: ib
    real             :: A(*)
    integer          :: lda
    integer          :: info
end

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

subroutine magmaf_ssytrs_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_slaln2( trans, na, nw, smin, ca, A, lda, d1, d2, B, ldb, wr, wi, X,  &
        ldx, scale, xnorm, info )
    integer          :: trans
    integer          :: na
    integer          :: nw
    real             :: smin
    real             :: ca
    real             :: A(*)
    integer          :: lda
    real             :: d1
    real             :: d2
    real             :: B(*)
    integer          :: ldb
    real             :: wr
    real             :: wi
    real             :: X(*)
    integer          :: ldx
    real             :: scale(*)
    real             :: xnorm(*)
    integer          :: info
end

subroutine magmaf_slaqtrsd( trans, n, T, ldt, x, ldx, cnorm, info )
    character        :: trans
    integer          :: n
    real             :: T(*)
    integer          :: ldt
    real             :: x(*)
    integer          :: ldx
    real             :: cnorm(*)
    integer          :: info
end

integer function magmaf_slarf_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_slarfb2_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_slauum( uplo, n, A, lda, info )
    character        :: uplo
    integer          :: n
    real             :: A(*)
    integer          :: lda
    integer          :: info
end

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

subroutine magmaf_sposv( uplo, n, nrhs, A, lda, B, ldb, info )
    character        :: uplo
    integer          :: n
    integer          :: nrhs
    real             :: A(*)
    integer          :: lda
    real             :: B(*)
    integer          :: ldb
    integer          :: info
end

subroutine magmaf_sposv_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_spotf2_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_spotrf( uplo, n, A, lda, info )
    character        :: uplo
    integer          :: n
    real             :: A(*)
    integer          :: lda
    integer          :: info
end

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

subroutine magmaf_spotrf_m( ngpu, uplo, n, A, lda, info )
    integer          :: ngpu
    character        :: uplo
    integer          :: n
    real             :: A(*)
    integer          :: lda
    integer          :: info
end

subroutine magmaf_spotri( uplo, n, A, lda, info )
    character        :: uplo
    integer          :: n
    real             :: A(*)
    integer          :: lda
    integer          :: info
end

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

subroutine magmaf_spotrs_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_sstedx( range, n, vl, vu, il, iu, d, e, Z, ldz, rwork, lrwork, iwork,  &
        liwork, dwork, info )
    character        :: range
    integer          :: n
    real             :: vl
    real             :: vu
    integer          :: il
    integer          :: iu
    real             :: d(*)
    real             :: e(*)
    real             :: Z(*)
    integer          :: ldz
    real             :: rwork(*)
    integer          :: lrwork
    integer          :: iwork(*)
    integer          :: liwork
    magma_devptr_t   :: dwork
    integer          :: info
end

subroutine magmaf_sstedx_m( ngpu, range, n, vl, vu, il, iu, d, e, Z, ldz, rwork, lrwork,  &
        iwork, liwork, info )
    integer          :: ngpu
    character        :: range
    integer          :: n
    real             :: vl
    real             :: vu
    integer          :: il
    integer          :: iu
    real             :: d(*)
    real             :: e(*)
    real             :: Z(*)
    integer          :: ldz
    real             :: rwork(*)
    integer          :: lrwork
    integer          :: iwork(*)
    integer          :: liwork
    integer          :: info
end

subroutine magmaf_strevc3( side, howmany, select, n, T, ldt, VL, ldvl, VR, ldvr, mm,  &
        mout, work, lwork, info )
    character        :: side
    character        :: howmany
    integer          :: select(*)
    integer          :: n
    real             :: T(*)
    integer          :: ldt
    real             :: VL(*)
    integer          :: ldvl
    real             :: VR(*)
    integer          :: ldvr
    integer          :: mm
    integer          :: mout(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_strevc3_mt( side, howmany, select, n, T, ldt, VL, ldvl, VR, ldvr, mm,  &
        mout, work, lwork, info )
    character        :: side
    character        :: howmany
    integer          :: select(*)
    integer          :: n
    real             :: T(*)
    integer          :: ldt
    real             :: VL(*)
    integer          :: ldvl
    real             :: VR(*)
    integer          :: ldvr
    integer          :: mm
    integer          :: mout(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: info
end

integer function magmaf_strsm_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
    real             :: alpha
    real             :: A(*)
    integer          :: lda
    real             :: B(*)
    integer          :: ldb
end

subroutine magmaf_strtri( uplo, diag, n, A, lda, info )
    character        :: uplo
    character        :: diag
    integer          :: n
    real             :: A(*)
    integer          :: lda
    integer          :: info
end

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

subroutine magmaf_sorgbr( vect, m, n, k, A, lda, tau, work, lwork, info )
    character        :: vect
    integer          :: m
    integer          :: n
    integer          :: k
    real             :: A(*)
    integer          :: lda
    real             :: tau(*)
    real             :: work(*)
    integer          :: lwork
    integer          :: info
end

subroutine magmaf_sorghr( n, ilo, ihi, A, lda, tau, dT, nb, info )
    integer          :: n
    integer          :: ilo
    integer          :: ihi
    real             :: A(*)
    integer          :: lda
    real             :: tau(*)
    magma_devptr_t   :: dT
    integer          :: nb
    integer          :: info
end

subroutine magmaf_sorghr_m( n, ilo, ihi, A, lda, tau, T, nb, info )
    integer          :: n
    integer          :: ilo
    integer          :: ihi
    real             :: A(*)
    integer          :: lda
    real             :: tau(*)
    real             :: T(*)
    integer          :: nb
    integer          :: info
end

subroutine magmaf_sorglq( m, n, k, A, lda, tau, dT, nb, info )
    integer          :: m
    integer          :: n
    integer          :: k
    real             :: A(*)
    integer          :: lda
    real             :: tau(*)
    magma_devptr_t   :: dT
    integer          :: nb
    integer          :: info
end

subroutine magmaf_sorgqr( m, n, k, A, lda, tau, dT, nb, info )
    integer          :: m
    integer          :: n
    integer          :: k
    real             :: A(*)
    integer          :: lda
    real             :: tau(*)
    magma_devptr_t   :: dT
    integer          :: nb
    integer          :: info
end

subroutine magmaf_sorgqr_gpu( m, n, k, dA, ldda, tau, dT, nb, info )
    integer          :: m
    integer          :: n
    integer          :: k
    magma_devptr_t   :: dA
    integer          :: ldda
    real             :: tau(*)
    magma_devptr_t   :: dT
    integer          :: nb
    integer          :: info
end

subroutine magmaf_sorgqr_m( m, n, k, A, lda, tau, T, nb, info )
    integer          :: m
    integer          :: n
    integer          :: k
    real             :: A(*)
    integer          :: lda
    real             :: tau(*)
    real             :: T(*)
    integer          :: nb
    integer          :: info
end

subroutine magmaf_sorgqr2( m, n, k, A, lda, tau, info )
    integer          :: m
    integer          :: n
    integer          :: k
    real             :: A(*)
    integer          :: lda
    real             :: tau(*)
    integer          :: info
end

subroutine magmaf_sormbr( 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
    real             :: A(*)
    integer          :: lda
    real             :: tau(*)
    real             :: C(*)
    integer          :: ldc
    real             :: work(*)
    integer          :: lwork
    integer          :: info
end

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

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

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

subroutine magmaf_sormql2_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
    real             :: tau(*)
    magma_devptr_t   :: dC
    integer          :: lddc
    real             :: wA(*)
    integer          :: ldwa
    integer          :: info
end

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

subroutine magmaf_sormqr_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
    real             :: tau(*)
    magma_devptr_t   :: dC
    integer          :: lddc
    real             :: hwork(*)
    integer          :: lwork
    magma_devptr_t   :: dT
    integer          :: nb
    integer          :: info
end

subroutine magmaf_sormqr2_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
    real             :: tau(*)
    magma_devptr_t   :: dC
    integer          :: lddc
    real             :: wA(*)
    integer          :: ldwa
    integer          :: info
end

subroutine magmaf_sormqr_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
    real             :: A(*)
    integer          :: lda
    real             :: tau(*)
    real             :: C(*)
    integer          :: ldc
    real             :: work(*)
    integer          :: lwork
    integer          :: info
end

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

subroutine magmaf_sormtr_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
    real             :: tau(*)
    magma_devptr_t   :: dC
    integer          :: lddc
    real             :: wA(*)
    integer          :: ldwa
    integer          :: info
end

subroutine magmaf_sormtr_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
    real             :: A(*)
    integer          :: lda
    real             :: tau(*)
    real             :: C(*)
    integer          :: ldc
    real             :: work(*)
    integer          :: lwork
    integer          :: info
end

integer function magmaf_s_isnan( x )
    real             :: x
end

integer function magmaf_s_isinf( x )
    real             :: x
end

integer function magmaf_s_isnan_inf( x )
    real             :: x
end

real function magmaf_smake_lwork( lwork )
    integer          :: lwork
end

integer function magmaf_snan_inf( uplo, m, n, A, lda, cnt_nan, cnt_inf )
    character        :: uplo
    integer          :: m
    integer          :: n
    real             :: A(*)
    integer          :: lda
    integer          :: cnt_nan(*)
    integer          :: cnt_inf(*)
end

integer function magmaf_snan_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_sprint( m, n, A, lda )
    integer          :: m
    integer          :: n
    real             :: A(*)
    integer          :: lda
end

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

subroutine magmaf_spanel_to_q( uplo, ib, A, lda, work )
    character        :: uplo
    integer          :: ib
    real             :: A(*)
    integer          :: lda
    real             :: work(*)
end

subroutine magmaf_sq_to_panel( uplo, ib, A, lda, work )
    character        :: uplo
    integer          :: ib
    real             :: A(*)
    integer          :: lda
    real             :: work(*)
end

end interface

end module magma_sfortran
