Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Budiardja, Reuben
Fortran Frontier
Commits
c051ca21
Commit
c051ca21
authored
Dec 01, 2021
by
Budiardja, Reuben
Browse files
Updated to logical condition to remove workaround.
parent
7903c1b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Cases/Composite/OpenMP_Metadirective/OpenMP_MetadirectiveDynamic_TargetTeamsDistributeParallelDo_Duplicated.f90
View file @
c051ca21
...
...
@@ -29,9 +29,9 @@ program OpenMP_metadirective_user_condition_target_test
print
*
,
''
allocate
(
A
(
32
**
3
*
10
)
)
allocate
(
B
(
32
**
3
*
10
)
)
allocate
(
C
(
32
**
3
*
10
)
)
allocate
(
A
(
128
**
3
*
10
)
)
allocate
(
B
(
128
**
3
*
10
)
)
allocate
(
C
(
128
**
3
*
10
)
)
allocate
(
C_Ref
,
source
=
C
)
call
random_number
(
A
)
...
...
@@ -78,7 +78,7 @@ contains
UseDevice
=
UseDeviceOption
!$OMP begin metadirective &
!$OMP when ( user = { condition ( UseDevice
.EQV. .true.
) } &
!$OMP when ( user = { condition ( UseDevice ) } &
!$OMP : target map ( tofrom : OD ) )
OD
=
.not.
omp_is_initial_device
()
!$OMP end metadirective
...
...
@@ -120,19 +120,19 @@ contains
if
(
UseDevice
)
then
!$OMP metadirective &
!$OMP when ( user = { condition ( UseDevice
.EQV. .true.
) } &
!$OMP when ( user = { condition ( UseDevice ) } &
!$OMP : target teams distribute parallel do )
do
iV
=
1
,
size
(
A
)
C
(
iV
)
=
A
(
iV
)
+
B
(
iV
)
C
(
iV
)
=
A
(
iV
)
*
B
(
iV
)
**
2
+
B
(
iV
)
end
do
else
!$OMP metadirective &
!$OMP when ( user = { condition ( UseDevice
.EQV. .false.
) } &
!$OMP when ( user = { condition (
.not.
UseDevice ) } &
!$OMP : parallel do )
do
iV
=
1
,
size
(
A
)
C
(
iV
)
=
A
(
iV
)
+
B
(
iV
)
C
(
iV
)
=
A
(
iV
)
*
B
(
iV
)
**
2
+
B
(
iV
)
end
do
end
if
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment