Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NP_TMcode
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Giacomo Mulas
NP_TMcode
Commits
9899fb9c
Commit
9899fb9c
authored
8 months ago
by
Giovanni La Mura
Browse files
Options
Downloads
Patches
Plain Diff
Define USE_TARGET_OFFLOAD compilation flag
parent
de1357ca
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
build/configure
+16
-6
16 additions, 6 deletions
build/configure
build/configure.ac
+10
-5
10 additions, 5 deletions
build/configure.ac
with
26 additions
and
11 deletions
build/configure
+
16
−
6
View file @
9899fb9c
...
@@ -24914,7 +24914,7 @@ int main(int argc, char** argv) {
...
@@ -24914,7 +24914,7 @@ int main(int argc, char** argv) {
return 0;
return 0;
}
}
EOF
EOF
$CXX -fcf-protection=check -foffload=default -foffload=nvptx-none="-O3 -ggdb -fopt-info -lm -latomic -mgomp" -fopenmp -c np_test_offload.cpp > /dev/null
#
2>&1
$CXX -fcf-protection=check -foffload=default -foffload=nvptx-none="-O3 -ggdb -fopt-info -lm -latomic -mgomp" -fopenmp -c np_test_offload.cpp > /dev/null 2>&1
export CXX_SUPPORTS_OFFLOAD=$?
export CXX_SUPPORTS_OFFLOAD=$?
rm np_test_offload.cpp
rm np_test_offload.cpp
if test "x$CXX_SUPPORTS_OFFLOAD" = "x0"; then
if test "x$CXX_SUPPORTS_OFFLOAD" = "x0"; then
...
@@ -24925,7 +24925,7 @@ EOF
...
@@ -24925,7 +24925,7 @@ EOF
if test "x$CXX_SUPPORTS_OFFLOAD" = "x0"; then
if test "x$CXX_SUPPORTS_OFFLOAD" = "x0"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Enabling offload." >&5
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Enabling offload." >&5
printf "%s\n" "$as_me: Enabling offload." >&6;}
printf "%s\n" "$as_me: Enabling offload." >&6;}
OFFLOADFLAGS="-fcf-protection=check -foffload=default -foffload=nvptx-none=\"-O3 -ggdb -fopt-info -lm -latomic -mgomp\" -fopenmp"
OFFLOADFLAGS="-fcf-protection=check -foffload=default -foffload=nvptx-none=\"-O3 -ggdb -fopt-info -lm -latomic -mgomp\" -fopenmp
-DUSE_TARGET_OFFLOAD
"
else
else
as_fn_error $? "Target offload was requested, but it is not supported!" "$LINENO" 5
as_fn_error $? "Target offload was requested, but it is not supported!" "$LINENO" 5
...
@@ -24961,7 +24961,7 @@ int main(int argc, char** argv) {
...
@@ -24961,7 +24961,7 @@ int main(int argc, char** argv) {
return 0;
return 0;
}
}
EOF
EOF
$CXX -fcf-protection=check -foffload=default -foffload=nvptx-none="-O3 -ggdb -fopt-info -lm -latomic -mgomp" -fopenmp -c np_test_offload.cpp > /dev/null
#
2>&1
$CXX -fcf-protection=check -foffload=default -foffload=nvptx-none="-O3 -ggdb -fopt-info -lm -latomic -mgomp" -fopenmp -c np_test_offload.cpp > /dev/null 2>&1
export CXX_SUPPORTS_OFFLOAD=$?
export CXX_SUPPORTS_OFFLOAD=$?
rm np_test_offload.cpp
rm np_test_offload.cpp
if test "x$CXX_SUPPORTS_OFFLOAD" = "x0"; then
if test "x$CXX_SUPPORTS_OFFLOAD" = "x0"; then
...
@@ -24972,7 +24972,7 @@ EOF
...
@@ -24972,7 +24972,7 @@ EOF
if test "x$CXX_SUPPORTS_OFFLOAD" = "x0"; then
if test "x$CXX_SUPPORTS_OFFLOAD" = "x0"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Enabling offload." >&5
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Enabling offload." >&5
printf "%s\n" "$as_me: Enabling offload." >&6;}
printf "%s\n" "$as_me: Enabling offload." >&6;}
OFFLOADFLAGS="-fcf-protection=check -foffload=default -foffload=nvptx-none=\"-O3 -ggdb -fopt-info -lm -latomic -mgomp\" -fopenmp"
OFFLOADFLAGS="-fcf-protection=check -foffload=default -foffload=nvptx-none=\"-O3 -ggdb -fopt-info -lm -latomic -mgomp\" -fopenmp
-DUSE_TARGET_OFFLOAD
"
else
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Disabling offload." >&5
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Disabling offload." >&5
...
@@ -24991,13 +24991,13 @@ if test ${enable_openmp+y}
...
@@ -24991,13 +24991,13 @@ if test ${enable_openmp+y}
then :
then :
enableval=$enable_openmp;
enableval=$enable_openmp;
if test "x$enableval" != "xno"; then
if test "x$enableval" != "xno"; then
OMPFLAGS="
-DUSE_OPENMP
-fopenmp"
OMPFLAGS="-fopenmp"
fi
fi
else case e in #(
else case e in #(
e)
e)
OMPFLAGS="
-DUSE_OPENMP
-fopenmp"
OMPFLAGS="-fopenmp"
;;
;;
...
@@ -25278,6 +25278,16 @@ esac
...
@@ -25278,6 +25278,16 @@ esac
fi
fi
if test "x$OFFLOADFLAGS" != "x"
then :
OMPFLAGS=""
else case e in #(
e) OMPFLAGS=$OMPFLAGS
;;
esac
fi
CXXFLAGS="$CLANGFLAGS -O3 -ggdb $OFFLOADFLAGS $USER_INCLUDE -I$HDF5_INCLUDE $OMPFLAGS $MPIFLAGS $LAPACKFLAGS $MAGMAFLAGS $NVTXFLAGS"
CXXFLAGS="$CLANGFLAGS -O3 -ggdb $OFFLOADFLAGS $USER_INCLUDE -I$HDF5_INCLUDE $OMPFLAGS $MPIFLAGS $LAPACKFLAGS $MAGMAFLAGS $NVTXFLAGS"
SUBDIRS="cluster libnptm sphere testing trapping"
SUBDIRS="cluster libnptm sphere testing trapping"
...
...
This diff is collapsed.
Click to expand it.
build/configure.ac
+
10
−
5
View file @
9899fb9c
...
@@ -118,7 +118,7 @@ int main(int argc, char** argv) {
...
@@ -118,7 +118,7 @@ int main(int argc, char** argv) {
return 0;
return 0;
}
}
EOF
EOF
$CXX -fcf-protection=check -foffload=default -foffload=nvptx-none="-O3 -ggdb -fopt-info -lm -latomic -mgomp" -fopenmp -c np_test_offload.cpp > /dev/null
#
2>&1
$CXX -fcf-protection=check -foffload=default -foffload=nvptx-none="-O3 -ggdb -fopt-info -lm -latomic -mgomp" -fopenmp -c np_test_offload.cpp > /dev/null 2>&1
export CXX_SUPPORTS_OFFLOAD=$?
export CXX_SUPPORTS_OFFLOAD=$?
rm np_test_offload.cpp
rm np_test_offload.cpp
if test "x$CXX_SUPPORTS_OFFLOAD" = "x0"; then
if test "x$CXX_SUPPORTS_OFFLOAD" = "x0"; then
...
@@ -260,7 +260,7 @@ AC_ARG_ENABLE(
...
@@ -260,7 +260,7 @@ AC_ARG_ENABLE(
M4_TEST_OFFLOAD
M4_TEST_OFFLOAD
if test "x$CXX_SUPPORTS_OFFLOAD" = "x0"; then
if test "x$CXX_SUPPORTS_OFFLOAD" = "x0"; then
AC_MSG_NOTICE([Enabling offload.])
AC_MSG_NOTICE([Enabling offload.])
AC_SUBST([OFFLOADFLAGS], ["-fcf-protection=check -foffload=default -foffload=nvptx-none=\"-O3 -ggdb -fopt-info -lm -latomic -mgomp\" -fopenmp"])
AC_SUBST([OFFLOADFLAGS], ["-fcf-protection=check -foffload=default -foffload=nvptx-none=\"-O3 -ggdb -fopt-info -lm -latomic -mgomp\" -fopenmp
-DUSE_TARGET_OFFLOAD
"])
else
else
AC_MSG_ERROR([Target offload was requested, but it is not supported!])
AC_MSG_ERROR([Target offload was requested, but it is not supported!])
fi
fi
...
@@ -273,7 +273,7 @@ AC_ARG_ENABLE(
...
@@ -273,7 +273,7 @@ AC_ARG_ENABLE(
M4_TEST_OFFLOAD
M4_TEST_OFFLOAD
if test "x$CXX_SUPPORTS_OFFLOAD" = "x0"; then
if test "x$CXX_SUPPORTS_OFFLOAD" = "x0"; then
AC_MSG_NOTICE([Enabling offload.])
AC_MSG_NOTICE([Enabling offload.])
AC_SUBST([OFFLOADFLAGS], ["-fcf-protection=check -foffload=default -foffload=nvptx-none=\"-O3 -ggdb -fopt-info -lm -latomic -mgomp\" -fopenmp"])
AC_SUBST([OFFLOADFLAGS], ["-fcf-protection=check -foffload=default -foffload=nvptx-none=\"-O3 -ggdb -fopt-info -lm -latomic -mgomp\" -fopenmp
-DUSE_TARGET_OFFLOAD
"])
else
else
AC_MSG_NOTICE([Disabling offload.])
AC_MSG_NOTICE([Disabling offload.])
AC_SUBST([OFFLOADFLAGS], [""])
AC_SUBST([OFFLOADFLAGS], [""])
...
@@ -286,11 +286,11 @@ AC_ARG_ENABLE(
...
@@ -286,11 +286,11 @@ AC_ARG_ENABLE(
[AS_HELP_STRING([--enable-openmp], [enable OpneMP multi-threading [default=yes]])],
[AS_HELP_STRING([--enable-openmp], [enable OpneMP multi-threading [default=yes]])],
[
[
if test "x$enableval" != "xno"; then
if test "x$enableval" != "xno"; then
AC_SUBST([OMPFLAGS], ["
-DUSE_OPENMP
-fopenmp"])
AC_SUBST([OMPFLAGS], ["-fopenmp"])
fi
fi
],
],
[
[
AC_SUBST([OMPFLAGS], ["
-DUSE_OPENMP
-fopenmp"])
AC_SUBST([OMPFLAGS], ["-fopenmp"])
]
]
)
)
...
@@ -408,6 +408,11 @@ AC_ARG_WITH(
...
@@ -408,6 +408,11 @@ AC_ARG_WITH(
]
]
)
)
AS_IF(
[test "x$OFFLOADFLAGS" != "x"],
[AC_SUBST([OMPFLAGS], [""])],
[AC_SUBST([OMPFLAGS], [$OMPFLAGS])]
)
CXXFLAGS="$CLANGFLAGS -O3 -ggdb $OFFLOADFLAGS $USER_INCLUDE -I$HDF5_INCLUDE $OMPFLAGS $MPIFLAGS $LAPACKFLAGS $MAGMAFLAGS $NVTXFLAGS"
CXXFLAGS="$CLANGFLAGS -O3 -ggdb $OFFLOADFLAGS $USER_INCLUDE -I$HDF5_INCLUDE $OMPFLAGS $MPIFLAGS $LAPACKFLAGS $MAGMAFLAGS $NVTXFLAGS"
SUBDIRS="cluster libnptm sphere testing trapping"
SUBDIRS="cluster libnptm sphere testing trapping"
...
...
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