Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(c_ptr), | intent(in) | :: | A | |||
real(kind=prec), | intent(in), | pointer | :: | f(:,:,:,:,:) | ||
real(kind=prec), | intent(inout), | pointer | :: | 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(inout) | :: | handle |
subroutine self_blas_matrixop_dim3_3d(A,f,Af,beta,controldegree,targetdegree,nvars,nelems,handle)
type(c_ptr),intent(in) :: A
real(prec),pointer,intent(in) :: f(:,:,:,:,:)
real(prec),pointer,intent(inout) :: Af(:,:,:,:,:)
real(c_prec),intent(in) :: beta
integer,intent(in) :: controldegree,targetdegree,nvars,nelems
type(c_ptr),intent(inout) :: 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
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
do j = 0,targetdegree
do i = 0,targetdegree
call hipblasCheck(hipblasgemvStridedBatched(handle, &
HIPBLAS_OP_T, &
m,n,alpha, &
A,lda,strideA, &
c_loc(f(1+i,1+j,1,1,1)),incx,stridex,beta, &
c_loc(Af(1+i,1+j,1,1,1)),incy,stridey,batchCount))
enddo
enddo
endsubroutine self_blas_matrixop_dim3_3d