Disable VTKM_ASSUME when inside CUDA code compiled with VisualStudio.

We have found a bug inside NVCC/VS where it will generate bad PTX code when
it encounters __assume.
This commit is contained in:
Robert Maynard 2016-06-09 13:29:14 -04:00
parent 30fdc7f984
commit a2f5278f12

@ -44,7 +44,17 @@
} while (false) /* do-while prevents extra semicolon warnings */
// VTKM_ASSUME_IMPL is compiler-specific:
#if defined(VTKM_MSVC) || defined(VTKM_ICC)
#if defined(VTKM_MSVC)
//Currently NVCC/VS can generate invalid PTX code when it encounters __assume.
//So while this issue is being resolved we will disable VTKM_ASSUME when inside
//CUDA code being built by Visual Studio
# if defined(__CUDA_ARCH__)
# define VTKM_ASSUME_IMPL(cond) do {} while (false) /* no-op */
# else
# define VTKM_ASSUME_IMPL(cond) __assume(cond)
# endif
#elif defined(VTKM_ICC)
# define VTKM_ASSUME_IMPL(cond) __assume(cond)
#elif defined(VTKM_GCC) && ( __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) )
// Added in 4.5.0: