Browse Source

c_check: test for omp_pause_resource_all()

Assume that the ctest3.c program successfully compiling and linking
means that the function is available.
pull/4080/head
Ivan K 11 months ago
parent
commit
c5f0dcf72b
3 changed files with 22 additions and 0 deletions
  1. +10
    -0
      c_check
  2. +10
    -0
      c_check.pl
  3. +2
    -0
      ctest3.c

+ 10
- 0
c_check View File

@@ -412,6 +412,14 @@ fi

[ "$USE_OPENMP" != 1 ] && openmp=''

have_omp_pause_resource_all=0
if [ "$USE_OPENMP" = 1 ]; then
if $compiler_name $flags $openmp -o ctest3 ctest3.c; then
have_omp_pause_resource_all=1
fi
rm -f ctest3.o ctest3 ctest3.exe
fi

linker_L=""
linker_l=""
linker_a=""
@@ -501,6 +509,7 @@ done
[ "$oldgcc" -eq 1 ] && printf "OLDGCC=1\n"
[ "$no_lsx" -eq 1 ] && printf "NO_LSX=1\n"
[ "$no_lasx" -eq 1 ] && printf "NO_LASX=1\n"
[ "$have_omp_pause_resource_all" -eq 1 ] && printf "HAVE_OMP_PAUSE_RESOURCE_ALL=1\n"
} >> "$makefile"

os=`echo "$os" | tr '[[:lower:]]' '[[:upper:]]'/ `
@@ -518,6 +527,7 @@ compiler=`echo "$compiler" | tr '[[:lower:]]' '[[:upper:]]' `
[ "$c11_atomics" -eq 1 ] && printf "#define HAVE_C11\t1\n"
[ "$no_lsx" -eq 1 ] && printf "#define NO_LSX\t1\n"
[ "$no_lasx" -eq 1 ] && printf "#define NO_LASX\t1\n"
[ "$have_omp_pause_resource_all" -eq 1 ] && printf "#define HAVE_OMP_PAUSE_RESOURCE_ALL\t1\n"
} >> "$config"




+ 10
- 0
c_check.pl View File

@@ -394,6 +394,14 @@ $cross = 0 if (($os eq "Android") && ($hostos eq "Linux") && ($ENV{TERMUX_APP_PI

$openmp = "" if $ENV{USE_OPENMP} != 1;

$have_omp_pause_resource_all=0;
if ($ENV{USE_OPENMP} == 1) {
if (system("$compiler_name $flags $openmp -o ctest3 ctest3.c") == 0) {
$have_omp_pause_resource_all=1;
}
unlink "ctest3.o", "ctest3", "ctest3.exe";
}

$linker_L = "";
$linker_l = "";
$linker_a = "";
@@ -472,6 +480,7 @@ print MAKEFILE "NO_AVX2=1\n" if $no_avx2 eq 1;
print MAKEFILE "OLDGCC=1\n" if $oldgcc eq 1;
print MAKEFILE "NO_LSX=1\n" if $no_lsx eq 1;
print MAKEFILE "NO_LASX=1\n" if $no_lasx eq 1;
print MAKEFILE "HAVE_OMP_PAUSE_RESOURCE_ALL=1\n" if $have_omp_pause_resource_all eq 1;

$os =~ tr/[a-z]/[A-Z]/;
$architecture =~ tr/[a-z]/[A-Z]/;
@@ -487,6 +496,7 @@ print CONFFILE "#define HAVE_MSA\t1\n" if $have_msa eq 1;
print CONFFILE "#define HAVE_C11\t1\n" if $c11_atomics eq 1;
print CONFFILE "#define NO_LSX\t1\n" if $no_lsx eq 1;
print CONFFILE "#define NO_LASX\t1\n" if $no_lasx eq 1;
print CONFFILE "#define HAVE_OMP_PAUSE_RESOURCE_ALL\t1\n" if $have_omp_pause_resource_all eq 1;


if ($os eq "LINUX") {


+ 2
- 0
ctest3.c View File

@@ -0,0 +1,2 @@
#include <omp.h>
int main(void) { return omp_pause_resource_all(omp_pause_hard); }

Loading…
Cancel
Save