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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Giacomo Mulas
NP_TMcode
Commits
4fbdcb10
Commit
4fbdcb10
authored
1 month ago
by
Giovanni La Mura
Browse files
Options
Downloads
Patches
Plain Diff
Use generic OFFLOAD compiler flags in place of NVIDIA specific ones
parent
636778a2
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
build/configure.sh
+7
-4
7 additions, 4 deletions
build/configure.sh
with
7 additions
and
4 deletions
build/configure.sh
+
7
−
4
View file @
4fbdcb10
...
...
@@ -785,7 +785,8 @@ if [ "x$OFFLOAD" != "xno" ]; then
echo
-n
"configure: checking whether system supports offload... "
cat
>
conf_test_offload.cpp
<<
EOF
#include <omp.h>
#pragma omp requires unified_shared_memory
#define SIZE 1000000
#pragma omp begin declare target device_type(any)
void fill_with_ones(int *array) {
...
...
@@ -797,14 +798,16 @@ void fill_with_ones(int *array) {
}
}
#pragma omp end declare target
int main(int argc, char** argv) {
int *numbers = new int[1000000]();
int *numbers = new int[SIZE]();
#pragma omp target map(tofrom:numbers[0:SIZE])
fill_with_ones(numbers);
delete[] numbers;
return 0;
}
EOF
$CXX
-fcf-protection
=
check
-foffload
=
nvptx-none
=
"-O3 -ggdb -fcf-protection=
check
-fopt-info -lm -latomic -
m
gomp"
-fopenmp
conf_test_offload.cpp
-o
conf_test_offload
>
/dev/null 2>&1
$CXX
-fcf-protection
=
none
-fno-stack-protector
-foffload
=
nvptx-none
=
"-O3 -ggdb -fcf-protection=
none -fno-stack-protector
-fopt-info -lm -latomic -
l
gomp"
-fopenmp
conf_test_offload.cpp
-o
conf_test_offload
>
/dev/null 2>&1
result
=
$?
rm
conf_test_offload.cpp
if
[
"x
$result
"
=
"x0"
]
;
then
...
...
@@ -814,7 +817,7 @@ EOF
fi
if
[
"x
$result
"
=
"x0"
]
;
then
echo
"yes"
OFFLOADFLAGS
=
" -DUSE_TARGET_OFFLOAD -fcf-protection=
check
-foffload=nvptx-none=
\"
-O
${
CXX_OPT
}${
CXX_DBG
}
-fcf-protection=
check
-fopt-info -lm -latomic -lgomp
\"
"
OFFLOADFLAGS
=
" -DUSE_TARGET_OFFLOAD -fcf-protection=
none -fno-stack-protector
-foffload=nvptx-none=
\"
-O
${
CXX_OPT
}${
CXX_DBG
}
-fcf-protection=
none -fno-stack-protector
-fopt-info -lm -latomic -lgomp
\"
"
if
[
"x
${
OMPFLAGS
}
"
=
"x"
]
;
then
OFFLOADFLAGS
=
"
${
OFFLOADFLAGS
}
-fopenmp"
fi
...
...
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