Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Macros
Stokhos_SacadoMPVectorUnitTest.cpp File Reference
#include "Teuchos_UnitTestHarness.hpp"
#include "Teuchos_TestingHelpers.hpp"
#include "Teuchos_UnitTestRepository.hpp"
#include "Teuchos_GlobalMPISession.hpp"
#include "Stokhos_Sacado_Kokkos_MP_Vector.hpp"
#include "Stokhos_UnitTestHelpers.hpp"
#include "Kokkos_Core.hpp"
#include "Kokkos_Complex.hpp"
Include dependency graph for Stokhos_SacadoMPVectorUnitTest.cpp:

Go to the source code of this file.

Classes

struct  UnitTestSetup< VecType, FadType >
 

Namespaces

 DynamicVecTest
 
 DynamicStridedVecTest
 
 StaticVecTest
 
 StaticFixedVecTest
 
 StaticFixedVecTest::Double
 
 StaticFixedVecTest::Complex_std
 
 StaticFixedVecTest::Complex_Kokkos
 

Macros

#define UNARY_UNIT_TEST(VEC, SCALAR_T, OP, OPNAME, USING_OP)
 
#define BINARY_UNIT_TEST(VEC, SCALAR_T, OP, OPNAME)
 
#define BINARYFUNC_UNIT_TEST(VEC, SCALAR_T, OP, SOP, USING_SOP, OPNAME)
 
#define OPASSIGN_UNIT_TEST(VEC, SCALAR_T, OP, OPNAME)
 
#define SAXPY_UNIT_TEST(VEC, SCALAR_T)
 
#define TERNARY_UNIT_TEST(VEC, SCALAR_T)
 
#define VECTOR_UNIT_TESTS_ANY_TYPE(VEC, SCALAR_T)
 
#define VECTOR_UNIT_TESTS_SFS_ANY_VALUE_TYPE(SCALAR_T)
 
#define VECTOR_UNIT_TESTS_COMPLEX_TYPE(VEC, SCALAR_T)
 
#define VECTOR_UNIT_TESTS_REAL_TYPE(VEC, SCALAR_T)
 
#define TEST_DYNAMIC_STORAGE(__storage_type__, __vec_type__, __scalar_type__, __macro_for_tests__)
 
#define TEST_STATIC_STORAGE(__storage_type__, __vec_type__, __scalar_type__, __scalar_type_name__, __storage_size__, __macro_for_tests__)
 
#define TEST_STATIC_FIXED_STORAGE(__storage_type__, __vec_type__, __scalar_type__, __scalar_type_name__, __storage_size__, __macro_for_tests__)
 

Macro Definition Documentation

#define UNARY_UNIT_TEST (   VEC,
  SCALAR_T,
  OP,
  OPNAME,
  USING_OP 
)

Common series of test for any unary operator.

Definition at line 65 of file Stokhos_SacadoMPVectorUnitTest.cpp.

#define BINARY_UNIT_TEST (   VEC,
  SCALAR_T,
  OP,
  OPNAME 
)

Definition at line 104 of file Stokhos_SacadoMPVectorUnitTest.cpp.

#define BINARYFUNC_UNIT_TEST (   VEC,
  SCALAR_T,
  OP,
  SOP,
  USING_SOP,
  OPNAME 
)

Definition at line 198 of file Stokhos_SacadoMPVectorUnitTest.cpp.

#define OPASSIGN_UNIT_TEST (   VEC,
  SCALAR_T,
  OP,
  OPNAME 
)

Definition at line 320 of file Stokhos_SacadoMPVectorUnitTest.cpp.

#define SAXPY_UNIT_TEST (   VEC,
  SCALAR_T 
)

Definition at line 364 of file Stokhos_SacadoMPVectorUnitTest.cpp.

#define TERNARY_UNIT_TEST (   VEC,
  SCALAR_T 
)
Value:
TEUCHOS_UNIT_TEST( VEC##_##SCALAR_T, ternay) { \
UTS::vec_type u = std::sin(setup.x); \
UTS::vec_type v = -std::sin(setup.x); \
u = u >= 0 ? -u : u; \
success = compareVecs(u, "u", v, "v", \
setup.rtol, setup.atol, out); \
}
bool compareVecs(const VectorType1 &a1, const std::string &a1_name, const VectorType2 &a2, const std::string &a2_name, const ValueType &rel_tol, const ValueType &abs_tol, Teuchos::FancyOStream &out)
UnitTestSetup< pce_type > UTS
KOKKOS_INLINE_FUNCTION PCE< Storage > sin(const PCE< Storage > &a)
Sacado::MP::Vector< storage_type > vec_type
TEUCHOS_UNIT_TEST(tAdaptivityManager, test_interface)

Definition at line 410 of file Stokhos_SacadoMPVectorUnitTest.cpp.

#define VECTOR_UNIT_TESTS_ANY_TYPE (   VEC,
  SCALAR_T 
)

Default series of tests to perform for any type. The set of operators should make sense for both real and complex types.

Definition at line 424 of file Stokhos_SacadoMPVectorUnitTest.cpp.

#define VECTOR_UNIT_TESTS_SFS_ANY_VALUE_TYPE (   SCALAR_T)
Value:
TEUCHOS_UNIT_TEST( StaticFixedVector##_##SCALAR_T, initializer_list_constructor_partial ) {\
UTS::vec_type u{ 1.0}; \
UTS::vec_type v(setup.sz, 1.0); \
success = compareVecs(u, "u", v, "v", \
setup.rtol, setup.atol, out); \
} \
TEUCHOS_UNIT_TEST( StaticFixedVector##_##SCALAR_T, initializer_list_constructor_empty ) { \
UTS::vec_type u{ std::initializer_list<typename UTS::value_type>()}; \
UTS::vec_type v(setup.sz, 0.0); \
success = compareVecs(u, "u", v, "v", \
setup.rtol, setup.atol, out); \
}
bool compareVecs(const VectorType1 &a1, const std::string &a1_name, const VectorType2 &a2, const std::string &a2_name, const ValueType &rel_tol, const ValueType &abs_tol, Teuchos::FancyOStream &out)
UnitTestSetup< pce_type > UTS
Sacado::MP::Vector< storage_type > vec_type
TEUCHOS_UNIT_TEST(tAdaptivityManager, test_interface)

Default series of tests to perform for SFS for any value type.

Definition at line 498 of file Stokhos_SacadoMPVectorUnitTest.cpp.

#define VECTOR_UNIT_TESTS_COMPLEX_TYPE (   VEC,
  SCALAR_T 
)
Value:
/* Run the series of tests for any type. */ \
#define VECTOR_UNIT_TESTS_ANY_TYPE(VEC, SCALAR_T)

Series of tests to run for complex type. It will run the series of tests for any type.

Definition at line 517 of file Stokhos_SacadoMPVectorUnitTest.cpp.

#define VECTOR_UNIT_TESTS_REAL_TYPE (   VEC,
  SCALAR_T 
)
Value:
/* Run the series of tests for any type. */ \
/* Operator cbrt not supported for complex type but supported for real type. */ \
UNARY_UNIT_TEST(VEC, SCALAR_T, cbrt , Cbrt, using std::cbrt;) \
/* Operator atan2 not supported for complex type but supported for real type. */ \
BINARYFUNC_UNIT_TEST(VEC, SCALAR_T, atan2, atan2, using std::atan2;, ATan2) \
/* Operators min and max are not supported for complex type. */ \
BINARYFUNC_UNIT_TEST(VEC, SCALAR_T, max , max , using std::max ;, Max) \
BINARYFUNC_UNIT_TEST(VEC, SCALAR_T, min , min , using std::min ;, Min) \
/* Operators fmin and fmax are not supported for complex type. */ \
BINARYFUNC_UNIT_TEST(VEC, SCALAR_T, fmax , fmax , using std::fmax ;, FMax) \
BINARYFUNC_UNIT_TEST(VEC, SCALAR_T, fmin , fmin , using std::fmin ;, FMin) \
/* Ternary test uses 'operator<' that is not defined for complex type. */ \
TERNARY_UNIT_TEST(VEC, SCALAR_T)
KOKKOS_INLINE_FUNCTION PCE< Storage > cbrt(const PCE< Storage > &a)
atan2(expr1.val(), expr2.val())
KOKKOS_INLINE_FUNCTION PCE< Storage > min(const typename PCE< Storage >::value_type &a, const PCE< Storage > &b)
KOKKOS_INLINE_FUNCTION PCE< Storage > max(const typename PCE< Storage >::value_type &a, const PCE< Storage > &b)
#define BINARYFUNC_UNIT_TEST(VEC, SCALAR_T, OP, SOP, USING_SOP, OPNAME)
#define UNARY_UNIT_TEST(VEC, SCALAR_T, OP, OPNAME, USING_OP)
#define TERNARY_UNIT_TEST(VEC, SCALAR_T)
#define VECTOR_UNIT_TESTS_ANY_TYPE(VEC, SCALAR_T)

Series of tests to run for real type. It will run the series of tests for any type, as well as tests that don't work or don't make sense for complex type.

Definition at line 526 of file Stokhos_SacadoMPVectorUnitTest.cpp.

#define TEST_DYNAMIC_STORAGE (   __storage_type__,
  __vec_type__,
  __scalar_type__,
  __macro_for_tests__ 
)
Value:
typedef Kokkos::DefaultExecutionSpace execution_space; \
typedef Stokhos::__storage_type__<int,__scalar_type__,execution_space> storage_type; \
__macro_for_tests__(__vec_type__,__scalar_type__)
Stokhos::StandardStorage< int, double > storage_type
Kokkos::DefaultExecutionSpace execution_space
UnitTestSetup< pce_type > UTS
Sacado::MP::Vector< storage_type > vec_type

Common test structure for dynamic storage.

Definition at line 545 of file Stokhos_SacadoMPVectorUnitTest.cpp.

#define TEST_STATIC_STORAGE (   __storage_type__,
  __vec_type__,
  __scalar_type__,
  __scalar_type_name__,
  __storage_size__,
  __macro_for_tests__ 
)
Value:
typedef ::Kokkos::DefaultExecutionSpace execution_space; \
typedef ::Stokhos::__storage_type__<int,__scalar_type__,__storage_size__,execution_space> storage_type; \
typedef ::Sacado::MP::Vector<storage_type> vec_type; \
__macro_for_tests__(__vec_type__,__scalar_type_name__)
Stokhos::StandardStorage< int, double > storage_type
Kokkos::DefaultExecutionSpace execution_space
UnitTestSetup< pce_type > UTS
Sacado::MP::Vector< storage_type > vec_type

Common test structure for static storage.

Definition at line 565 of file Stokhos_SacadoMPVectorUnitTest.cpp.

#define TEST_STATIC_FIXED_STORAGE (   __storage_type__,
  __vec_type__,
  __scalar_type__,
  __scalar_type_name__,
  __storage_size__,
  __macro_for_tests__ 
)
Value:
TEST_STATIC_STORAGE(__storage_type__,__vec_type__,__scalar_type__,__scalar_type_name__,__storage_size__,__macro_for_tests__) \
#define TEST_STATIC_STORAGE(__storage_type__, __vec_type__, __scalar_type__, __scalar_type_name__, __storage_size__, __macro_for_tests__)
#define VECTOR_UNIT_TESTS_SFS_ANY_VALUE_TYPE(SCALAR_T)

Common test structure for static fixed storage.

Definition at line 580 of file Stokhos_SacadoMPVectorUnitTest.cpp.