Commit 3dd66e85 authored by Kenneth Moreland's avatar Kenneth Moreland

Do not use __assume for icc in gcc compatability mode

When using the GNU header files on a system, the icc compiler emulates
the behavior of the gcc compiler on the system. (See https://
software.intel.com/en-us/node/522750) This appears to mean that icc
features that are not available in gcc could get turned off. In
particular, we found that the __assume feature stopped working.

To get around this problem, do not use __assume when compiling with icc
and __GNUC__ is defined. Instead, use the available gcc features.
parent eca65146
......@@ -53,9 +53,10 @@
#if defined(VTKM_MSVC)
#define VTKM_ASSUME_IMPL(cond) __assume(cond)
#elif defined(VTKM_ICC)
#elif defined(VTKM_ICC) && !defined(__GNUC__)
#define VTKM_ASSUME_IMPL(cond) __assume(cond)
#elif defined(VTKM_GCC) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
#elif (defined(VTKM_GCC) || defined(VTKM_ICC)) && \
(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
// Added in 4.5.0:
#define VTKM_ASSUME_IMPL(cond) \
if (!(cond)) \
......
......@@ -76,9 +76,10 @@
#if defined(VTKM_MSVC)
#define VTKM_UNREACHABLE_IMPL() __assume(false)
#elif defined(VTKM_ICC)
#elif defined(VTKM_ICC) && !defined(__GNUC__)
#define VTKM_UNREACHABLE_IMPL() __assume(false)
#elif defined(VTKM_GCC) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
#elif (defined(VTKM_GCC) || defined(VTKM_ICC)) && \
(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
// Added in 4.5.0:
#define VTKM_UNREACHABLE_IMPL() __builtin_unreachable()
#elif defined(VTKM_CLANG)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment