Rename 'vec_all_nan' of cxx11_tensor_expr test because this symbol is used by altivec.h

This commit is contained in:
Maxiwell S. Garcia 2021-09-01 08:32:49 -05:00 committed by Rasmus Munk Larsen
parent 3a6296d4f1
commit 09fc0f97b5

View File

@ -305,10 +305,10 @@ void test_minmax_nan_propagation_templ() {
const Scalar kNaN = std::numeric_limits<Scalar>::quiet_NaN(); const Scalar kNaN = std::numeric_limits<Scalar>::quiet_NaN();
const Scalar kInf = std::numeric_limits<Scalar>::infinity(); const Scalar kInf = std::numeric_limits<Scalar>::infinity();
const Scalar kZero(0); const Scalar kZero(0);
Tensor<Scalar, 1> vec_all_nan(size); Tensor<Scalar, 1> vec_full_nan(size);
Tensor<Scalar, 1> vec_one_nan(size); Tensor<Scalar, 1> vec_one_nan(size);
Tensor<Scalar, 1> vec_zero(size); Tensor<Scalar, 1> vec_zero(size);
vec_all_nan.setConstant(kNaN); vec_full_nan.setConstant(kNaN);
vec_zero.setZero(); vec_zero.setZero();
vec_one_nan.setZero(); vec_one_nan.setZero();
vec_one_nan(size/2) = kNaN; vec_one_nan(size/2) = kNaN;
@ -330,12 +330,12 @@ void test_minmax_nan_propagation_templ() {
// max(nan, 0) = nan // max(nan, 0) = nan
// max(0, nan) = nan // max(0, nan) = nan
// max(0, 0) = 0 // max(0, 0) = 0
verify_all_nan(vec_all_nan.template cwiseMax<PropagateNaN>(kNaN)); verify_all_nan(vec_full_nan.template cwiseMax<PropagateNaN>(kNaN));
verify_all_nan(vec_all_nan.template cwiseMax<PropagateNaN>(vec_all_nan)); verify_all_nan(vec_full_nan.template cwiseMax<PropagateNaN>(vec_full_nan));
verify_all_nan(vec_all_nan.template cwiseMax<PropagateNaN>(kZero)); verify_all_nan(vec_full_nan.template cwiseMax<PropagateNaN>(kZero));
verify_all_nan(vec_all_nan.template cwiseMax<PropagateNaN>(vec_zero)); verify_all_nan(vec_full_nan.template cwiseMax<PropagateNaN>(vec_zero));
verify_all_nan(vec_zero.template cwiseMax<PropagateNaN>(kNaN)); verify_all_nan(vec_zero.template cwiseMax<PropagateNaN>(kNaN));
verify_all_nan(vec_zero.template cwiseMax<PropagateNaN>(vec_all_nan)); verify_all_nan(vec_zero.template cwiseMax<PropagateNaN>(vec_full_nan));
verify_all_zero(vec_zero.template cwiseMax<PropagateNaN>(kZero)); verify_all_zero(vec_zero.template cwiseMax<PropagateNaN>(kZero));
verify_all_zero(vec_zero.template cwiseMax<PropagateNaN>(vec_zero)); verify_all_zero(vec_zero.template cwiseMax<PropagateNaN>(vec_zero));
@ -344,12 +344,12 @@ void test_minmax_nan_propagation_templ() {
// max(nan, 0) = 0 // max(nan, 0) = 0
// max(0, nan) = 0 // max(0, nan) = 0
// max(0, 0) = 0 // max(0, 0) = 0
verify_all_nan(vec_all_nan.template cwiseMax<PropagateNumbers>(kNaN)); verify_all_nan(vec_full_nan.template cwiseMax<PropagateNumbers>(kNaN));
verify_all_nan(vec_all_nan.template cwiseMax<PropagateNumbers>(vec_all_nan)); verify_all_nan(vec_full_nan.template cwiseMax<PropagateNumbers>(vec_full_nan));
verify_all_zero(vec_all_nan.template cwiseMax<PropagateNumbers>(kZero)); verify_all_zero(vec_full_nan.template cwiseMax<PropagateNumbers>(kZero));
verify_all_zero(vec_all_nan.template cwiseMax<PropagateNumbers>(vec_zero)); verify_all_zero(vec_full_nan.template cwiseMax<PropagateNumbers>(vec_zero));
verify_all_zero(vec_zero.template cwiseMax<PropagateNumbers>(kNaN)); verify_all_zero(vec_zero.template cwiseMax<PropagateNumbers>(kNaN));
verify_all_zero(vec_zero.template cwiseMax<PropagateNumbers>(vec_all_nan)); verify_all_zero(vec_zero.template cwiseMax<PropagateNumbers>(vec_full_nan));
verify_all_zero(vec_zero.template cwiseMax<PropagateNumbers>(kZero)); verify_all_zero(vec_zero.template cwiseMax<PropagateNumbers>(kZero));
verify_all_zero(vec_zero.template cwiseMax<PropagateNumbers>(vec_zero)); verify_all_zero(vec_zero.template cwiseMax<PropagateNumbers>(vec_zero));
@ -358,12 +358,12 @@ void test_minmax_nan_propagation_templ() {
// min(nan, 0) = nan // min(nan, 0) = nan
// min(0, nan) = nan // min(0, nan) = nan
// min(0, 0) = 0 // min(0, 0) = 0
verify_all_nan(vec_all_nan.template cwiseMin<PropagateNaN>(kNaN)); verify_all_nan(vec_full_nan.template cwiseMin<PropagateNaN>(kNaN));
verify_all_nan(vec_all_nan.template cwiseMin<PropagateNaN>(vec_all_nan)); verify_all_nan(vec_full_nan.template cwiseMin<PropagateNaN>(vec_full_nan));
verify_all_nan(vec_all_nan.template cwiseMin<PropagateNaN>(kZero)); verify_all_nan(vec_full_nan.template cwiseMin<PropagateNaN>(kZero));
verify_all_nan(vec_all_nan.template cwiseMin<PropagateNaN>(vec_zero)); verify_all_nan(vec_full_nan.template cwiseMin<PropagateNaN>(vec_zero));
verify_all_nan(vec_zero.template cwiseMin<PropagateNaN>(kNaN)); verify_all_nan(vec_zero.template cwiseMin<PropagateNaN>(kNaN));
verify_all_nan(vec_zero.template cwiseMin<PropagateNaN>(vec_all_nan)); verify_all_nan(vec_zero.template cwiseMin<PropagateNaN>(vec_full_nan));
verify_all_zero(vec_zero.template cwiseMin<PropagateNaN>(kZero)); verify_all_zero(vec_zero.template cwiseMin<PropagateNaN>(kZero));
verify_all_zero(vec_zero.template cwiseMin<PropagateNaN>(vec_zero)); verify_all_zero(vec_zero.template cwiseMin<PropagateNaN>(vec_zero));
@ -372,12 +372,12 @@ void test_minmax_nan_propagation_templ() {
// min(nan, 0) = 0 // min(nan, 0) = 0
// min(0, nan) = 0 // min(0, nan) = 0
// min(0, 0) = 0 // min(0, 0) = 0
verify_all_nan(vec_all_nan.template cwiseMin<PropagateNumbers>(kNaN)); verify_all_nan(vec_full_nan.template cwiseMin<PropagateNumbers>(kNaN));
verify_all_nan(vec_all_nan.template cwiseMin<PropagateNumbers>(vec_all_nan)); verify_all_nan(vec_full_nan.template cwiseMin<PropagateNumbers>(vec_full_nan));
verify_all_zero(vec_all_nan.template cwiseMin<PropagateNumbers>(kZero)); verify_all_zero(vec_full_nan.template cwiseMin<PropagateNumbers>(kZero));
verify_all_zero(vec_all_nan.template cwiseMin<PropagateNumbers>(vec_zero)); verify_all_zero(vec_full_nan.template cwiseMin<PropagateNumbers>(vec_zero));
verify_all_zero(vec_zero.template cwiseMin<PropagateNumbers>(kNaN)); verify_all_zero(vec_zero.template cwiseMin<PropagateNumbers>(kNaN));
verify_all_zero(vec_zero.template cwiseMin<PropagateNumbers>(vec_all_nan)); verify_all_zero(vec_zero.template cwiseMin<PropagateNumbers>(vec_full_nan));
verify_all_zero(vec_zero.template cwiseMin<PropagateNumbers>(kZero)); verify_all_zero(vec_zero.template cwiseMin<PropagateNumbers>(kZero));
verify_all_zero(vec_zero.template cwiseMin<PropagateNumbers>(vec_zero)); verify_all_zero(vec_zero.template cwiseMin<PropagateNumbers>(vec_zero));
@ -397,13 +397,13 @@ void test_minmax_nan_propagation_templ() {
VERIFY_IS_EQUAL(val(), kZero); VERIFY_IS_EQUAL(val(), kZero);
// Test NaN propagation for tensor of all NaNs. // Test NaN propagation for tensor of all NaNs.
val = vec_all_nan.template minimum<PropagateNaN>(); val = vec_full_nan.template minimum<PropagateNaN>();
VERIFY((numext::isnan)(val())); VERIFY((numext::isnan)(val()));
val = vec_all_nan.template minimum<PropagateNumbers>(); val = vec_full_nan.template minimum<PropagateNumbers>();
VERIFY_IS_EQUAL(val(), kInf); VERIFY_IS_EQUAL(val(), kInf);
val = vec_all_nan.template maximum<PropagateNaN>(); val = vec_full_nan.template maximum<PropagateNaN>();
VERIFY((numext::isnan)(val())); VERIFY((numext::isnan)(val()));
val = vec_all_nan.template maximum<PropagateNumbers>(); val = vec_full_nan.template maximum<PropagateNumbers>();
VERIFY_IS_EQUAL(val(), -kInf); VERIFY_IS_EQUAL(val(), -kInf);
// Test NaN propagation for tensor with a single NaN. // Test NaN propagation for tensor with a single NaN.