Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28496 Discussions

Copy A to B on device with !$OMP TARGET

cu238
Beginner
288 Views

Considering

real A(10000), B(10000)

 

If A and B are on host (CPU), copying A to B is easy:

B=A

 

What if A and B are on device (GPU) ? Code below is not neat enough:

!$OMP TARGET DEFAULTMAP(present: aggregate)

!$OMP TEAMS DISTRIBUTE PARALLEL DO

do i=1,10000

   B(i)=A(i)

enddo

!$OMP END TARGET

 

Is there any neat expression?

 

Thanks.

 

Labels (1)
0 Kudos
1 Solution
Lorri_M_Intel
Employee
223 Views

OpenMP doesn't recognize Fortran array expressions as loopnests, to allow them under OMP DO directives.

What you have here is about the "neatest" idiom you can use.  

View solution in original post

2 Replies
Lorri_M_Intel
Employee
224 Views

OpenMP doesn't recognize Fortran array expressions as loopnests, to allow them under OMP DO directives.

What you have here is about the "neatest" idiom you can use.  

jimdempseyatthecove
Honored Contributor III
165 Views

>>OpenMP doesn't recognize Fortran array expressions as loopnests,

 

This should be fixable. IOW the language features supported on the host should be available on the target.

 

Jim Dempsey

0 Kudos
Reply