- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.
링크가 복사됨
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.