- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm trying this simple fortran offload example and I don't understand why it gives me this error :
main_offload1.f90(26): warning #8535: A procedure called in an OFFLOAD region must have the OFFLOAD:TARGET attribute. [SQUAROOT]
call squaroot(a,b,c,N)
-------------^
main_offload1.f90(26): warning #8535: *MIC* A procedure called in an OFFLOAD region must have the OFFLOAD:TARGET attribute. [SQUAROOT]
call squaroot(a,b,c,N)
-------------^
Here is the code:
!dir$ attributes offload:mic :: squaroot
SUBROUTINE squaroot(a,b,c,N)
REAL, DIMENSION(N,N) :: a, b, c
INTEGER :: N
DO j = 1, N
DO i = 1, N
a(i,j) = SQRT( b(i,j) * c(i,j) )
write (*,*) a(i,j)
END DO
END DO
END
PROGRAM MAIN
!dir$ attributes offload:mic :: a, b, c
REAL, DIMENSION(:,:), ALLOCATABLE :: a, b, c
INTEGER :: N
N = 10
ALLOCATE (a(N,N), b(N,N), c(N,N))
DO j = 1, N
DO i = 1, N
c(i,j) = (i+j*N)
b(i,j) = c(i,j)
END DO
END DO
!dir$ offload target(mic) in(a,b:length(N*N)) inout(c:length(N*N))
call squaroot(a,b,c,N)
DEALLOCATE (a,b,c)
END
Thanks you.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You must to declare the routine used within the offload region both at the point of definition and within the scope used. So, in the main program scope, add squaroot to attributes directive you already have.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Kevin.
That works.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page