I have a code that uses derived types that includes allocatables inside a region that I want to offload. In order to get the derives type onto the device I try to manually transfer the content of the allocatables and then re-assemble the derived type on the phi. However, I have run into the problem that some kind of implicit copying must be going on ...
The issue is illustrated in the small example below. In the offload region transfer of MyType is not allowed, so I state that only TransferInt,TransferFloats should be copied to the device. However, when you get to the very last line of the program it appears that MyType has been included implicitly as in INOUT variable. An access violation is now produced runtime, since MyType could not be properly copied back from the device.
Is there any way I can turn of implicit copying in order to get around this problem?
I use the latest version of parallel studio XE.
integer :: Int
real*8,allocatable :: Floats(:)
end type TTestType
!dir$ attributes offload : mic :: TTestType
type(TTestType) :: MyType
!dir$ attributes offload : mic :: MyType
end module mTestType
integer :: TransferInt
real*8,allocatable :: TransferFloats(:)
!dir$ attributes offload : mic :: TransferInt
!DIR$ OFFLOAD BEGIN TARGET(mic:0) IN(TransferInt,TransferFloats)
print *,'On phi ...'
!DIR$ END OFFLOAD
print *,'On host ...'
end program Console1