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

module magmablas_sfortran

use magma_param

implicit none

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

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

subroutine magmablasf_stranspose( m, n, dA, ldda, dAT, lddat, queue )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dAT
    integer          :: lddat
    magma_devptr_t   :: queue
end

subroutine magmablasf_sgetmatrix_transpose( m, n, nb, dAT, ldda, hA, lda, dwork, lddw,  &
        queues )
    integer          :: m
    integer          :: n
    integer          :: nb
    magma_devptr_t   :: dAT
    integer          :: ldda
    real             :: hA(*)
    integer          :: lda
    magma_devptr_t   :: dwork
    integer          :: lddw
    magma_devptr_t   :: queues(*)
end

subroutine magmablasf_ssetmatrix_transpose( m, n, nb, hA, lda, dAT, ldda, dwork, lddw,  &
        queues )
    integer          :: m
    integer          :: n
    integer          :: nb
    real             :: hA(*)
    integer          :: lda
    magma_devptr_t   :: dAT
    integer          :: ldda
    magma_devptr_t   :: dwork
    integer          :: lddw
    magma_devptr_t   :: queues(*)
end

subroutine magmablasf_sprbt( n, dA, ldda, du, dv, queue )
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: du
    magma_devptr_t   :: dv
    magma_devptr_t   :: queue
end

subroutine magmablasf_sprbt_mv( n, dv, db, queue )
    integer          :: n
    magma_devptr_t   :: dv
    magma_devptr_t   :: db
    magma_devptr_t   :: queue
end

subroutine magmablasf_sprbt_mtv( n, du, db, queue )
    integer          :: n
    magma_devptr_t   :: du
    magma_devptr_t   :: db
    magma_devptr_t   :: queue
end

subroutine magmablasf_sgeadd( m, n, alpha, dA, ldda, dB, lddb, queue )
    integer          :: m
    integer          :: n
    real             :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    magma_devptr_t   :: queue
end

subroutine magmablasf_sgeadd2( m, n, alpha, dA, ldda, beta, dB, lddb, queue )
    integer          :: m
    integer          :: n
    real             :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    real             :: beta
    magma_devptr_t   :: dB
    integer          :: lddb
    magma_devptr_t   :: queue
end

subroutine magmablasf_slacpy( uplo, m, n, dA, ldda, dB, lddb, queue )
    character        :: uplo
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    magma_devptr_t   :: queue
end

subroutine magmablasf_slacpy_conj( n, dA1, lda1, dA2, lda2, queue )
    integer          :: n
    magma_devptr_t   :: dA1
    integer          :: lda1
    magma_devptr_t   :: dA2
    integer          :: lda2
    magma_devptr_t   :: queue
end

subroutine magmablasf_slacpy_sym_in( uplo, m, n, rows, perm, dA, ldda, dB, lddb, queue )
    character        :: uplo
    integer          :: m
    integer          :: n
    integer          :: rows(*)
    integer          :: perm(*)
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    magma_devptr_t   :: queue
end

subroutine magmablasf_slacpy_sym_out( uplo, m, n, rows, perm, dA, ldda, dB, lddb, queue )
    character        :: uplo
    integer          :: m
    integer          :: n
    integer          :: rows(*)
    integer          :: perm(*)
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    magma_devptr_t   :: queue
end

real function magmablasf_slange( norm, m, n, dA, ldda, dwork, lwork, queue )
    character        :: norm
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dwork
    integer          :: lwork
    magma_devptr_t   :: queue
end

real function magmablasf_slansy( norm, uplo, n, dA, ldda, dwork, lwork, queue )
    character        :: norm
    character        :: uplo
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dwork
    integer          :: lwork
    magma_devptr_t   :: queue
end

subroutine magmablasf_slascl( type, kl, ku, cfrom, cto, m, n, dA, ldda, queue, info )
    character        :: type
    integer          :: kl
    integer          :: ku
    real             :: cfrom
    real             :: cto
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: queue
    integer          :: info
end

subroutine magmablasf_slascl_2x2( type, m, dW, lddw, dA, ldda, queue, info )
    character        :: type
    integer          :: m
    magma_devptr_t   :: dW
    integer          :: lddw
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: queue
    integer          :: info
end

subroutine magmablasf_slascl2( type, m, n, dD, dA, ldda, queue, info )
    character        :: type
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dD
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: queue
    integer          :: info
end

subroutine magmablasf_slascl_diag( type, m, n, dD, lddd, dA, ldda, queue, info )
    character        :: type
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dD
    integer          :: lddd
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: queue
    integer          :: info
end

subroutine magmablasf_slaset( uplo, m, n, offdiag, diag, dA, ldda, queue )
    character        :: uplo
    integer          :: m
    integer          :: n
    real             :: offdiag
    real             :: diag
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: queue
end

subroutine magmablasf_slaset_band( uplo, m, n, k, offdiag, diag, dA, ldda, queue )
    character        :: uplo
    integer          :: m
    integer          :: n
    integer          :: k
    real             :: offdiag
    real             :: diag
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: queue
end

subroutine magmablasf_slaswp( n, dAT, ldda, k1, k2, ipiv, inci, queue )
    integer          :: n
    magma_devptr_t   :: dAT
    integer          :: ldda
    integer          :: k1
    integer          :: k2
    integer          :: ipiv(*)
    integer          :: inci
    magma_devptr_t   :: queue
end

subroutine magmablasf_slaswp2( n, dAT, ldda, k1, k2, d_ipiv, inci, queue )
    integer          :: n
    magma_devptr_t   :: dAT
    integer          :: ldda
    integer          :: k1
    integer          :: k2
    magma_devptr_t   :: d_ipiv
    integer          :: inci
    magma_devptr_t   :: queue
end

subroutine magmablasf_slaswp_sym( n, dA, ldda, k1, k2, ipiv, inci, queue )
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    integer          :: k1
    integer          :: k2
    integer          :: ipiv(*)
    integer          :: inci
    magma_devptr_t   :: queue
end

subroutine magmablasf_slaswpx( n, dA, ldx, ldy, k1, k2, ipiv, inci, queue )
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldx
    integer          :: ldy
    integer          :: k1
    integer          :: k2
    integer          :: ipiv(*)
    integer          :: inci
    magma_devptr_t   :: queue
end

subroutine magmablasf_ssymmetrize( uplo, m, dA, ldda, queue )
    character        :: uplo
    integer          :: m
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: queue
end

subroutine magmablasf_ssymmetrize_tiles( uplo, m, dA, ldda, ntile, mstride, nstride,  &
        queue )
    character        :: uplo
    integer          :: m
    magma_devptr_t   :: dA
    integer          :: ldda
    integer          :: ntile
    integer          :: mstride
    integer          :: nstride
    magma_devptr_t   :: queue
end

subroutine magmablasf_strtri_diag( uplo, diag, n, dA, ldda, d_dinvA, queue )
    character        :: uplo
    character        :: diag
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: d_dinvA
    magma_devptr_t   :: queue
end

integer function magmaf_slarfb_gpu( side, trans, direct, storev, m, n, k, dV, lddv, dT,  &
        lddt, dC, lddc, dwork, ldwork, queue )
    character        :: side
    character        :: trans
    character        :: direct
    character        :: storev
    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

integer function magmaf_slarfb_gpu_gemm( side, trans, direct, storev, m, n, k, dV, lddv,  &
        dT, lddt, dC, lddc, dwork, ldwork, dworkvt, ldworkvt, queue )
    character        :: side
    character        :: trans
    character        :: direct
    character        :: storev
    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   :: dworkvt
    integer          :: ldworkvt
    magma_devptr_t   :: queue
end

subroutine magmaf_slarfbx_gpu( m, k, V, ldv, dT, ldt, c, dwork, queue )
    integer          :: m
    integer          :: k
    magma_devptr_t   :: V
    integer          :: ldv
    magma_devptr_t   :: dT
    integer          :: ldt
    magma_devptr_t   :: c
    magma_devptr_t   :: dwork
    magma_devptr_t   :: queue
end

subroutine magmaf_slarfgtx_gpu( n, dx0, dx, dtau, dxnorm, dA, iter, V, ldv, T, ldt,  &
        dwork, queue )
    integer          :: n
    magma_devptr_t   :: dx0
    magma_devptr_t   :: dx
    magma_devptr_t   :: dtau
    magma_devptr_t   :: dxnorm
    magma_devptr_t   :: dA
    integer          :: iter
    magma_devptr_t   :: V
    integer          :: ldv
    magma_devptr_t   :: T
    integer          :: ldt
    magma_devptr_t   :: dwork
    magma_devptr_t   :: queue
end

subroutine magmaf_slarfgx_gpu( n, dx0, dx, dtau, dxnorm, dA, iter, queue )
    integer          :: n
    magma_devptr_t   :: dx0
    magma_devptr_t   :: dx
    magma_devptr_t   :: dtau
    magma_devptr_t   :: dxnorm
    magma_devptr_t   :: dA
    integer          :: iter
    magma_devptr_t   :: queue
end

subroutine magmaf_slarfx_gpu( m, n, v, tau, C, ldc, xnorm, dT, iter, work, queue )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: v
    magma_devptr_t   :: tau
    magma_devptr_t   :: C
    integer          :: ldc
    magma_devptr_t   :: xnorm
    magma_devptr_t   :: dT
    integer          :: iter
    magma_devptr_t   :: work
    magma_devptr_t   :: queue
end

subroutine magmablasf_saxpycp( m, dr, dx, db, queue )
    integer          :: m
    magma_devptr_t   :: dr
    magma_devptr_t   :: dx
    magma_devptr_t   :: db
    magma_devptr_t   :: queue
end

subroutine magmablasf_sswap( n, dx, incx, dy, incy, queue )
    integer          :: n
    magma_devptr_t   :: dx
    integer          :: incx
    magma_devptr_t   :: dy
    integer          :: incy
    magma_devptr_t   :: queue
end

subroutine magmablasf_sswapblk( order, n, dA, ldda, dB, lddb, i1, i2, ipiv, inci, offset,  &
        queue )
    character        :: order
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    integer          :: i1
    integer          :: i2
    integer          :: ipiv(*)
    integer          :: inci
    integer          :: offset
    magma_devptr_t   :: queue
end

subroutine magmablasf_sswapdblk( n, nb, dA, ldda, inca, dB, lddb, incb, queue )
    integer          :: n
    integer          :: nb
    magma_devptr_t   :: dA
    integer          :: ldda
    integer          :: inca
    magma_devptr_t   :: dB
    integer          :: lddb
    integer          :: incb
    magma_devptr_t   :: queue
end

subroutine magmablasf_snrm2_adjust( k, dxnorm, dc, queue )
    integer          :: k
    magma_devptr_t   :: dxnorm
    magma_devptr_t   :: dc
    magma_devptr_t   :: queue
end

subroutine magmablasf_snrm2_check( m, n, dA, ldda, dxnorm, dlsticc, queue )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dxnorm
    magma_devptr_t   :: dlsticc
    magma_devptr_t   :: queue
end

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

subroutine magmablasf_snrm2_row_check_adjust( k, tol, dxnorm, dxnorm2, dC, lddc, dlsticc,  &
        queue )
    integer          :: k
    real             :: tol
    magma_devptr_t   :: dxnorm
    magma_devptr_t   :: dxnorm2
    magma_devptr_t   :: dC
    integer          :: lddc
    magma_devptr_t   :: dlsticc
    magma_devptr_t   :: queue
end

subroutine magmablasf_strsv( uplo, transA, diag, n, dA, ldda, db, incb, queue )
    character        :: uplo
    character        :: transA
    character        :: diag
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: db
    integer          :: incb
    magma_devptr_t   :: queue
end

subroutine magmablasf_strsv_outofplace( uplo, transA, diag, n, dA, ldda, db, incb, dx,  &
        queue, flag )
    character        :: uplo
    character        :: transA
    character        :: diag
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: db
    integer          :: incb
    magma_devptr_t   :: dx
    magma_devptr_t   :: queue
    integer          :: flag
end

subroutine magmablasf_sgemv( trans, m, n, alpha, dA, ldda, dx, incx, beta, dy, incy,  &
        queue )
    character        :: trans
    integer          :: m
    integer          :: n
    real             :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dx
    integer          :: incx
    real             :: beta
    magma_devptr_t   :: dy
    integer          :: incy
    magma_devptr_t   :: queue
end

subroutine magmablasf_sgemv_conj( m, n, alpha, dA, ldda, dx, incx, beta, dy, incy, queue  &
        )
    integer          :: m
    integer          :: n
    real             :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dx
    integer          :: incx
    real             :: beta
    magma_devptr_t   :: dy
    integer          :: incy
    magma_devptr_t   :: queue
end

integer function magmablasf_ssymv( uplo, n, alpha, dA, ldda, dx, incx, beta, dy, incy,  &
        queue )
    character        :: uplo
    integer          :: n
    real             :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dx
    integer          :: incx
    real             :: beta
    magma_devptr_t   :: dy
    integer          :: incy
    magma_devptr_t   :: queue
end

integer function magmablasf_ssymv_work( uplo, n, alpha, dA, ldda, dx, incx, beta, dy,  &
        incy, dwork, lwork, queue )
    character        :: uplo
    integer          :: n
    real             :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dx
    integer          :: incx
    real             :: beta
    magma_devptr_t   :: dy
    integer          :: incy
    magma_devptr_t   :: dwork
    integer          :: lwork
    magma_devptr_t   :: queue
end

subroutine magmablasf_sgemm( transA, transB, m, n, k, alpha, dA, ldda, dB, lddb, beta,  &
        dC, lddc, queue )
    character        :: transA
    character        :: transB
    integer          :: m
    integer          :: n
    integer          :: k
    real             :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    real             :: beta
    magma_devptr_t   :: dC
    integer          :: lddc
    magma_devptr_t   :: queue
end

subroutine magmablasf_sgemm_reduce( m, n, k, alpha, dA, ldda, dB, lddb, beta, dC, lddc,  &
        queue )
    integer          :: m
    integer          :: n
    integer          :: k
    real             :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    real             :: beta
    magma_devptr_t   :: dC
    integer          :: lddc
    magma_devptr_t   :: queue
end

subroutine magmablasf_strsm( side, uplo, transA, diag, m, n, alpha, dA, ldda, dB, lddb,  &
        queue )
    character        :: side
    character        :: uplo
    character        :: transA
    character        :: diag
    integer          :: m
    integer          :: n
    real             :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    magma_devptr_t   :: queue
end

subroutine magmablasf_strsm_outofplace( side, uplo, transA, diag, m, n, alpha, dA, ldda,  &
        dB, lddb, dX, lddx, flag, d_dinvA, dinvA_length, queue )
    character        :: side
    character        :: uplo
    character        :: transA
    character        :: diag
    integer          :: m
    integer          :: n
    real             :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    magma_devptr_t   :: dX
    integer          :: lddx
    integer          :: flag
    magma_devptr_t   :: d_dinvA
    integer          :: dinvA_length
    magma_devptr_t   :: queue
end

subroutine magmablasf_strsm_work( side, uplo, transA, diag, m, n, alpha, dA, ldda, dB,  &
        lddb, dX, lddx, flag, d_dinvA, dinvA_length, queue )
    character        :: side
    character        :: uplo
    character        :: transA
    character        :: diag
    integer          :: m
    integer          :: n
    real             :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    magma_devptr_t   :: dX
    integer          :: lddx
    integer          :: flag
    magma_devptr_t   :: d_dinvA
    integer          :: dinvA_length
    magma_devptr_t   :: queue
end

subroutine magmaf_ssetvector( n, hx_src, incx, dy_dst, incy, queue )
    integer          :: n
    real             :: hx_src(*)
    integer          :: incx
    magma_devptr_t   :: dy_dst
    integer          :: incy
    magma_devptr_t   :: queue
end

subroutine magmaf_sgetvector( n, dx_src, incx, hy_dst, incy, queue )
    integer          :: n
    magma_devptr_t   :: dx_src
    integer          :: incx
    real             :: hy_dst(*)
    integer          :: incy
    magma_devptr_t   :: queue
end

subroutine magmaf_scopyvector( n, dx_src, incx, dy_dst, incy, queue )
    integer          :: n
    magma_devptr_t   :: dx_src
    integer          :: incx
    magma_devptr_t   :: dy_dst
    integer          :: incy
    magma_devptr_t   :: queue
end

subroutine magmaf_ssetvector_async( n, hx_src, incx, dy_dst, incy, queue )
    integer          :: n
    real             :: hx_src(*)
    integer          :: incx
    magma_devptr_t   :: dy_dst
    integer          :: incy
    magma_devptr_t   :: queue
end

subroutine magmaf_sgetvector_async( n, dx_src, incx, hy_dst, incy, queue )
    integer          :: n
    magma_devptr_t   :: dx_src
    integer          :: incx
    real             :: hy_dst(*)
    integer          :: incy
    magma_devptr_t   :: queue
end

subroutine magmaf_scopyvector_async( n, dx_src, incx, dy_dst, incy, queue )
    integer          :: n
    magma_devptr_t   :: dx_src
    integer          :: incx
    magma_devptr_t   :: dy_dst
    integer          :: incy
    magma_devptr_t   :: queue
end

subroutine magmaf_ssetmatrix( m, n, hA_src, lda, dB_dst, lddb, queue )
    integer          :: m
    integer          :: n
    real             :: hA_src(*)
    integer          :: lda
    magma_devptr_t   :: dB_dst
    integer          :: lddb
    magma_devptr_t   :: queue
end

subroutine magmaf_sgetmatrix( m, n, dA_src, ldda, hB_dst, ldb, queue )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA_src
    integer          :: ldda
    real             :: hB_dst(*)
    integer          :: ldb
    magma_devptr_t   :: queue
end

subroutine magmaf_scopymatrix( m, n, dA_src, ldda, dB_dst, lddb, queue )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA_src
    integer          :: ldda
    magma_devptr_t   :: dB_dst
    integer          :: lddb
    magma_devptr_t   :: queue
end

subroutine magmaf_ssetmatrix_async( m, n, hA_src, lda, dB_dst, lddb, queue )
    integer          :: m
    integer          :: n
    real             :: hA_src(*)
    integer          :: lda
    magma_devptr_t   :: dB_dst
    integer          :: lddb
    magma_devptr_t   :: queue
end

subroutine magmaf_sgetmatrix_async( m, n, dA_src, ldda, hB_dst, ldb, queue )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA_src
    integer          :: ldda
    real             :: hB_dst(*)
    integer          :: ldb
    magma_devptr_t   :: queue
end

subroutine magmaf_scopymatrix_async( m, n, dA_src, ldda, dB_dst, lddb, queue )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA_src
    integer          :: ldda
    magma_devptr_t   :: dB_dst
    integer          :: lddb
    magma_devptr_t   :: queue
end

integer function magmaf_isamax( n, dx, incx, queue )
    integer          :: n
    magma_devptr_t   :: dx
    integer          :: incx
    magma_devptr_t   :: queue
end

integer function magmaf_isamin( n, dx, incx, queue )
    integer          :: n
    magma_devptr_t   :: dx
    integer          :: incx
    magma_devptr_t   :: queue
end

real function magmaf_sasum( n, dx, incx, queue )
    integer          :: n
    magma_devptr_t   :: dx
    integer          :: incx
    magma_devptr_t   :: queue
end

subroutine magmaf_saxpy( n, alpha, dx, incx, dy, incy, queue )
    integer          :: n
    real             :: alpha
    magma_devptr_t   :: dx
    integer          :: incx
    magma_devptr_t   :: dy
    integer          :: incy
    magma_devptr_t   :: queue
end

subroutine magmaf_scopy( n, dx, incx, dy, incy, queue )
    integer          :: n
    magma_devptr_t   :: dx
    integer          :: incx
    magma_devptr_t   :: dy
    integer          :: incy
    magma_devptr_t   :: queue
end

real function magmaf_sdot( n, dx, incx, dy, incy, queue )
    integer          :: n
    magma_devptr_t   :: dx
    integer          :: incx
    magma_devptr_t   :: dy
    integer          :: incy
    magma_devptr_t   :: queue
end

real function magmaf_snrm2( n, dx, incx, queue )
    integer          :: n
    magma_devptr_t   :: dx
    integer          :: incx
    magma_devptr_t   :: queue
end

subroutine magmaf_srot( n, dx, incx, dy, incy, dc, ds, queue )
    integer          :: n
    magma_devptr_t   :: dx
    integer          :: incx
    magma_devptr_t   :: dy
    integer          :: incy
    real             :: dc
    real             :: ds
    magma_devptr_t   :: queue
end

subroutine magmaf_srotg( a, b, c, s, queue )
    magma_devptr_t   :: a
    magma_devptr_t   :: b
    magma_devptr_t   :: c
    magma_devptr_t   :: s
    magma_devptr_t   :: queue
end

subroutine magmaf_srotm( n, dx, incx, dy, incy, param, queue )
    integer          :: n
    magma_devptr_t   :: dx
    integer          :: incx
    magma_devptr_t   :: dy
    integer          :: incy
    magma_devptr_t   :: param
    magma_devptr_t   :: queue
end

subroutine magmaf_srotmg( d1, d2, x1, y1, param, queue )
    magma_devptr_t   :: d1
    magma_devptr_t   :: d2
    magma_devptr_t   :: x1
    magma_devptr_t   :: y1
    magma_devptr_t   :: param
    magma_devptr_t   :: queue
end

subroutine magmaf_sscal( n, alpha, dx, incx, queue )
    integer          :: n
    real             :: alpha
    magma_devptr_t   :: dx
    integer          :: incx
    magma_devptr_t   :: queue
end

subroutine magmaf_sswap( n, dx, incx, dy, incy, queue )
    integer          :: n
    magma_devptr_t   :: dx
    integer          :: incx
    magma_devptr_t   :: dy
    integer          :: incy
    magma_devptr_t   :: queue
end

subroutine magmaf_sgemv( transA, m, n, alpha, dA, ldda, dx, incx, beta, dy, incy, queue )
    character        :: transA
    integer          :: m
    integer          :: n
    real             :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dx
    integer          :: incx
    real             :: beta
    magma_devptr_t   :: dy
    integer          :: incy
    magma_devptr_t   :: queue
end

subroutine magmaf_sger( m, n, alpha, dx, incx, dy, incy, dA, ldda, queue )
    integer          :: m
    integer          :: n
    real             :: alpha
    magma_devptr_t   :: dx
    integer          :: incx
    magma_devptr_t   :: dy
    integer          :: incy
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: queue
end

subroutine magmaf_ssymv( uplo, n, alpha, dA, ldda, dx, incx, beta, dy, incy, queue )
    character        :: uplo
    integer          :: n
    real             :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dx
    integer          :: incx
    real             :: beta
    magma_devptr_t   :: dy
    integer          :: incy
    magma_devptr_t   :: queue
end

subroutine magmaf_ssyr( uplo, n, alpha, dx, incx, dA, ldda, queue )
    character        :: uplo
    integer          :: n
    real             :: alpha
    magma_devptr_t   :: dx
    integer          :: incx
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: queue
end

subroutine magmaf_ssyr2( uplo, n, alpha, dx, incx, dy, incy, dA, ldda, queue )
    character        :: uplo
    integer          :: n
    real             :: alpha
    magma_devptr_t   :: dx
    integer          :: incx
    magma_devptr_t   :: dy
    integer          :: incy
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: queue
end

subroutine magmaf_strmv( uplo, trans, diag, n, dA, ldda, dx, incx, queue )
    character        :: uplo
    character        :: trans
    character        :: diag
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dx
    integer          :: incx
    magma_devptr_t   :: queue
end

subroutine magmaf_strsv( uplo, trans, diag, n, dA, ldda, dx, incx, queue )
    character        :: uplo
    character        :: trans
    character        :: diag
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dx
    integer          :: incx
    magma_devptr_t   :: queue
end

subroutine magmaf_sgemm( transA, transB, m, n, k, alpha, dA, ldda, dB, lddb, beta, dC,  &
        lddc, queue )
    character        :: transA
    character        :: transB
    integer          :: m
    integer          :: n
    integer          :: k
    real             :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    real             :: beta
    magma_devptr_t   :: dC
    integer          :: lddc
    magma_devptr_t   :: queue
end

subroutine magmaf_ssymm( side, uplo, m, n, alpha, dA, ldda, dB, lddb, beta, dC, lddc,  &
        queue )
    character        :: side
    character        :: uplo
    integer          :: m
    integer          :: n
    real             :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    real             :: beta
    magma_devptr_t   :: dC
    integer          :: lddc
    magma_devptr_t   :: queue
end

subroutine magmaf_ssyr2k( uplo, trans, n, k, alpha, dA, ldda, dB, lddb, beta, dC, lddc,  &
        queue )
    character        :: uplo
    character        :: trans
    integer          :: n
    integer          :: k
    real             :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    real             :: beta
    magma_devptr_t   :: dC
    integer          :: lddc
    magma_devptr_t   :: queue
end

subroutine magmaf_ssyrk( uplo, trans, n, k, alpha, dA, ldda, beta, dC, lddc, queue )
    character        :: uplo
    character        :: trans
    integer          :: n
    integer          :: k
    real             :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    real             :: beta
    magma_devptr_t   :: dC
    integer          :: lddc
    magma_devptr_t   :: queue
end

subroutine magmaf_strmm( side, uplo, trans, diag, m, n, alpha, dA, ldda, dB, lddb, queue  &
        )
    character        :: side
    character        :: uplo
    character        :: trans
    character        :: diag
    integer          :: m
    integer          :: n
    real             :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    magma_devptr_t   :: queue
end

subroutine magmaf_strsm( side, uplo, trans, diag, m, n, alpha, dA, ldda, dB, lddb, queue  &
        )
    character        :: side
    character        :: uplo
    character        :: trans
    character        :: diag
    integer          :: m
    integer          :: n
    real             :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    magma_devptr_t   :: queue
end

integer function magmaf_spotf2_lpout( uplo, n, dA, lda, gbstep, dinfo, queue )
    character        :: uplo
    integer          :: n
    real             :: dA(*)
    integer          :: lda
    integer          :: gbstep
    integer          :: dinfo(*)
    magma_devptr_t   :: queue
end

integer function magmaf_spotf2_lpin( uplo, n, dA, lda, gbstep, dinfo, queue )
    character        :: uplo
    integer          :: n
    real             :: dA(*)
    integer          :: lda
    integer          :: gbstep
    integer          :: dinfo(*)
    magma_devptr_t   :: queue
end

end interface

end module magmablas_sfortran
