diff --git a/src/cuda/kernels/reorder.f90 b/src/cuda/kernels/reorder.f90 index 87d5e041..2b0a4a03 100644 --- a/src/cuda/kernels/reorder.f90 +++ b/src/cuda/kernels/reorder.f90 @@ -162,4 +162,23 @@ attributes(global) subroutine sum_zintox(u_x, u_z, nz) end subroutine sum_zintox + attributes(global) subroutine axpby(n, alpha, x, beta, y) + implicit none + + integer, value, intent(in) :: n + real(dp), value, intent(in) :: alpha, beta + real(dp), device, intent(in), dimension(:, :, :) :: x + real(dp), device, intent(inout), dimension(:, :, :) :: y + + integer :: i, j, b + + i = threadIdx%x + b = blockIdx%x + + do j = 1, n + y(i, j, b) = alpha*x(i, j, b) + beta*y(i, j, b) + end do + + end subroutine axpby + end module m_cuda_kernels_reorder