diff --git a/build/configure.sh b/build/configure.sh index 5f2a7b6e6bf82a3889d01d92ce9c0d973a213727..860fc5b218d7a724089f75fb20ba31823b9a2e26 100755 --- a/build/configure.sh +++ b/build/configure.sh @@ -785,7 +785,8 @@ if [ "x$OFFLOAD" != "xno" ]; then echo -n "configure: checking whether system supports offload... " cat > conf_test_offload.cpp < -#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