diff --git a/.gitignore b/.gitignore index 5f5f81c9d06e..8125277579ea 100644 --- a/.gitignore +++ b/.gitignore @@ -97,7 +97,9 @@ MPI_DEBUG/ SERIAL_DEBUG/ SERIAL_RELEASE/ -/build +# People usually build Trilinos in a 'build' directory. Ignore it. +build*/ + packages/tpetra/test/MatrixMatrix/matrices/*.m packages/Sundance/Playa/doc/Doxygen/html/ diff --git a/packages/sacado/CMakeLists.txt b/packages/sacado/CMakeLists.txt index ca0c0985e988..db887f021d56 100644 --- a/packages/sacado/CMakeLists.txt +++ b/packages/sacado/CMakeLists.txt @@ -135,9 +135,6 @@ int main() CHECK_CXX_SOURCE_COMPILES("${SOURCE_C99_TR1_CMATH}" HAS_C99_TR1_CMATH) -# FIXME: Remove this hard-coded setting. We always have C++11 now. -SET(HAVE_SACADO_CXX11 ON) - # # C) Add the libraries, tests, and examples # diff --git a/packages/sacado/cmake/Sacado_config.h.in b/packages/sacado/cmake/Sacado_config.h.in index b7166d459e88..0fb9738c5f91 100644 --- a/packages/sacado/cmake/Sacado_config.h.in +++ b/packages/sacado/cmake/Sacado_config.h.in @@ -54,9 +54,6 @@ /* Define if compiler supports c99 tr1 cmath functions */ #cmakedefine HAS_C99_TR1_CMATH -/* Define to enable C++11 support*/ -#cmakedefine HAVE_SACADO_CXX11 - /* Define to enable hierarchical parallelism support */ #if !defined(SACADO_VIEW_CUDA_HIERARCHICAL) && !defined(SACADO_VIEW_CUDA_HIERARCHICAL_DFAD) #cmakedefine SACADO_VIEW_CUDA_HIERARCHICAL diff --git a/packages/sacado/src/CMakeLists.txt b/packages/sacado/src/CMakeLists.txt index c34ac44fd35d..86971311d58e 100644 --- a/packages/sacado/src/CMakeLists.txt +++ b/packages/sacado/src/CMakeLists.txt @@ -252,8 +252,6 @@ ENDIF() #mpl TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/mpl) SET(HEADERS ${HEADERS} - mpl/Sacado_mpl_is_same.hpp - mpl/Sacado_mpl_is_convertible.hpp mpl/Sacado_mpl_enable_if.hpp mpl/Sacado_mpl_disable_if.hpp mpl/Sacado_mpl_if.hpp @@ -283,7 +281,6 @@ SET(HEADERS ${HEADERS} mpl/Sacado_mpl_type_wrap.hpp mpl/Sacado_mpl_is_placeholder.hpp mpl/Sacado_mpl_integral_nonzero_constant.hpp - mpl/Sacado_mpl_void.hpp mpl/Sacado_mpl_has_equal_to.hpp ) diff --git a/packages/sacado/src/Sacado_CacheFad_Ops.hpp b/packages/sacado/src/Sacado_CacheFad_Ops.hpp index 80622d68a47b..09f373137ede 100644 --- a/packages/sacado/src/Sacado_CacheFad_Ops.hpp +++ b/packages/sacado/src/Sacado_CacheFad_Ops.hpp @@ -485,12 +485,10 @@ FAD_UNARYOP_MACRO(atanh, ATanhOp, a = value_type(1)/(value_type(1)-v*v), std::atanh(v)) -#ifdef HAVE_SACADO_CXX11 FAD_UNARYOP_MACRO(cbrt, CbrtOp, a = value_type(1)/(value_type(3)*std::cbrt(v*v)), std::cbrt(v)) -#endif #undef FAD_UNARYOP_MACRO diff --git a/packages/sacado/src/Sacado_ConfigDefs.h b/packages/sacado/src/Sacado_ConfigDefs.h index 4ec573b74857..d265d2432bd2 100644 --- a/packages/sacado/src/Sacado_ConfigDefs.h +++ b/packages/sacado/src/Sacado_ConfigDefs.h @@ -119,14 +119,12 @@ Questions? Contact David M. Gay (dmgay@sandia.gov) or Eric T. Phipps /* Determine if the new fad design is supported. Requies C++11, and if gcc, version 4.8 or greater. */ -#if defined(HAVE_SACADO_CXX11) -# if defined(__GNUC__) && !defined(__clang__) -# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8) ) -# define SACADO_ENABLE_NEW_DESIGN 1 -# endif -# else +#if defined(__GNUC__) && !defined(__clang__) +# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8) ) # define SACADO_ENABLE_NEW_DESIGN 1 # endif +#else +# define SACADO_ENABLE_NEW_DESIGN 1 #endif #endif /* SACADO_CONFIGDEFS_H */ diff --git a/packages/sacado/src/Sacado_ELRCacheFad_Ops.hpp b/packages/sacado/src/Sacado_ELRCacheFad_Ops.hpp index 5501f9a6b3de..6fd779675da1 100644 --- a/packages/sacado/src/Sacado_ELRCacheFad_Ops.hpp +++ b/packages/sacado/src/Sacado_ELRCacheFad_Ops.hpp @@ -55,7 +55,6 @@ #include "Sacado_ELRCacheFad_Expression.hpp" #include "Sacado_cmath.hpp" #include "Sacado_mpl_disable_if.hpp" -#include "Sacado_mpl_is_same.hpp" #include // for std::ostream namespace Sacado { @@ -649,12 +648,10 @@ FAD_UNARYOP_MACRO(atanh, ATanhOp, a = scalar_type(1.0)/(scalar_type(1.0)-v*v), std::atanh(v)) -#ifdef HAVE_SACADO_CXX11 FAD_UNARYOP_MACRO(cbrt, CbrtOp, a = scalar_type(1.0)/(scalar_type(3.0)*std::cbrt(v*v)), std::cbrt(v)) -#endif #undef FAD_UNARYOP_MACRO diff --git a/packages/sacado/src/Sacado_ELRFad_Ops.hpp b/packages/sacado/src/Sacado_ELRFad_Ops.hpp index 561179733b11..8cebb8d0f077 100644 --- a/packages/sacado/src/Sacado_ELRFad_Ops.hpp +++ b/packages/sacado/src/Sacado_ELRFad_Ops.hpp @@ -329,7 +329,6 @@ FAD_UNARYOP_MACRO(fabs, value_type(-expr.dx(i)), expr.val() >= 0 ? value_type(+expr.fastAccessDx(i)) : value_type(-expr.fastAccessDx(i))) -#ifdef HAVE_SACADO_CXX11 FAD_UNARYOP_MACRO(cbrt, CbrtOp, std::cbrt(expr.val()), @@ -337,7 +336,6 @@ FAD_UNARYOP_MACRO(cbrt, false, expr.dx(i)/(value_type(3)*std::cbrt(expr.val()*expr.val())), expr.fastAccessDx(i)/(value_type(3)*std::cbrt(expr.val()*expr.val()))) -#endif #undef FAD_UNARYOP_MACRO diff --git a/packages/sacado/src/Sacado_Fad_Ops.hpp b/packages/sacado/src/Sacado_Fad_Ops.hpp index e37f1a15a764..26512f56611b 100644 --- a/packages/sacado/src/Sacado_Fad_Ops.hpp +++ b/packages/sacado/src/Sacado_Fad_Ops.hpp @@ -259,14 +259,12 @@ FAD_UNARYOP_MACRO(fabs, fabs(expr.val()), if_then_else( expr.val() >= 0, expr.dx(i), value_type(-expr.dx(i)) ), if_then_else( expr.val() >= 0, expr.fastAccessDx(i), value_type(-expr.fastAccessDx(i)) ) ) -#ifdef HAVE_SACADO_CXX11 FAD_UNARYOP_MACRO(cbrt, CbrtOp, using std::cbrt;, cbrt(expr.val()), expr.dx(i)/(value_type(3)*cbrt(expr.val()*expr.val())), expr.fastAccessDx(i)/(value_type(3)*cbrt(expr.val()*expr.val()))) -#endif #undef FAD_UNARYOP_MACRO @@ -2168,7 +2166,6 @@ namespace Sacado { // Can't use the above macros because it is a ternary operator (sort of). // Also, relies on C++11 -#ifdef HAVE_SACADO_CXX11 namespace Sacado { namespace Fad { @@ -2461,7 +2458,7 @@ namespace Sacado { template SACADO_INLINE_FUNCTION typename mpl::disable_if< - mpl::is_same< typename Expr::value_type, + std::is_same< typename Expr::value_type, typename Expr::scalar_type>, Expr< IfThenElseOp< CondT, ConstExpr::scalar_type>, Expr > > @@ -2478,7 +2475,7 @@ namespace Sacado { template SACADO_INLINE_FUNCTION typename mpl::disable_if< - mpl::is_same< typename Expr::value_type, + std::is_same< typename Expr::value_type, typename Expr::scalar_type>, Expr< IfThenElseOp< CondT, Expr, ConstExpr::scalar_type> > > @@ -2494,12 +2491,8 @@ namespace Sacado { } } -#endif - //-------------------------- Relational Operators ----------------------- -#ifdef HAVE_SACADO_CXX11 - namespace Sacado { namespace Fad { template @@ -2542,42 +2535,6 @@ namespace Sacado { \ } \ } -#else - -#define FAD_RELOP_MACRO(OP) \ -namespace Sacado { \ - namespace Fad { \ - template \ - SACADO_INLINE_FUNCTION \ - bool \ - operator OP (const Expr& expr1, \ - const Expr& expr2) \ - { \ - return expr1.val() OP expr2.val(); \ - } \ - \ - template \ - SACADO_INLINE_FUNCTION \ - bool \ - operator OP (const typename Expr::value_type& a, \ - const Expr& expr2) \ - { \ - return a OP expr2.val(); \ - } \ - \ - template \ - SACADO_INLINE_FUNCTION \ - bool \ - operator OP (const Expr& expr1, \ - const typename Expr::value_type& b) \ - { \ - return expr1.val() OP b; \ - } \ - } \ -} - -#endif - FAD_RELOP_MACRO(==) FAD_RELOP_MACRO(!=) FAD_RELOP_MACRO(<) diff --git a/packages/sacado/src/Sacado_Fad_Ops_Fwd.hpp b/packages/sacado/src/Sacado_Fad_Ops_Fwd.hpp index b902f80885b6..63eae2b87e30 100644 --- a/packages/sacado/src/Sacado_Fad_Ops_Fwd.hpp +++ b/packages/sacado/src/Sacado_Fad_Ops_Fwd.hpp @@ -82,9 +82,7 @@ namespace Sacado { template class ATanhOp; template class AbsOp; template class FAbsOp; -#ifdef HAVE_SACADO_CXX11 template class CbrtOp; -#endif template ::value> class SafeSqrtOp; diff --git a/packages/sacado/src/Sacado_Fad_SimpleFadOps.hpp b/packages/sacado/src/Sacado_Fad_SimpleFadOps.hpp index 71c1ad6e05f0..ea72b50609c8 100644 --- a/packages/sacado/src/Sacado_Fad_SimpleFadOps.hpp +++ b/packages/sacado/src/Sacado_Fad_SimpleFadOps.hpp @@ -79,7 +79,6 @@ namespace Sacado { return SimpleFad(a, t1, t2); } -#ifdef HAVE_SACADO_CXX11 template SimpleFad cbrt(const SimpleFad& a) { @@ -87,7 +86,6 @@ namespace Sacado { ValueT t2 = 1.0/(3.0*t1*t1); return SimpleFad(a, t1, t2); } -#endif template SimpleFad diff --git a/packages/sacado/src/Sacado_LFad_LogicalSparseOps.hpp b/packages/sacado/src/Sacado_LFad_LogicalSparseOps.hpp index 43a75a5540e3..cae15013afc2 100644 --- a/packages/sacado/src/Sacado_LFad_LogicalSparseOps.hpp +++ b/packages/sacado/src/Sacado_LFad_LogicalSparseOps.hpp @@ -168,11 +168,9 @@ FAD_UNARYOP_MACRO(abs, FAD_UNARYOP_MACRO(fabs, FAbsOp, std::fabs(expr.val())) -#ifdef HAVE_SACADO_CXX11 FAD_UNARYOP_MACRO(cbrt, CbrtOp, std::cbrt(expr.val())) -#endif #undef FAD_UNARYOP_MACRO diff --git a/packages/sacado/src/Sacado_MathFunctions.hpp b/packages/sacado/src/Sacado_MathFunctions.hpp index b8927711e636..c56f364ea8bb 100644 --- a/packages/sacado/src/Sacado_MathFunctions.hpp +++ b/packages/sacado/src/Sacado_MathFunctions.hpp @@ -133,9 +133,7 @@ UNARYFUNC_MACRO(asinh, ASinhOp) UNARYFUNC_MACRO(atanh, ATanhOp) UNARYFUNC_MACRO(abs, AbsOp) UNARYFUNC_MACRO(fabs, FAbsOp) -#ifdef HAVE_SACADO_CXX11 UNARYFUNC_MACRO(cbrt, CbrtOp) -#endif #undef UNARYFUNC_MACRO diff --git a/packages/sacado/src/Sacado_SFINAE_Macros.hpp b/packages/sacado/src/Sacado_SFINAE_Macros.hpp index c8bf7f3437cc..ce5f7b4ac39a 100644 --- a/packages/sacado/src/Sacado_SFINAE_Macros.hpp +++ b/packages/sacado/src/Sacado_SFINAE_Macros.hpp @@ -30,15 +30,15 @@ #ifndef SACADO_SFINAE_MACROS_H #define SACADO_SFINAE_MACROS_H +#include + #include "Sacado_mpl_enable_if.hpp" #include "Sacado_mpl_disable_if.hpp" -#include "Sacado_mpl_is_same.hpp" -#include "Sacado_mpl_is_convertible.hpp" #include "Sacado_mpl_type_wrap.hpp" /* Define some macros useful for disabling template function overloads */ #define SACADO_ENABLE_IF_SAME(TYPE1, TYPE2, RETURN_TYPE) \ - typename mpl::enable_if_c::value && ExprLevel::value == ExprLevel::value, RETURN_TYPE >::type + typename mpl::enable_if_c::value && ExprLevel::value == ExprLevel::value, RETURN_TYPE >::type #define SACADO_ENABLE_EXPR_FUNC(RETURN_TYPE) \ SACADO_ENABLE_IF_SAME(typename Expr::value_type, value_type, RETURN_TYPE) #define SACADO_ENABLE_EXPR_CTOR_DEF SACADO_ENABLE_EXPR_FUNC(void*) @@ -50,7 +50,7 @@ SACADO_ENABLE_IF_SAME(typename Expr::derived_type::value_type, value_type, RETURN_TYPE) #define SACADO_EXP_ENABLE_EXPR_CTOR_DEF \ typename mpl::enable_if_c< \ - mpl::is_convertible< typename Expr::derived_type::value_type , \ + std::is_convertible< typename Expr::derived_type::value_type , \ value_type >::value && \ (ExprLevel< typename Expr::derived_type::value_type >::value == \ ExprLevel< value_type >::value) && \ @@ -60,7 +60,7 @@ SACADO_ENABLE_IF_SAME(typename Expr::derived_type::value_type, typename FAD::value_type, FAD&) #define SACADO_ENABLE_IF_CONVERTIBLE(TYPE1, TYPE2, RETURN_TYPE) \ - typename Sacado::mpl::enable_if, RETURN_TYPE >::type + typename Sacado::mpl::enable_if, RETURN_TYPE >::type #define SACADO_ENABLE_VALUE_FUNC(RETURN_TYPE) \ SACADO_ENABLE_IF_CONVERTIBLE(S, value_type, RETURN_TYPE) #define SACADO_ENABLE_VALUE_CTOR_DEF SACADO_ENABLE_VALUE_FUNC(void*) @@ -68,7 +68,7 @@ #define SACADO_EXP_ENABLE_VALUE_CTOR_DEF \ typename mpl::enable_if_c< \ - Sacado::mpl::is_convertible< S , value_type >::value && \ + std::is_convertible< S , value_type >::value && \ !is_view, void* >::type #define SACADO_EXP_ENABLE_VALUE_CTOR_DECL SACADO_EXP_ENABLE_VALUE_CTOR_DEF = 0 @@ -83,12 +83,12 @@ OP< typename Expr::derived_type, typename Expr::derived_type, false, false, typename T1::expr_spec_type > \ >::type #define SACADO_FAD_OP_ENABLE_SCALAR_EXPR(OP) \ - typename mpl::disable_if::value_type, typename Expr::scalar_type>, Expr< OP< ConstExpr::scalar_type>, Expr > > >::type + typename mpl::disable_if::value_type, typename Expr::scalar_type>, Expr< OP< ConstExpr::scalar_type>, Expr > > >::type #define SACADO_FAD_OP_ENABLE_EXPR_SCALAR(OP) \ - typename mpl::disable_if::value_type, typename Expr::scalar_type>, Expr< OP< Expr, ConstExpr::scalar_type> > > >::type + typename mpl::disable_if::value_type, typename Expr::scalar_type>, Expr< OP< Expr, ConstExpr::scalar_type> > > >::type #define SACADO_FAD_EXP_OP_ENABLE_SCALAR_EXPR(OP) \ - typename mpl::disable_if, OP< typename T::scalar_type, typename Expr::derived_type, true, false, typename T::expr_spec_type > >::type + typename mpl::disable_if, OP< typename T::scalar_type, typename Expr::derived_type, true, false, typename T::expr_spec_type > >::type #define SACADO_FAD_EXP_OP_ENABLE_EXPR_SCALAR(OP) \ - typename mpl::disable_if, OP< typename Expr::derived_type, typename T::scalar_type, false, true, typename T::expr_spec_type > >::type + typename mpl::disable_if, OP< typename Expr::derived_type, typename T::scalar_type, false, true, typename T::expr_spec_type > >::type #endif // SACADO_SFINAE_MACROS_H diff --git a/packages/sacado/src/Sacado_ScalarFlopCounter.cpp b/packages/sacado/src/Sacado_ScalarFlopCounter.cpp index 245fccf63c06..406ae205457c 100644 --- a/packages/sacado/src/Sacado_ScalarFlopCounter.cpp +++ b/packages/sacado/src/Sacado_ScalarFlopCounter.cpp @@ -59,9 +59,7 @@ Sacado::FlopCounterPack::FlopCounts::flopCountsNames[] = ,"log" ,"log10" ,"sqrt" -#ifdef HAVE_SACADO_CXX11 ,"cbrt" -#endif ,"cos" ,"sin" ,"tan" @@ -162,9 +160,7 @@ Sacado::FlopCounterPack::FlopCounts::getSummaryType(Sacado::FlopCounterPack::Flo case LOG: case LOG10: case SQRT: -#ifdef HAVE_SACADO_CXX11 case CBRT: -#endif case COS: case SIN: case TAN: diff --git a/packages/sacado/src/Sacado_ScalarFlopCounter.hpp b/packages/sacado/src/Sacado_ScalarFlopCounter.hpp index 49b40ad3161a..631c52a03ab1 100644 --- a/packages/sacado/src/Sacado_ScalarFlopCounter.hpp +++ b/packages/sacado/src/Sacado_ScalarFlopCounter.hpp @@ -46,13 +46,9 @@ namespace Sacado { class FlopCounts { public: -#ifdef HAVE_SACADO_CXX11 /// Number of total operation supported up till now enum { NUM_OPS = 35 }; -#else - /// Number of total operation supported up till now - enum { NUM_OPS = 34 }; -#endif + /// Enum for operations enum EFlopType { ASSIGN @@ -75,9 +71,7 @@ namespace Sacado { ,LOG ,LOG10 ,SQRT -#ifdef HAVE_SACADO_CXX11 ,CBRT -#endif ,COS ,SIN ,TAN @@ -458,9 +452,7 @@ namespace Sacado { SCALAR_FLOP_COUNTER_UNARY_FUNC(log,FlopCounts::LOG) SCALAR_FLOP_COUNTER_UNARY_FUNC(log10,FlopCounts::LOG10) SCALAR_FLOP_COUNTER_UNARY_FUNC(sqrt,FlopCounts::SQRT) -#ifdef HAVE_SACADO_CXX11 SCALAR_FLOP_COUNTER_UNARY_FUNC(cbrt,FlopCounts::CBRT) -#endif SCALAR_FLOP_COUNTER_UNARY_FUNC(cos,FlopCounts::COS) SCALAR_FLOP_COUNTER_UNARY_FUNC(sin,FlopCounts::SIN) SCALAR_FLOP_COUNTER_UNARY_FUNC(tan,FlopCounts::TAN) diff --git a/packages/sacado/src/Sacado_Tay_CacheTaylorOps.hpp b/packages/sacado/src/Sacado_Tay_CacheTaylorOps.hpp index 64ef8caf1d47..0d42d30fd0cc 100644 --- a/packages/sacado/src/Sacado_Tay_CacheTaylorOps.hpp +++ b/packages/sacado/src/Sacado_Tay_CacheTaylorOps.hpp @@ -1613,7 +1613,6 @@ TAYLOR_BINARYOP_MACRO(operator/, DivisionOp) // can't conflict with the general definition, so we need to use // Substitution Failure Is Not An Error #include "Sacado_mpl_disable_if.hpp" -#include "Sacado_mpl_is_same.hpp" #define TAYLOR_SFINAE_BINARYOP_MACRO(OPNAME,OP) \ namespace Sacado { \ @@ -1621,7 +1620,7 @@ namespace Sacado { \ template \ inline \ typename \ - mpl::disable_if< mpl::is_same, \ + mpl::disable_if< std::is_same, \ Expr, Expr, OP> > >::type \ OPNAME (const Expr& expr1, const Expr& expr2) \ { \ diff --git a/packages/sacado/src/Sacado_Tay_Taylor.hpp b/packages/sacado/src/Sacado_Tay_Taylor.hpp index 905fc58b6fcc..070457896763 100644 --- a/packages/sacado/src/Sacado_Tay_Taylor.hpp +++ b/packages/sacado/src/Sacado_Tay_Taylor.hpp @@ -333,9 +333,7 @@ namespace Sacado { template Taylor log(const Base< Taylor >& a); template Taylor log10(const Base< Taylor >& a); template Taylor sqrt(const Base< Taylor >& a); -#ifdef HAVE_SACADO_CXX11 template Taylor cbrt(const Base< Taylor >& a); -#endif template Taylor pow(const Base< Taylor >& a, const Base< Taylor >& b); template Taylor pow(const typename Taylor::value_type& a, diff --git a/packages/sacado/src/Sacado_Tay_TaylorImp.hpp b/packages/sacado/src/Sacado_Tay_TaylorImp.hpp index a330b1b3748c..48ff04c9bc3e 100644 --- a/packages/sacado/src/Sacado_Tay_TaylorImp.hpp +++ b/packages/sacado/src/Sacado_Tay_TaylorImp.hpp @@ -906,14 +906,12 @@ sqrt(const Base< Taylor >& aa) return c; } -#ifdef HAVE_SACADO_CXX11 template Taylor cbrt(const Base< Taylor >& aa) { return pow(aa, typename Taylor::value_type(1.0/3.0)); } -#endif template Taylor diff --git a/packages/sacado/src/Sacado_Traits.hpp b/packages/sacado/src/Sacado_Traits.hpp index 14ebd222ab3e..4247e58cb063 100644 --- a/packages/sacado/src/Sacado_Traits.hpp +++ b/packages/sacado/src/Sacado_Traits.hpp @@ -49,13 +49,13 @@ #ifndef SACADO_TRAITS_HPP #define SACADO_TRAITS_HPP +#include +#include + #include "Sacado_ConfigDefs.h" #include "Sacado_dummy_arg.hpp" #include "Sacado_mpl_enable_if.hpp" #include "Sacado_mpl_disable_if.hpp" -#include "Sacado_mpl_is_convertible.hpp" -#include "Sacado_mpl_is_same.hpp" -#include #ifdef HAVE_SACADO_COMPLEX #include @@ -115,8 +115,8 @@ namespace Sacado { //! Specialization of %Promote when A is convertible to B but not vice-versa template struct Promote< A, B, - typename mpl::enable_if_c< mpl::is_convertible::value && - !mpl::is_convertible::value && + typename mpl::enable_if_c< std::is_convertible::value && + !std::is_convertible::value && !OverrideDefaultPromote::value && !OverrideDefaultPromote::value >::type > { @@ -126,8 +126,8 @@ namespace Sacado { //! Specialization of %Promote when B is convertible to A but not vice-versa template struct Promote< A, B, - typename mpl::enable_if_c< mpl::is_convertible::value && - !mpl::is_convertible::value && + typename mpl::enable_if_c< std::is_convertible::value && + !std::is_convertible::value && !OverrideDefaultPromote::value && !OverrideDefaultPromote::value >::type > { @@ -140,9 +140,9 @@ namespace Sacado { */ template struct Promote< A, B, - typename mpl::enable_if_c< mpl::is_convertible::value && - mpl::is_convertible::value && - !mpl::is_same::value && + typename mpl::enable_if_c< std::is_convertible::value && + std::is_convertible::value && + !std::is_same::value && ( IsExpr::value || IsExpr::value ) >::type > { @@ -158,10 +158,10 @@ namespace Sacado { */ template struct Promote< A, B, - typename mpl::enable_if_c< !mpl::is_convertible::value && - !mpl::is_convertible::value && + typename mpl::enable_if_c< !std::is_convertible::value && + !std::is_convertible::value && IsExpr::value && - mpl::is_convertible< B, typename BaseExprType< typename A::value_type >::type >::value + std::is_convertible< B, typename BaseExprType< typename A::value_type >::type >::value >::type > { typedef typename BaseExprType::type type; @@ -174,10 +174,10 @@ namespace Sacado { */ template struct Promote< A, B, - typename mpl::enable_if_c< !mpl::is_convertible::value && - !mpl::is_convertible::value && + typename mpl::enable_if_c< !std::is_convertible::value && + !std::is_convertible::value && IsExpr::value && - mpl::is_convertible< A, typename BaseExprType< typename B::value_type >::type >::value + std::is_convertible< A, typename BaseExprType< typename B::value_type >::type >::value >::type > { typedef typename BaseExprType::type type; @@ -190,11 +190,11 @@ namespace Sacado { */ template struct Promote< A, B, - typename mpl::enable_if_c< !mpl::is_convertible::value && - !mpl::is_convertible::value && + typename mpl::enable_if_c< !std::is_convertible::value && + !std::is_convertible::value && IsExpr::value && IsExpr::value && - mpl::is_same< typename BaseExprType< typename A::value_type >::type, + std::is_same< typename BaseExprType< typename A::value_type >::type, typename BaseExprType< typename B::value_type >::type >::value >::type > { diff --git a/packages/sacado/src/Sacado_cmath.hpp b/packages/sacado/src/Sacado_cmath.hpp index 34d90578e4d7..7b52dcf6fa51 100644 --- a/packages/sacado/src/Sacado_cmath.hpp +++ b/packages/sacado/src/Sacado_cmath.hpp @@ -33,25 +33,6 @@ #include // for most math functions #include "Sacado_ConfigDefs.h" -// Define some math functions that aren't usually in cmath -#if !( (defined(_GLIBCXX_USE_C99_MATH_TR1) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || defined(HAVE_SACADO_CXX11) || defined(HAS_C99_TR1_CMATH) || defined(USER_DISABLE_SACADO_TR1_CMATH) ) -namespace std { - inline float acosh(float x) { - return std::log(x + std::sqrt(x*x - float(1.0))); } - inline float asinh(float x) { - return std::log(x + std::sqrt(x*x + float(1.0))); } - inline float atanh(float x) { - return float(0.5)*std::log((float(1.0)+x)/(float(1.0)-x)); } - - inline double acosh(double x) { - return std::log(x + std::sqrt(x*x - double(1.0))); } - inline double asinh(double x) { - return std::log(x + std::sqrt(x*x + double(1.0))); } - inline double atanh(double x) { - return double(0.5)*std::log((double(1.0)+x)/(double(1.0)-x)); } -} -#endif // HAS_C99_TR1_CMATH - namespace Sacado { // Replacement for ternary operator, for scalar types that don't implement diff --git a/packages/sacado/src/Sacado_trad.hpp b/packages/sacado/src/Sacado_trad.hpp index 2036def8c67c..8b584e330aec 100644 --- a/packages/sacado/src/Sacado_trad.hpp +++ b/packages/sacado/src/Sacado_trad.hpp @@ -389,9 +389,7 @@ T1(sqrt) T1(tan) T1(tanh) T1(fabs) -#ifdef HAVE_SACADO_CXX11 T1(cbrt) -#endif T F copy(AI); T F copy(Ai); @@ -527,9 +525,7 @@ F r f <>(D,Ai); T1(R,tanh) T1(R,fabs) T1(R,copy) -#ifdef HAVE_SACADO_CXX11 T1(R,cbrt) -#endif T2(int,operator<) T2(int,operator<=) T2(int,operator==) @@ -840,9 +836,7 @@ T1(tan) T1(tanh) T1(fabs) T1(copy) -#ifdef HAVE_SACADO_CXX11 T1(cbrt) -#endif #undef D #undef F @@ -2573,7 +2567,6 @@ fabs(const Base< ADvari > &vv) { return *(new ADvar1s(t, p, &v)); } -#ifdef HAVE_SACADO_CXX11 template ADvari& cbrt(const Base< ADvari > &vv) { @@ -2581,7 +2574,6 @@ cbrt(const Base< ADvari > &vv) { Double t = std::cbrt(v.Val); return *(new ADvar1s(t, 1.0/(3.0*t*t), &v)); } -#endif template ADvari& @@ -2711,9 +2703,7 @@ T1(sqrt) T1(tan) T1(tanh) T1(fabs) -#ifdef HAVE_SACADO_CXX11 T1(cbrt) -#endif T F copy(AI xx) { diff --git a/packages/sacado/src/mpl/Sacado_mpl_bind.hpp b/packages/sacado/src/mpl/Sacado_mpl_bind.hpp index ef6db90dcd3e..ebb21c2579c8 100644 --- a/packages/sacado/src/mpl/Sacado_mpl_bind.hpp +++ b/packages/sacado/src/mpl/Sacado_mpl_bind.hpp @@ -32,8 +32,9 @@ #ifndef SACADO_MPL_BIND_HPP #define SACADO_MPL_BIND_HPP +#include + #include "Sacado_mpl_placeholders.hpp" -#include "Sacado_mpl_is_same.hpp" #include "Sacado_mpl_apply_wrap.hpp" namespace Sacado { @@ -60,7 +61,7 @@ namespace Sacado { class U5=mpl::none> struct apply : apply_wrap1::value, + typename hk::value, T1, U1,U2,U3,U4,U5>::type> {}; }; @@ -74,11 +75,11 @@ namespace Sacado { class U5=mpl::none> struct apply : apply_wrap2::value, + typename hk::value, T1, U1,U2,U3,U4,U5>::type, - typename hk::value+ - is_same::value, + typename hk::value+ + std::is_same::value, T2, U1,U2,U3,U4,U5>::type> {}; }; @@ -92,16 +93,16 @@ namespace Sacado { class U5=mpl::none> struct apply : apply_wrap3::value, + typename hk::value, T1, U1,U2,U3,U4,U5>::type, - typename hk::value+ - is_same::value, + typename hk::value+ + std::is_same::value, T2, U1,U2,U3,U4,U5>::type, - typename hk::value+ - is_same::value+ - is_same::value, + typename hk::value+ + std::is_same::value+ + std::is_same::value, T3, U1,U2,U3,U4,U5>::type> {}; }; @@ -115,22 +116,22 @@ namespace Sacado { class U5=mpl::none> struct apply : apply_wrap4::value, + typename hk::value, T1, U1,U2,U3,U4,U5>::type, - typename hk::value+ - is_same::value, + typename hk::value+ + std::is_same::value, T2, U1,U2,U3,U4,U5>::type, - typename hk::value+ - is_same::value+ - is_same::value, + typename hk::value+ + std::is_same::value+ + std::is_same::value, T3, U1,U2,U3,U4,U5>::type, - typename hk::value+ - is_same::value+ - is_same::value+ - is_same::value, + typename hk::value+ + std::is_same::value+ + std::is_same::value+ + std::is_same::value, T4, U1,U2,U3,U4,U5>::type> {}; }; @@ -144,29 +145,29 @@ namespace Sacado { class U5=mpl::none> struct apply : apply_wrap5::value, + typename hk::value, T1, U1,U2,U3,U4,U5>::type, - typename hk::value+ - is_same::value, + typename hk::value+ + std::is_same::value, T2, U1,U2,U3,U4,U5>::type, - typename hk::value+ - is_same::value+ - is_same::value, + typename hk::value+ + std::is_same::value+ + std::is_same::value, T3, U1,U2,U3,U4,U5>::type, - typename hk::value+ - is_same::value+ - is_same::value+ - is_same::value, + typename hk::value+ + std::is_same::value+ + std::is_same::value+ + std::is_same::value, T4, U1,U2,U3,U4,U5>::type, - typename hk::value+ - is_same::value+ - is_same::value+ - is_same::value+ - is_same::value, + typename hk::value+ + std::is_same::value+ + std::is_same::value+ + std::is_same::value+ + std::is_same::value, T5, U1,U2,U3,U4,U5>::type> {}; }; diff --git a/packages/sacado/src/mpl/Sacado_mpl_find.hpp b/packages/sacado/src/mpl/Sacado_mpl_find.hpp index 8d6b6533b847..d33bcca8711a 100644 --- a/packages/sacado/src/mpl/Sacado_mpl_find.hpp +++ b/packages/sacado/src/mpl/Sacado_mpl_find.hpp @@ -30,12 +30,13 @@ #ifndef SACADO_MPL_FIND_HPP #define SACADO_MPL_FIND_HPP +#include + #include "Sacado_mpl_none.hpp" #include "Sacado_mpl_begin.hpp" #include "Sacado_mpl_end.hpp" #include "Sacado_mpl_deref.hpp" #include "Sacado_mpl_next.hpp" -#include "Sacado_mpl_is_same.hpp" #include "Sacado_mpl_if.hpp" namespace Sacado { @@ -51,7 +52,7 @@ namespace Sacado { class Iter2 = typename mpl::end::type> struct find { typedef typename - mpl::mpl_if< mpl::is_same::type, T>, + mpl::mpl_if< std::is_same::type, T>, Iter1, find::type, Iter2> >::type type; diff --git a/packages/sacado/src/mpl/Sacado_mpl_has_equal_to.hpp b/packages/sacado/src/mpl/Sacado_mpl_has_equal_to.hpp index ca8d4b787aad..9352bf685b69 100644 --- a/packages/sacado/src/mpl/Sacado_mpl_has_equal_to.hpp +++ b/packages/sacado/src/mpl/Sacado_mpl_has_equal_to.hpp @@ -32,18 +32,16 @@ #include -#include "Sacado_mpl_void.hpp" - namespace Sacado { namespace mpl { - template > + template > struct has_equal_to : std::false_type {}; template - struct has_equal_to() == - std::declval())> > + struct has_equal_to() == + std::declval())> > : std::true_type {}; } diff --git a/packages/sacado/src/mpl/Sacado_mpl_is_convertible.hpp b/packages/sacado/src/mpl/Sacado_mpl_is_convertible.hpp deleted file mode 100644 index b4aff3620c19..000000000000 --- a/packages/sacado/src/mpl/Sacado_mpl_is_convertible.hpp +++ /dev/null @@ -1,87 +0,0 @@ -// @HEADER -// *********************************************************************** -// -// Sacado Package -// Copyright (2006) Sandia Corporation -// -// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -// the U.S. Government retains certain rights in this software. -// -// This library is free software; you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 2.1 of the -// License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 -// USA -// Questions? Contact David M. Gay (dmgay@sandia.gov) or Eric T. Phipps -// (etphipp@sandia.gov). -// -// *********************************************************************** -// @HEADER - -#ifndef SACADO_MPL_IS_CONVERTIBLE_HPP -#define SACADO_MPL_IS_CONVERTIBLE_HPP - -#include "Sacado_ConfigDefs.h" - -#ifdef HAVE_SACADO_CXX11 - -#include -namespace Sacado { - namespace mpl { - using std::is_convertible; - } -} - -#else - -namespace Sacado { - - namespace mpl { - - // - // A simplified implementation of boost type-trait - // is_convertible. We use this in a much more limited context - // within Sacado, and so the easy implementation should always work. - // We assume From and To are "scalar" types, e.g., are not pointer or - // reference types. - // - - struct convertible_impl { - typedef char yes; // sizeof(yes) == 1 - typedef char (&no)[2]; // sizeof(no) == 2 - - // A function that takes anything convertible to a To - template static yes tester(To); - - // Overload resolution prefers anything over ... - template static no tester(...); - - // Check if From is convertible to To - template - struct checker { - static From& f; - static const bool value = sizeof(tester(f)) == sizeof(yes); - }; - }; - - template - struct is_convertible { - static const bool value = convertible_impl::checker::value; - }; - - } - -} - -#endif - -#endif // SACADO_MPL_IS_CONVERTIBLE_HPP diff --git a/packages/sacado/src/mpl/Sacado_mpl_is_same.hpp b/packages/sacado/src/mpl/Sacado_mpl_is_same.hpp deleted file mode 100644 index 8a94acd15f9d..000000000000 --- a/packages/sacado/src/mpl/Sacado_mpl_is_same.hpp +++ /dev/null @@ -1,51 +0,0 @@ -// @HEADER -// *********************************************************************** -// -// Sacado Package -// Copyright (2006) Sandia Corporation -// -// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -// the U.S. Government retains certain rights in this software. -// -// This library is free software; you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 2.1 of the -// License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 -// USA -// Questions? Contact David M. Gay (dmgay@sandia.gov) or Eric T. Phipps -// (etphipp@sandia.gov). -// -// *********************************************************************** -// @HEADER - -#ifndef SACADO_MPL_IS_SAME_HPP -#define SACADO_MPL_IS_SAME_HPP - -namespace Sacado { - - namespace mpl { - - template - struct is_same { - static const bool value = false; - }; - - template - struct is_same { - static const bool value = true; - }; - - } - -} - -#endif // SACADO_MPL_IS_SAME_HPP diff --git a/packages/sacado/src/mpl/Sacado_mpl_vector.hpp b/packages/sacado/src/mpl/Sacado_mpl_vector.hpp index be0707df5c2b..072144321ff8 100644 --- a/packages/sacado/src/mpl/Sacado_mpl_vector.hpp +++ b/packages/sacado/src/mpl/Sacado_mpl_vector.hpp @@ -31,7 +31,6 @@ #define SACADO_MPL_VECTOR_HPP #include "Sacado_ConfigDefs.h" -#ifdef HAVE_SACADO_CXX11 #include "Sacado_mpl_none.hpp" #include "Sacado_mpl_size.hpp" @@ -131,5 +130,3 @@ namespace Sacado { } #endif - -#endif diff --git a/packages/sacado/src/mpl/Sacado_mpl_void.hpp b/packages/sacado/src/mpl/Sacado_mpl_void.hpp deleted file mode 100644 index 014fc3d892e8..000000000000 --- a/packages/sacado/src/mpl/Sacado_mpl_void.hpp +++ /dev/null @@ -1,45 +0,0 @@ -// @HEADER -// *********************************************************************** -// -// Sacado Package -// Copyright (2006) Sandia Corporation -// -// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, -// the U.S. Government retains certain rights in this software. -// -// This library is free software; you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 2.1 of the -// License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 -// USA -// Questions? Contact David M. Gay (dmgay@sandia.gov) or Eric T. Phipps -// (etphipp@sandia.gov). -// -// *********************************************************************** -// @HEADER - -#ifndef SACADO_MPL_VOID_HPP -#define SACADO_MPL_VOID_HPP - -namespace Sacado { - - namespace mpl { - - template struct make_void { typedef void type; }; - - template using void_t = typename make_void::type; - - } - -} - -#endif // SACADO_MPL_VOID_HPP diff --git a/packages/sacado/src/new_design/Sacado_Fad_Exp_Ops.hpp b/packages/sacado/src/new_design/Sacado_Fad_Exp_Ops.hpp index 2cd267d5d717..6a8301f4d3c1 100644 --- a/packages/sacado/src/new_design/Sacado_Fad_Exp_Ops.hpp +++ b/packages/sacado/src/new_design/Sacado_Fad_Exp_Ops.hpp @@ -1933,7 +1933,7 @@ namespace Sacado { template SACADO_INLINE_FUNCTION typename mpl::disable_if< - mpl::is_same< typename T::value_type, + std::is_same< typename T::value_type, typename T::scalar_type >, IfThenElseOp< CondT, typename T::scalar_type, typename Expr::derived_type, @@ -1952,7 +1952,7 @@ namespace Sacado { template SACADO_INLINE_FUNCTION typename mpl::disable_if< - mpl::is_same< typename T::value_type, + std::is_same< typename T::value_type, typename T::scalar_type >, IfThenElseOp< CondT, typename Expr::derived_type, typename T::scalar_type, diff --git a/packages/sacado/src/template/Sacado_TemplateContainer.hpp b/packages/sacado/src/template/Sacado_TemplateContainer.hpp index 2c6b82870136..760837356c3f 100644 --- a/packages/sacado/src/template/Sacado_TemplateContainer.hpp +++ b/packages/sacado/src/template/Sacado_TemplateContainer.hpp @@ -30,10 +30,11 @@ #ifndef SACADO_TEMPLATE_CONTAINER_HPP #define SACADO_TEMPLATE_CONTAINER_HPP +#include + // While this code does not directly use C++11 features, it uses mpl::vector, // which does #include "Sacado_ConfigDefs.h" -#ifdef HAVE_SACADO_CXX11 #include "Sacado_mpl_size.hpp" #include "Sacado_mpl_find.hpp" @@ -44,7 +45,6 @@ #include "Sacado_mpl_deref.hpp" #include "Sacado_mpl_next.hpp" #include "Sacado_mpl_enable_if.hpp" -#include "Sacado_mpl_is_same.hpp" namespace Sacado { @@ -233,7 +233,7 @@ namespace Sacado { Iter1, Iter2, typename mpl::enable_if_c< - mpl::is_same< T, typename mpl::deref::type + std::is_same< T, typename mpl::deref::type >::value >::type > { static typename TupleSeq::type& @@ -258,7 +258,7 @@ namespace Sacado { Iter1, Iter2, typename mpl::enable_if_c< - !mpl::is_same< T, typename mpl::deref::type + !std::is_same< T, typename mpl::deref::type >::value >::type > : GetTupleSeq< T, TypeSeq, ObjectT, typename mpl::next::type, Iter2> @@ -276,4 +276,3 @@ namespace Sacado { } #endif -#endif diff --git a/packages/sacado/test/GTestSuite/TraitsTests.hpp b/packages/sacado/test/GTestSuite/TraitsTests.hpp index 696dc92fcedb..2d9d1671de8c 100644 --- a/packages/sacado/test/GTestSuite/TraitsTests.hpp +++ b/packages/sacado/test/GTestSuite/TraitsTests.hpp @@ -30,11 +30,12 @@ #ifndef TRAITSTESTS_HPP #define TRAITSTESTS_HPP +#include + // Sacado includes #include "Sacado_No_Kokkos.hpp" #include "Sacado_Random.hpp" #include "Sacado_mpl_apply.hpp" -#include "Sacado_mpl_is_same.hpp" // gtest includes #include @@ -67,10 +68,10 @@ TYPED_TEST_P(TraitsTests, testScalarType) { typedef decltype(this->ad1) ad1_t; typedef decltype(this->ad2) ad2_t; - bool same = Sacado::mpl::is_same< typename Sacado::ScalarType::type, double >::value; + bool same = std::is_same< typename Sacado::ScalarType::type, double >::value; ASSERT_TRUE(same == true); -same = Sacado::mpl::is_same< typename Sacado::ScalarType::type,double >::value; +same = std::is_same< typename Sacado::ScalarType::type,double >::value; ASSERT_TRUE(same == true); } @@ -78,10 +79,10 @@ TYPED_TEST_P(TraitsTests, testValueType) { typedef decltype(this->ad1) ad1_t; typedef decltype(this->ad2) ad2_t; - bool same = Sacado::mpl::is_same< typename Sacado::ValueType::type,double >::value; + bool same = std::is_same< typename Sacado::ValueType::type,double >::value; ASSERT_TRUE(same == true); - same = Sacado::mpl::is_same< typename Sacado::ValueType::type,ad1_t >::value; + same = std::is_same< typename Sacado::ValueType::type,ad1_t >::value; ASSERT_TRUE(same == true); } diff --git a/packages/sacado/test/UnitTests/ConversionTests.cpp b/packages/sacado/test/UnitTests/ConversionTests.cpp index 9995ce2d6b5f..2002ce3d4431 100644 --- a/packages/sacado/test/UnitTests/ConversionTests.cpp +++ b/packages/sacado/test/UnitTests/ConversionTests.cpp @@ -27,6 +27,8 @@ // *********************************************************************** // @HEADER +#include + #include "Teuchos_UnitTestHarness.hpp" #include "Teuchos_UnitTestRepository.hpp" #include "Teuchos_GlobalMPISession.hpp" @@ -36,9 +38,8 @@ #include "Sacado_Fad_SimpleFad.hpp" #include "Sacado_Tay_CacheTaylor.hpp" #include "Sacado_mpl_apply.hpp" -#include "Sacado_mpl_is_convertible.hpp" -// Some classes for testing mpl::is_convertible +// Some classes for testing std::is_convertible struct A {}; struct B { B() {} @@ -52,12 +53,12 @@ const int global_fad_size = 10; // Test is_convertible behaves as expected TEUCHOS_UNIT_TEST( Conversion, IsConvertible ) { - const bool is_b_a = Sacado::mpl::is_convertible::value; - const bool is_a_b = Sacado::mpl::is_convertible::value; - const bool is_c_a = Sacado::mpl::is_convertible::value; - const bool is_int_double = Sacado::mpl::is_convertible::value; - const bool is_double_int = Sacado::mpl::is_convertible::value; - const bool is_double_a = Sacado::mpl::is_convertible::value; + const bool is_b_a = std::is_convertible::value; + const bool is_a_b = std::is_convertible::value; + const bool is_c_a = std::is_convertible::value; + const bool is_int_double = std::is_convertible::value; + const bool is_double_int = std::is_convertible::value; + const bool is_double_a = std::is_convertible::value; TEST_EQUALITY( is_b_a, false ); TEST_EQUALITY( is_a_b, true ); TEST_EQUALITY( is_c_a, true ); @@ -74,17 +75,17 @@ bool test_ad_conversions(Teuchos::FancyOStream& out) typedef typename Sacado::ScalarType::type scalar_type; const bool is_value_ad = - Sacado::mpl::is_convertible::value; + std::is_convertible::value; const bool is_ad_value = - Sacado::mpl::is_convertible::value; + std::is_convertible::value; const bool is_scalar_ad = - Sacado::mpl::is_convertible::value; + std::is_convertible::value; const bool is_ad_scalar = - Sacado::mpl::is_convertible::value; + std::is_convertible::value; const bool is_not_view = ! Sacado::IsView::value; const bool is_int_ad = - Sacado::mpl::is_convertible::value; + std::is_convertible::value; TEST_EQUALITY( is_value_ad, is_not_view ); TEST_EQUALITY_CONST( is_ad_value, false ); @@ -92,7 +93,6 @@ bool test_ad_conversions(Teuchos::FancyOStream& out) TEST_EQUALITY_CONST( is_ad_scalar, false ); TEST_EQUALITY( is_int_ad, is_not_view ); -#ifdef HAVE_SACADO_CXX11 // Get the type of the result of the expression 'ad_type * ad_type' // The use of declval gets around actually instantiation objects of type // ad_type. @@ -100,16 +100,15 @@ bool test_ad_conversions(Teuchos::FancyOStream& out) typedef decltype(std::declval()*std::declval()) val_expr_type; const bool is_ad_expr_ad = - Sacado::mpl::is_convertible::value; + std::is_convertible::value; const bool is_val_expr_ad = - Sacado::mpl::is_convertible::value; + std::is_convertible::value; TEST_EQUALITY( is_ad_expr_ad, is_not_view ); TEST_EQUALITY( is_val_expr_ad, is_not_view ); // typedef typename ad_expr_type::value_type ad_expr_value_type; // std::cout << typeid(ad_expr_value_type).name() << std::endl; -#endif return success; } diff --git a/packages/stokhos/CMakeLists.txt b/packages/stokhos/CMakeLists.txt index bbbbe4f2bd11..18b3d6beb8cc 100644 --- a/packages/stokhos/CMakeLists.txt +++ b/packages/stokhos/CMakeLists.txt @@ -47,9 +47,6 @@ IF(HAVE_STOKHOS_ENSEMBLE_GEMV) SET(Stokhos_Ensemble_GEMV_Team_Size 1 CACHE STRING "Team size used in the ensemble GEMV") ENDIF() -# FIXME: Remove this hard-coded setting. We always have C++11 now. -SET(HAVE_STOKHOS_CXX11 ON) - SET(Stokhos_ENABLE_Ensemble_Scalar_Type_Default OFF) IF(Stokhos_ENABLE_Sacado) SET(Stokhos_ENABLE_Ensemble_Scalar_Type_Default ON) diff --git a/packages/stokhos/cmake/Stokhos_config.h.in b/packages/stokhos/cmake/Stokhos_config.h.in index 1a97d5227426..412644c4dff2 100644 --- a/packages/stokhos/cmake/Stokhos_config.h.in +++ b/packages/stokhos/cmake/Stokhos_config.h.in @@ -72,7 +72,7 @@ /* Define if Boost is enabled */ #cmakedefine HAVE_STOKHOS_BOOST -/* Define if TpetraKernels is enabled */ +/* Define if KokkosKernels is enabled */ #cmakedefine HAVE_STOKHOS_KOKKOSKERNELS #ifdef HAVE_STOKHOS_KOKKOSKERNELS // Define old macro for backwards compatibility. @@ -113,9 +113,6 @@ /* Define if intrinsics are enabled */ #cmakedefine HAVE_STOKHOS_INTRINSICS -/* Define if C++11 is enabled */ -#cmakedefine HAVE_STOKHOS_CXX11 - /* Define if Thyra is enabled */ #cmakedefine HAVE_STOKHOS_THYRA diff --git a/packages/stokhos/src/kokkos/Stokhos_CooProductTensor.hpp b/packages/stokhos/src/kokkos/Stokhos_CooProductTensor.hpp index f5f916ffa5b9..aa1bd006b186 100644 --- a/packages/stokhos/src/kokkos/Stokhos_CooProductTensor.hpp +++ b/packages/stokhos/src/kokkos/Stokhos_CooProductTensor.hpp @@ -42,6 +42,8 @@ #ifndef STOKHOS_COO_PRODUCT_TENSOR_HPP #define STOKHOS_COO_PRODUCT_TENSOR_HPP +#include + #include "Kokkos_Core.hpp" #include "Stokhos_Multiply.hpp" @@ -49,8 +51,6 @@ #include "Stokhos_Sparse3Tensor.hpp" #include "Teuchos_ParameterList.hpp" -#include "Kokkos_Core.hpp" - //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- diff --git a/packages/stokhos/src/sacado/kokkos/vector/Fad/Sacado_Fad_Ops_MP_Vector.hpp b/packages/stokhos/src/sacado/kokkos/vector/Fad/Sacado_Fad_Ops_MP_Vector.hpp index d8a00e7c1a60..761299b2a8b3 100644 --- a/packages/stokhos/src/sacado/kokkos/vector/Fad/Sacado_Fad_Ops_MP_Vector.hpp +++ b/packages/stokhos/src/sacado/kokkos/vector/Fad/Sacado_Fad_Ops_MP_Vector.hpp @@ -246,14 +246,12 @@ FAD_UNARYOP_MACRO(fabs, val_type(-expr.dx(i,j)), expr.val(j) >= 0 ? val_type(+expr.fastAccessDx(i,j)) : val_type(-expr.fastAccessDx(i,j))) -#ifdef HAVE_SACADO_CXX11 FAD_UNARYOP_MACRO(cbrt, CbrtOp, std::cbrt(expr.val()), std::cbrt(expr.val(j)), expr.dx(i,j)/(val_type(3)*std::cbrt(expr.val(j)*expr.val(j))), expr.fastAccessDx(i,j)/(val_type(3)*std::cbrt(expr.val(j)*expr.val(j)))) -#endif #undef FAD_UNARYOP_MACRO diff --git a/packages/stokhos/src/sacado/kokkos/vector/linalg/Kokkos_CrsMatrix_MP_Vector.hpp b/packages/stokhos/src/sacado/kokkos/vector/linalg/Kokkos_CrsMatrix_MP_Vector.hpp index b17aee8e62a7..1d2d365556ec 100644 --- a/packages/stokhos/src/sacado/kokkos/vector/linalg/Kokkos_CrsMatrix_MP_Vector.hpp +++ b/packages/stokhos/src/sacado/kokkos/vector/linalg/Kokkos_CrsMatrix_MP_Vector.hpp @@ -42,6 +42,8 @@ #ifndef KOKKOS_CRSMATRIX_MP_VECTOR_HPP #define KOKKOS_CRSMATRIX_MP_VECTOR_HPP +#include + #include "Sacado_MP_Vector.hpp" #include "Kokkos_View_MP_Vector.hpp" #include "KokkosSparse_CrsMatrix.hpp" @@ -60,21 +62,14 @@ namespace { // (anonymous) -// Work-around for CWG 1558. See -// https://en.cppreference.com/w/cpp/types/void_t -template struct make_void { typedef void type; }; -template -using replace_me_with_void_t_in_cxx17 = - typename make_void::type; - -template > +template > struct const_type_impl { using type = T; }; template struct const_type_impl > { + std::void_t > { using type = typename T::const_type; }; diff --git a/packages/stokhos/test/UnitTest/Stokhos_SacadoTraitsUnitTest.cpp b/packages/stokhos/test/UnitTest/Stokhos_SacadoTraitsUnitTest.cpp index 96980b7168dc..0350f8946585 100644 --- a/packages/stokhos/test/UnitTest/Stokhos_SacadoTraitsUnitTest.cpp +++ b/packages/stokhos/test/UnitTest/Stokhos_SacadoTraitsUnitTest.cpp @@ -39,6 +39,8 @@ // *********************************************************************** // @HEADER +#include + #include "Teuchos_UnitTestHarness.hpp" #include "Teuchos_TestingHelpers.hpp" #include "Teuchos_UnitTestRepository.hpp" @@ -62,7 +64,7 @@ typedef Kokkos::Serial node_type; TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( Traits, ScalarType, ad_type, scalar_type ) { const bool is_same = - Sacado::mpl::is_same< typename Sacado::ScalarType::type, scalar_type >::value; + std::is_same< typename Sacado::ScalarType::type, scalar_type >::value; TEUCHOS_TEST_EQUALITY(is_same, true, out, success); } @@ -70,7 +72,7 @@ TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( Traits, ScalarType, ad_type, scalar_type ) TEUCHOS_UNIT_TEST_TEMPLATE_2_DECL( Traits, ValueType, ad_type, value_type ) { const bool is_same = - Sacado::mpl::is_same< typename Sacado::ValueType::type, value_type >::value; + std::is_same< typename Sacado::ValueType::type, value_type >::value; TEUCHOS_TEST_EQUALITY(is_same, true, out, success); }