Skip to content

Commit

Permalink
Fixes for Intel 2024 toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
pwdraper authored and MatthieuSchaller committed Aug 15, 2024
1 parent 2ccfa37 commit 534fb6e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
15 changes: 10 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ if test "$enable_ipo" = "yes"; then
CFLAGS="$CFLAGS -ipo"
LDFLAGS="$LDFLAGS -ipo"
AC_CHECK_PROGS([AR], [xiar])
AC_CHECK_PROGS([LD], [xild])
AC_CHECK_PROGS([RANLIB], [llvm-ranlib])
AC_MSG_RESULT([added oneapi interprocedural optimization support])
elif test "$ax_cv_c_compiler_vendor" = "gnu"; then
Expand Down Expand Up @@ -1588,10 +1587,16 @@ else
have_chealpix="no"
fi

# Check for floating-point execeptions
AC_CHECK_FUNC(feenableexcept, AC_DEFINE([HAVE_FE_ENABLE_EXCEPT],[1],
[Defined if the floating-point exception can be enabled using non-standard GNU functions.]))

# Check for floating-point exception support.
# CLANG based compilers can generate SIMD divides with partially loaded
# registers so we see a 0/0 NaN which results in an FPE which is not an
# error. So we do not allow this with those compilers. If you want to do
# that then beware and use the -ffp-exception-behavior=maytrap flag.
if test "$ax_cv_c_compiler_vendor" != "oneapi" -a \
"$ax_cv_c_compiler_vendor" != "clang"; then
AC_CHECK_FUNC(feenableexcept, AC_DEFINE([HAVE_FE_ENABLE_EXCEPT],[1],
[Defined if the floating-point exception can be enabled using non-standard GNU functions.]))
fi
# Check for setaffinity.
AC_CHECK_FUNC(pthread_setaffinity_np, AC_DEFINE([HAVE_SETAFFINITY],[1],
[Defined if pthread_setaffinity_np exists.]) )
Expand Down
5 changes: 5 additions & 0 deletions tests/testActivePair.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
error("couldn't allocate particles, no. of particles: %d", (int)count);
}
bzero(cell->hydro.parts, count * sizeof(struct part));
if (posix_memalign((void **)&cell->hydro.xparts, part_align,
count * sizeof(struct xpart)) != 0) {
error("couldn't allocate x particles, no. of particles: %d", (int)count);
}
bzero(cell->hydro.xparts, count * sizeof(struct xpart));

/* Construct the parts */
struct part *part = cell->hydro.parts;
Expand Down
2 changes: 1 addition & 1 deletion tests/testCbrt.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ int main(int argc, char *argv[]) {
if (posix_memalign((void **)&data, 64, num_vals * sizeof(float)) != 0)
error("Failed to allocted memory for the test");
for (int k = 0; k < num_vals; k++) {
data[k] = (float)rand() / RAND_MAX;
data[k] = (float)rand() / (float)RAND_MAX;
data[k] = (1.0f - data[k]) * range_min + data[k] * range_max;
if (data[k] == 0.f) k--; /* Skip 0 to avoid spurious mistakes */
}
Expand Down

0 comments on commit 534fb6e

Please sign in to comment.