- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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.
コピーされたリンク
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
>>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
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
I'm no expert on OpenMP but
!#OMP PARALLEL WORKSHARE
B=A
!$OMP END PARALLEL WORKSHARE
works on my tests and runs faster than
!$OMP PARALLEL DO
DO I=1,N
B(I)=A(I)
END DO
!OMP END PARALLEL DO.
If you have a whole bunch of them with no serial bits between then wrapping the whole lot in a !$OMP PARALLEL/END PARALLEL and then just using !$OMP WORKSHARE/END WORKSHARE or !$OMP DO/END DO gives a nano second or two of speed up, presumably because of the OMP setup overhead.
Please tell me if it is unsafe as I've just spent half a day adding a few hundred of them to implied do array assignments in my code.
Cheers
Kim
