Commit f9f205e9 authored by Robert Maynard's avatar Robert Maynard
Browse files

ListCrossProduct now uses a special version for MSVC2013

The lazy version that was implemented to get the Intel compiler to work doesn't
work under MSVC2013. Since MSVC2013 is our least c++11 conforming compiler we
add a special MSVS2013 code path, since it will be the first compiler we drop.
parent c02349a8
...@@ -213,9 +213,33 @@ VTKM_CONT void ListForEachImpl(Functor&& f, ...@@ -213,9 +213,33 @@ VTKM_CONT void ListForEachImpl(Functor&& f,
template <typename R1, typename R2> template <typename R1, typename R2>
struct ListCrossProductImpl struct ListCrossProductImpl
{ {
//This is a lazy Cartesian product generator #if defined(VTKM_MSVC) && _MSC_VER == 1800
//that was found inside the brigand apply test and runs on all compilers. // This is a Cartesian product generator that is used
//The original version didn't work with Intel // when building with visual studio 2013. Visual Studio
// 2013 is unable to handle the lazy version as it can't
// deduce the correct template parameters
using type = brigand::reverse_fold<
brigand::list<R1, R2>,
brigand::list<brigand::list<>>,
brigand::bind<
brigand::join,
brigand::bind<
brigand::transform,
brigand::_2,
brigand::defer<brigand::bind<
brigand::join,
brigand::bind<
brigand::transform,
brigand::parent<brigand::_1>,
brigand::defer<brigand::bind<
brigand::list,
brigand::bind<brigand::push_front, brigand::_1, brigand::parent<brigand::_1>>>>>>>>>>;
#else
// This is a lazy Cartesian product generator that is used
// when using any compiler other than visual studio 2013.
// This version was settled on as being the best default
// version as all compilers including Intel handle this
// implementation without issue for very large cross products
using type = brigand::reverse_fold< using type = brigand::reverse_fold<
brigand::list<R1, R2>, brigand::list<R1, R2>,
brigand::list<brigand::list<>>, brigand::list<brigand::list<>>,
...@@ -226,6 +250,7 @@ struct ListCrossProductImpl ...@@ -226,6 +250,7 @@ struct ListCrossProductImpl
brigand::defer<brigand::bind< brigand::defer<brigand::bind<
brigand::list, brigand::list,
brigand::lazy::push_front<brigand::_1, brigand::parent<brigand::_1>>>>>>>>>>; brigand::lazy::push_front<brigand::_1, brigand::parent<brigand::_1>>>>>>>>>>;
#endif
}; };
......
Supports Markdown
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