Permalink
Browse files

Disable Intel offload builds

  • Loading branch information...
dmalhotra committed Oct 26, 2018
1 parent 5bcab83 commit 6f047a0db07427106a3736f0dda95def9ed6bafd
Showing with 30 additions and 14 deletions.
  1. +4 −1 configure.ac
  2. +0 −12 examples/Makefile
  3. +25 −0 m4/ac_check_intel_offload.m4
  4. +1 −1 m4/ax_check_svml.m4
View
@@ -114,6 +114,7 @@ if $USE_OPENMP; then
;;
intel)
CHECK_OPENMP(-openmp)
CHECK_OPENMP(-qopenmp)
;;
pgi)
CHECK_OPENMP(-mp)
@@ -135,7 +136,9 @@ fi
AC_LANG_WERROR([off])
# Check for Intel Xeon Phi
CHECK_INTEL_OFFLOAD
#CHECK_INTEL_OFFLOAD
DISABLE_INTEL_OFFLOAD(-no-offload)
DISABLE_INTEL_OFFLOAD(-qno-offload)
# Check for FFTW
AC_CHECK_FFTW
View
@@ -38,22 +38,10 @@ $(BINDIR)/%: $(SRCDIR)/%.c
-@$(MKDIRS) $(dir $@)
$(CC) $(CXXFLAGS) -I$(INCDIR) $^ $(LDLIBS) -o $@
ifeq ($(INTEL_OFFLOAD_OK),yes)
$(BINDIR)/%: $(SRCDIR)/%.cpp
-@$(MKDIRS) $(dir $@)
$(CXX) $(CXXFLAGS) -no-offload -I$(INCDIR) $^ $(LDLIBS) -o $@
$(CXX) $(CXXFLAGS) -I$(INCDIR) $^ $(LDLIBS) -o $@_async
$(CXX) $(CXXFLAGS) -D__DEVICE_SYNC__=1 -I$(INCDIR) $^ $(LDLIBS) -o $@_mic
else
$(BINDIR)/%: $(SRCDIR)/%.cpp
-@$(MKDIRS) $(dir $@)
$(CXX) $(CXXFLAGS) -I$(INCDIR) $^ $(LDLIBS) -o $@
endif
clean:
$(RM) -r $(BINDIR)/* $(OBJDIR)/*
$(RM) *~ */*~
@@ -1,4 +1,29 @@
AC_DEFUN([DISABLE_INTEL_OFFLOAD], [
AC_LANG_WERROR([on])
AC_MSG_CHECKING([Intel no-offload (with $1)])
XCFLAGS="$CFLAGS"
XCXXFLAGS="$CXXFLAGS"
CFLAGS="$CFLAGS $1"
CXXFLAGS="$CXXFLAGS $1"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
]], [[
#ifdef __INTEL_OFFLOAD
#pragma offload target(mic:0)
#endif
]])],cv_no_offload=yes, cv_no_offload=no)
AC_MSG_RESULT($cv_no_offload)
if test "$cv_no_offload" = no; then
CFLAGS="$XCFLAGS"
CXXFLAGS="$XCXXFLAGS"
fi
AC_LANG_WERROR([off])
])
AC_DEFUN([CHECK_INTEL_OFFLOAD], [
## Check for support of offload pragma and -no-offload flag. If
## found define HAVE_INTEL_OFFLOAD_PRAGMA, HAVE_INTEL_NOFFLOAD_FLAG and
View
@@ -8,9 +8,9 @@ AC_DEFUN([AX_CHECK_SVML],
cv_have_svml=no
#AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[_mm256_sin_ps(0);]])],[cv_have_svml=yes], [])
AC_TRY_LINK_FUNC(_mm256_sin_ps, [cv_have_svml=yes], [])
AC_MSG_RESULT($cv_have_svml)
if test "$cv_have_svml" = yes; then
AC_MSG_RESULT($cv_have_svml)
AC_DEFINE(HAVE_INTEL_SVML,1,[Define if SVL library is available])
fi
])

0 comments on commit 6f047a0

Please sign in to comment.