#include #include #include #include #if THRUST_CPP_DIALECT >= 2014 THRUST_STATIC_ASSERT((thrust::is_operator_less_function_object< std::less<> >::value)); THRUST_STATIC_ASSERT((thrust::is_operator_greater_function_object< std::greater<> >::value)); THRUST_STATIC_ASSERT((thrust::is_operator_less_or_greater_function_object< std::less<> >::value)); THRUST_STATIC_ASSERT((thrust::is_operator_less_or_greater_function_object< std::greater<> >::value)); THRUST_STATIC_ASSERT((thrust::is_operator_plus_function_object< std::plus<> >::value)); #endif template __host__ void test_is_operator_less_function_object() { THRUST_STATIC_ASSERT((thrust::is_operator_less_function_object< thrust::less >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_less_function_object< thrust::greater >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_less_function_object< thrust::less_equal >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_less_function_object< thrust::greater_equal >::value)); THRUST_STATIC_ASSERT((thrust::is_operator_less_function_object< std::less >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_less_function_object< std::greater >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_less_function_object< std::less_equal >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_less_function_object< std::greater_equal >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_less_function_object< T >::value)); } DECLARE_GENERIC_UNITTEST(test_is_operator_less_function_object); template __host__ void test_is_operator_greater_function_object() { THRUST_STATIC_ASSERT((!thrust::is_operator_greater_function_object< thrust::less >::value)); THRUST_STATIC_ASSERT((thrust::is_operator_greater_function_object< thrust::greater >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_greater_function_object< thrust::less_equal >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_greater_function_object< thrust::greater_equal >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_greater_function_object< std::less >::value)); THRUST_STATIC_ASSERT((thrust::is_operator_greater_function_object< std::greater >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_greater_function_object< std::less_equal >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_greater_function_object< std::greater_equal >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_greater_function_object< T >::value)); } DECLARE_GENERIC_UNITTEST(test_is_operator_greater_function_object); template __host__ void test_is_operator_less_or_greater_function_object() { THRUST_STATIC_ASSERT((thrust::is_operator_less_or_greater_function_object< thrust::less >::value)); THRUST_STATIC_ASSERT((thrust::is_operator_less_or_greater_function_object< thrust::greater >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_less_or_greater_function_object< thrust::less_equal >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_less_or_greater_function_object< thrust::greater_equal >::value)); THRUST_STATIC_ASSERT((thrust::is_operator_less_or_greater_function_object< std::less >::value)); THRUST_STATIC_ASSERT((thrust::is_operator_less_or_greater_function_object< std::greater >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_less_or_greater_function_object< std::less_equal >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_less_or_greater_function_object< std::greater_equal >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_less_or_greater_function_object< T >::value)); } DECLARE_GENERIC_UNITTEST(test_is_operator_less_or_greater_function_object); template __host__ void test_is_operator_plus_function_object() { THRUST_STATIC_ASSERT((thrust::is_operator_plus_function_object< thrust::plus >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_plus_function_object< thrust::minus >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_plus_function_object< thrust::less >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_plus_function_object< thrust::greater >::value)); THRUST_STATIC_ASSERT((thrust::is_operator_plus_function_object< std::plus >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_plus_function_object< std::minus >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_plus_function_object< std::less >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_plus_function_object< std::greater >::value)); THRUST_STATIC_ASSERT((!thrust::is_operator_plus_function_object< T >::value)); } DECLARE_GENERIC_UNITTEST(test_is_operator_plus_function_object);