Skip to content

Commit cd30636

Browse files
committed
add support for op with ellpack
1 parent a4d9306 commit cd30636

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/stdlib_sparse_spmv.fypp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,23 @@ contains
358358
endif
359359
associate( data => matrix%data, index => matrix%index, MNZ_P_ROW => matrix%K, &
360360
& nnz => matrix%nnz, nrows => matrix%nrows, ncols => matrix%ncols, storage => matrix%storage )
361-
if( storage == sparse_full) then
361+
if( storage == sparse_full .and. op_==sparse_op_none ) then
362362
do concurrent (i = 1:nrows, k = 1:MNZ_P_ROW)
363363
j = index(i,k)
364364
if(j>0) vec_y(${rksfx2(rank-1)}$i) = vec_y(${rksfx2(rank-1)}$i) + alpha_*data(i,k) * vec_x(${rksfx2(rank-1)}$j)
365365
end do
366-
366+
else if( storage == sparse_full .and. op_==sparse_op_transpose ) then
367+
do concurrent (i = 1:nrows, k = 1:MNZ_P_ROW)
368+
j = index(i,k)
369+
if(j>0) vec_y(${rksfx2(rank-1)}$j) = vec_y(${rksfx2(rank-1)}$j) + alpha_*data(i,k) * vec_x(${rksfx2(rank-1)}$i)
370+
end do
371+
#:if t1.startswith('complex')
372+
else if( storage == sparse_full .and. op_==sparse_op_hermitian ) then
373+
do concurrent (i = 1:nrows, k = 1:MNZ_P_ROW)
374+
j = index(i,k)
375+
if(j>0) vec_y(${rksfx2(rank-1)}$j) = vec_y(${rksfx2(rank-1)}$j) + alpha_*conjg(data(i,k)) * vec_x(${rksfx2(rank-1)}$i)
376+
end do
377+
#:endif
367378
end if
368379
end associate
369380
end subroutine

0 commit comments

Comments
 (0)