Skip to content
Snippets Groups Projects
Commit 4fbdcb10 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

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
......@@ -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 -mgomp" -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 -lgomp" -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment