If I have a global array A, which contains all my data. I may use different parts of A in an offload sections. How do I just copy content of parts (more than one) I am interested in to mic but not copy all the content of global array. I have an example and how can I make it work? Thanks,
PROGRAM MAIN IMPLICIT NONE integer N PARAMETER (N=10) DOUBLE PRECISION, allocatable:: a(:) integer i allocate(a(N)) do i = 1, N a(i) = i*0.1 end do call mytest1(a,N) STOP END SUBROUTINE mytest1(a,n) IMPLICIT NONE INTEGER n DOUBLE PRECISION a(*) !dir$ offload_transfer target(mic) & in(a(2:3): alloc_if(.TRUE.) free_if(.FALSE.)) !dir$ offload_transfer target(mic) & in(a(5:7): alloc_if(.TRUE.) free_if(.FALSE.)) !dir$ offload begin target(mic) nocopy(a(1:n)) write(*,*) a(2:3) write(*,*) a(5:7) !dir$ end offload RETURN END
I can compile it, but when I run it, it gives: offload error: address range partially overlaps with existing allocation.
Is there any way to copy more than one parts of a huge array to offload and do the calculation in offload ?
Thanks