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

module magmablas_cfortran

use magma_param

implicit none

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

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

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

subroutine magmablasf_ctranspose( 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_ctranspose_conj( 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_cgetmatrix_transpose( m, n, nb, dAT, ldda, hA, lda, dwork, lddw,  &
        queues )
    integer          :: m
    integer          :: n
    integer          :: nb
    magma_devptr_t   :: dAT
    integer          :: ldda
    complex          :: hA(*)
    integer          :: lda
    magma_devptr_t   :: dwork
    integer          :: lddw
    magma_devptr_t   :: queues(*)
end

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

subroutine magmablasf_cprbt( 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_cprbt_mv( n, nrhs, dv, db, lddb, queue )
    integer          :: n
    integer          :: nrhs
    magma_devptr_t   :: dv
    magma_devptr_t   :: db
    integer          :: lddb
    magma_devptr_t   :: queue
end

subroutine magmablasf_cprbt_mtv( n, nrhs, du, db, lddb, queue )
    integer          :: n
    integer          :: nrhs
    magma_devptr_t   :: du
    magma_devptr_t   :: db
    integer          :: lddb
    magma_devptr_t   :: queue
end

subroutine magmaf_chetrs_gpu( uplo, n, nrhs, dA, ldda, ipiv, dB, lddb, info, queue )
    character        :: uplo
    integer          :: n
    integer          :: nrhs
    complex          :: dA(*)
    integer          :: ldda
    integer          :: ipiv(*)
    complex          :: dB(*)
    integer          :: lddb
    integer          :: info
    magma_devptr_t   :: queue
end

integer function magmablasf_cdiinertia( n, dA, ldda, dneig, queue )
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    integer          :: dneig(*)
    magma_devptr_t   :: queue
end

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

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

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

integer function magmablasf_cheinertia( uplo, n, dA, ldda, ipiv, dneig, queue )
    character        :: uplo
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    integer          :: ipiv(*)
    integer          :: dneig(*)
    magma_devptr_t   :: queue
end

subroutine magmablasf_clacpy( 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_clacpy_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_clacpy_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_clacpy_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_clange( 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_clanhe( 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_clascl( 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_clascl_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_clascl2( 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_clascl_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_claset( uplo, m, n, offdiag, diag, dA, ldda, queue )
    character        :: uplo
    integer          :: m
    integer          :: n
    complex          :: offdiag
    complex          :: diag
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: queue
end

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

subroutine magmablasf_claswp( 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_claswp2( 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_claswp_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_claswpx( 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 magmaf_claswp_rowparallel_native( n, input, ldi, output, ldo, k1, k2, pivinfo,  &
        queue )
    integer          :: n
    complex          :: input(*)
    integer          :: ldi
    complex          :: output(*)
    integer          :: ldo
    integer          :: k1
    integer          :: k2
    integer          :: pivinfo(*)
    magma_devptr_t   :: queue
end

subroutine magmaf_claswp_columnserial( n, dA, lda, k1, k2, dipiv, queue )
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: lda
    integer          :: k1
    integer          :: k2
    integer          :: dipiv(*)
    magma_devptr_t   :: queue
end

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

subroutine magmablasf_csymmetrize_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_ctrtri_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_clarfb_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_clarfb_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_clarfbx_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_clarfgtx_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_clarfgx_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_clarfx_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_caxpycp( 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_cswap( 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_cswapblk( 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_cswapdblk( 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_scnrm2_adjust( k, dxnorm, dc, queue )
    integer          :: k
    magma_devptr_t   :: dxnorm
    magma_devptr_t   :: dc
    magma_devptr_t   :: queue
end

subroutine magmablasf_scnrm2_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_scnrm2_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_scnrm2_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_ctrsv( 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_ctrsv_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_cgemv( trans, m, n, alpha, dA, ldda, dx, incx, beta, dy, incy,  &
        queue )
    character        :: trans
    integer          :: m
    integer          :: n
    complex          :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dx
    integer          :: incx
    complex          :: beta
    magma_devptr_t   :: dy
    integer          :: incy
    magma_devptr_t   :: queue
end

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

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

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

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

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

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

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

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

subroutine magmablasf_ctrsm_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
    complex          :: 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_ctrsm_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
    complex          :: 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_csetvector( n, hx_src, incx, dy_dst, incy, queue )
    integer          :: n
    complex          :: hx_src(*)
    integer          :: incx
    magma_devptr_t   :: dy_dst
    integer          :: incy
    magma_devptr_t   :: queue
end

subroutine magmaf_cgetvector( n, dx_src, incx, hy_dst, incy, queue )
    integer          :: n
    magma_devptr_t   :: dx_src
    integer          :: incx
    complex          :: hy_dst(*)
    integer          :: incy
    magma_devptr_t   :: queue
end

subroutine magmaf_ccopyvector( 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_csetvector_async( n, hx_src, incx, dy_dst, incy, queue )
    integer          :: n
    complex          :: hx_src(*)
    integer          :: incx
    magma_devptr_t   :: dy_dst
    integer          :: incy
    magma_devptr_t   :: queue
end

subroutine magmaf_cgetvector_async( n, dx_src, incx, hy_dst, incy, queue )
    integer          :: n
    magma_devptr_t   :: dx_src
    integer          :: incx
    complex          :: hy_dst(*)
    integer          :: incy
    magma_devptr_t   :: queue
end

subroutine magmaf_ccopyvector_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_csetmatrix( m, n, hA_src, lda, dB_dst, lddb, queue )
    integer          :: m
    integer          :: n
    complex          :: hA_src(*)
    integer          :: lda
    magma_devptr_t   :: dB_dst
    integer          :: lddb
    magma_devptr_t   :: queue
end

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

subroutine magmaf_ccopymatrix( 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_csetmatrix_async( m, n, hA_src, lda, dB_dst, lddb, queue )
    integer          :: m
    integer          :: n
    complex          :: hA_src(*)
    integer          :: lda
    magma_devptr_t   :: dB_dst
    integer          :: lddb
    magma_devptr_t   :: queue
end

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

subroutine magmaf_ccopymatrix_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_icamax( n, dx, incx, queue )
    integer          :: n
    magma_devptr_t   :: dx
    integer          :: incx
    magma_devptr_t   :: queue
end

subroutine magmaf_icamax_native( length, x, incx, ipiv, info, step, gbstep, queue )
    integer          :: length
    magma_devptr_t   :: x
    integer          :: incx
    integer          :: ipiv(*)
    integer          :: info
    integer          :: step
    integer          :: gbstep
    magma_devptr_t   :: queue
end

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

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

subroutine magmaf_caxpy( n, alpha, dx, incx, dy, incy, queue )
    integer          :: n
    complex          :: alpha
    magma_devptr_t   :: dx
    integer          :: incx
    magma_devptr_t   :: dy
    integer          :: incy
    magma_devptr_t   :: queue
end

subroutine magmaf_ccopy( 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_scnrm2( n, dx, incx, queue )
    integer          :: n
    magma_devptr_t   :: dx
    integer          :: incx
    magma_devptr_t   :: queue
end

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

subroutine magmaf_csrot( 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_crotg( 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_cscal( n, alpha, dx, incx, queue )
    integer          :: n
    complex          :: alpha
    magma_devptr_t   :: dx
    integer          :: incx
    magma_devptr_t   :: queue
end

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

subroutine magmaf_cscal_cgeru_native( m, n, dA, lda, info, step, gbstep, queue )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: lda
    integer          :: info
    integer          :: step
    integer          :: gbstep
    magma_devptr_t   :: queue
end

subroutine magmaf_cswap( 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_cswap_native( n, x, incx, step, ipiv, queue )
    integer          :: n
    magma_devptr_t   :: x
    integer          :: incx
    integer          :: step
    integer          :: ipiv(*)
    magma_devptr_t   :: queue
end

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

subroutine magmaf_cgerc( m, n, alpha, dx, incx, dy, incy, dA, ldda, queue )
    integer          :: m
    integer          :: n
    complex          :: 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_cgeru( m, n, alpha, dx, incx, dy, incy, dA, ldda, queue )
    integer          :: m
    integer          :: n
    complex          :: 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_chemv( uplo, n, alpha, dA, ldda, dx, incx, beta, dy, incy, queue )
    character        :: uplo
    integer          :: n
    complex          :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dx
    integer          :: incx
    complex          :: beta
    magma_devptr_t   :: dy
    integer          :: incy
    magma_devptr_t   :: queue
end

subroutine magmaf_cher( 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_cher2( uplo, n, alpha, dx, incx, dy, incy, dA, ldda, queue )
    character        :: uplo
    integer          :: n
    complex          :: 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_csymv( uplo, n, alpha, dA, ldda, dx, incx, beta, dy, incy, queue )
    character        :: uplo
    integer          :: n
    complex          :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dx
    integer          :: incx
    complex          :: beta
    magma_devptr_t   :: dy
    integer          :: incy
    magma_devptr_t   :: queue
end

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

subroutine magmaf_csyr2( uplo, n, alpha, dx, incx, dy, incy, dA, ldda, queue )
    character        :: uplo
    integer          :: n
    complex          :: 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_ctrmv( 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 magmablasf_ctrmv( uplo, trans, diag, n, dA, ldda, dx, incx, queue )
    character        :: uplo
    character        :: trans
    character        :: diag
    integer          :: n
    complex          :: dA(*)
    integer          :: ldda
    complex          :: dx(*)
    integer          :: incx
    magma_devptr_t   :: queue
end

subroutine magmaf_ctrsv( 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_cgemm( transA, transB, m, n, k, alpha, dA, ldda, dB, lddb, beta, dC,  &
        lddc, queue )
    character        :: transA
    character        :: transB
    integer          :: m
    integer          :: n
    integer          :: k
    complex          :: alpha
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    complex          :: beta
    magma_devptr_t   :: dC
    integer          :: lddc
    magma_devptr_t   :: queue
end

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

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

subroutine magmaf_cher2k( uplo, trans, n, k, alpha, dA, ldda, dB, lddb, beta, dC, lddc,  &
        queue )
    character        :: uplo
    character        :: trans
    integer          :: n
    integer          :: k
    complex          :: 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_cher2k( uplo, trans, n, k, alpha, dA, ldda, dB, lddb, beta, dC,  &
        lddc, queue )
    character        :: uplo
    character        :: trans
    integer          :: n
    integer          :: k
    complex          :: 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_cherk( 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 magmablasf_cherk( 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 magmablasf_cherk_small_reduce( uplo, trans, n, k, alpha, dA, ldda, beta, dC,  &
        lddc, nthread_blocks, queue )
    character        :: uplo
    character        :: trans
    integer          :: n
    integer          :: k
    real             :: alpha
    complex          :: dA(*)
    integer          :: ldda
    real             :: beta
    complex          :: dC(*)
    integer          :: lddc
    integer          :: nthread_blocks
    magma_devptr_t   :: queue
end

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

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

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

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

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

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

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

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

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

subroutine magmaf_cgetf2trsm_2d_native( m, n, dA, ldda, dB, lddb, queue )
    integer          :: m
    integer          :: n
    magma_devptr_t   :: dA
    integer          :: ldda
    magma_devptr_t   :: dB
    integer          :: lddb
    magma_devptr_t   :: queue
end

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

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

end interface

end module magmablas_cfortran
