Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(c_ptr), | intent(in) | :: | A | |||
type(c_ptr), | intent(in) | :: | f | |||
type(c_ptr), | intent(inout) | :: | Af | |||
real(kind=c_prec), | intent(in) | :: | beta | |||
integer, | intent(in) | :: | controldegree | |||
integer, | intent(in) | :: | targetdegree | |||
integer, | intent(in) | :: | nvars | |||
integer, | intent(in) | :: | nelems | |||
type(c_ptr), | intent(in) | :: | handle |
subroutine self_blas_matrixop_dim3_3d(A,f,Af,beta,controldegree,targetdegree,nvars,nelems,handle)
type(c_ptr),intent(in) :: A
type(c_ptr),intent(in) :: f
type(c_ptr),intent(inout) :: Af
real(c_prec),intent(in) :: beta
integer,intent(in) :: controldegree,targetdegree,nvars,nelems
type(c_ptr),intent(in) :: handle
! Local
integer(c_int) :: m
integer(c_int) :: n
real(c_prec) :: alpha
integer(c_int) :: lda
integer :: i,j
integer(c_int64_t) :: strideA
integer(c_int) :: incx
integer(c_int64_t) :: stridex
integer(c_int) :: incy
integer(c_int64_t) :: stridey
integer(c_int) :: batchCount
real(prec),pointer :: f_p(:,:,:,:,:)
real(prec),pointer :: Af_p(:,:,:,:,:)
m = controldegree+1 ! number of rows of A
n = targetdegree+1 ! number of columns of A
alpha = 1.0_c_prec
lda = m ! leading dimension of A
strideA = 0 ! stride for the batches of A (no stride)
incx = (targetdegree+1)*(targetdegree+1) !
stridex = (controldegree+1)*(targetdegree+1)*(targetdegree+1)
incy = (targetdegree+1)*(targetdegree+1)
stridey = (targetdegree+1)*(targetdegree+1)*(targetdegree+1)
batchCount = nvars*nelems
call c_f_pointer(f,f_p,[targetdegree+1,targetdegree+1,controldegree+1,nelems,nvars])
call c_f_pointer(Af,Af_p,[targetdegree+1,targetdegree+1,targetdegree+1,nelems,nvars])
do j = 0,targetdegree
do i = 0,targetdegree
call hipblasCheck(hipblasgemvStridedBatched(handle, &
HIPBLAS_OP_T, &
m,n,alpha, &
A,lda,strideA, &
c_loc(f_p(1+i,1+j,1,1,1)),incx,stridex,beta, &
c_loc(Af_p(1+i,1+j,1,1,1)),incy,stridey,batchCount))
enddo
enddo
endsubroutine self_blas_matrixop_dim3_3d