Created
February 1, 2024 08:26
-
-
Save ivan-pi/cc5f7b4ef876e8efe54b344fecd50801 to your computer and use it in GitHub Desktop.
axpy.fypp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#:block parallel_for(d=1,name="axpy") | |
#:contains args | |
a, x, y | |
#:contains range | |
n | |
#:contains params | |
real, value :: a | |
real, intent(in) :: x(n) | |
real, intent(inout) :: y(n) | |
integer :: i | |
!$omp declare target (x,y) | |
!$acc declare present(x,y) | |
!$cuf attribute(device) :: x, y | |
#:contains kernel | |
y(i) = a*x(i) + y(i) | |
#:endblock |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment