Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Méso-NH code
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RODIER Quentin
Méso-NH code
Commits
d528c36c
Commit
d528c36c
authored
3 years ago
by
ESCOBAR MUNOZ Juan
Browse files
Options
Downloads
Patches
Plain Diff
Juan 25/08/2021:mode_openacc_set_device.f90 , correction for setting current device
parent
309c6f36
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/MNH/mode_openacc_set_device.f90
+11
-17
11 additions, 17 deletions
src/MNH/mode_openacc_set_device.f90
src/ZSOLVER/tensorproductmultigrid_Source/mode_openacc_set_device.f90
+1
-0
1 addition, 0 deletions
...tensorproductmultigrid_Source/mode_openacc_set_device.f90
with
12 additions
and
17 deletions
src/MNH/mode_openacc_set_device.f90
+
11
−
17
View file @
d528c36c
...
@@ -13,8 +13,7 @@ MODULE MODE_OPENACC_SET_DEVICE
...
@@ -13,8 +13,7 @@ MODULE MODE_OPENACC_SET_DEVICE
IMPLICIT
NONE
IMPLICIT
NONE
#ifndef _FAKEOPENACC
#ifndef _FAKEOPENACC
INTEGER
(
kind
=
acc_device_kind
),
dimension
(
1000
)
::
mnh_idevice_type_at_init
=
-1000
INTEGER
(
kind
=
acc_device_kind
)
::
mnh_idevice_type_at_init
=
-1000
INTEGER
::
nlevel_mnh_idevice_type
=
1
INTEGER
(
kind
=
acc_device_kind
)
::
mnh_idevice_type_current
=
-1
INTEGER
(
kind
=
acc_device_kind
)
::
mnh_idevice_type_current
=
-1
#endif
#endif
...
@@ -34,10 +33,10 @@ CONTAINS
...
@@ -34,10 +33,10 @@ CONTAINS
SWAP_DEVICE_RETURN
SWAP_DEVICE_RETURN
if
(
mnh_idevice_type_at_init
(
1
)
.EQ.
-1000
)
then
if
(
mnh_idevice_type_at_init
.EQ.
-1000
)
then
mnh_idevice_type_at_init
(
1
)
=
acc_get_device_type
()
mnh_idevice_type_at_init
=
acc_get_device_type
()
mnh_idevice_type_current
=
acc_get_
device_type
()
mnh_idevice_type_current
=
mnh_i
device_type
_at_init
print
*
,
'mnh_idevice_type_at_init='
,
mnh_idevice_type_at_init
(
1
)
print
*
,
'mnh_idevice_type_at_init='
,
mnh_idevice_type_at_init
end
if
end
if
#endif
#endif
...
@@ -72,10 +71,9 @@ CONTAINS
...
@@ -72,10 +71,9 @@ CONTAINS
SWAP_DEVICE_RETURN
SWAP_DEVICE_RETURN
nlevel_mnh_idevice_type
=
nlevel_mnh_idevice_type
+
1
mnh_idevice_type_at_init
(
nlevel_mnh_idevice_type
)
=
acc_get_device_type
()
call
acc_set_device_type
(
acc_device_host
)
call
acc_set_device_type
(
acc_device_host
)
mnh_idevice_type_current
=
acc_get_device_type
()
mnh_idevice_type_current
=
acc_device_host
#endif
#endif
END
SUBROUTINE
MNH_OPENACC_SET_DEVICE_HOST
END
SUBROUTINE
MNH_OPENACC_SET_DEVICE_HOST
...
@@ -91,7 +89,7 @@ CONTAINS
...
@@ -91,7 +89,7 @@ CONTAINS
SWAP_DEVICE_RETURN
SWAP_DEVICE_RETURN
call
acc_set_device_type
(
acc_device_nvidia
)
call
acc_set_device_type
(
acc_device_nvidia
)
mnh_idevice_type_current
=
acc_
get_
device_
type
()
mnh_idevice_type_current
=
acc_device_
nvidia
#endif
#endif
END
SUBROUTINE
MNH_OPENACC_SET_DEVICE_NVIDIA
END
SUBROUTINE
MNH_OPENACC_SET_DEVICE_NVIDIA
...
@@ -100,18 +98,14 @@ CONTAINS
...
@@ -100,18 +98,14 @@ CONTAINS
#ifndef _FAKEOPENACC
#ifndef _FAKEOPENACC
USE
&
USE
&
openacc
,
ONLY
:
acc_set_device_type
,
acc_device_nvidia
openacc
,
ONLY
:
acc_set_device_type
,
acc_device_nvidia
,
acc_get_device_type
IMPLICIT
NONE
IMPLICIT
NONE
SWAP_DEVICE_RETURN
SWAP_DEVICE_RETURN
IF
(
nlevel_mnh_idevice_type
==
1
)
THEN
call
acc_set_device_type
(
mnh_idevice_type_at_init
)
print
*
,
' MNH_OPENACC_SET_DEVICE_DEFAULT :: WARNING ALLREADY AT FIRST LEVEL !!! '
mnh_idevice_type_current
=
mnh_idevice_type_at_init
ELSE
nlevel_mnh_idevice_type
=
nlevel_mnh_idevice_type
-
1
END
IF
call
acc_set_device_type
(
mnh_idevice_type_at_init
(
nlevel_mnh_idevice_type
))
#endif
#endif
END
SUBROUTINE
MNH_OPENACC_SET_DEVICE_DEFAULT
END
SUBROUTINE
MNH_OPENACC_SET_DEVICE_DEFAULT
...
...
This diff is collapsed.
Click to expand it.
src/ZSOLVER/tensorproductmultigrid_Source/mode_openacc_set_device.f90
0 → 120000
+
1
−
0
View file @
d528c36c
..
/
..
/
MNH
/
mode_openacc_set_device
.
f90
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment