You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is the complile flag -fPIC -Wno-array-bounds -std=gnu++20 -mno-avx512f -msse4.2 -mavx2 -mfma
Here is the test code:
TEST(cos, test) {
xt::xtensor<float, 2> test_data = xt::zeros<float>({180, 4});
for (int i = 0; i < 180; i++) {
test_data(i, 0) = i * M_PI / 180;
test_data(i, 1) = i * M_PI / 180;
test_data(i, 2) = i * M_PI / 180 + M_PI;
test_data(i, 3) = i * M_PI / 180 + M_PI;
}
xt::xtensor<float, 2> cos_data = xt::cos(test_data);
for (int i = 0; i < 180; i++) {
std::cout << cos_data(i, 0) << "" << cos_data(i, 1) << "" << cos_data(i, 2) << "" << cos_data(i, 3) << std::endl;
EXPECT_NEAR(cos_data(i, 0), std::cos(i * M_PI / 180), 1e-6);
// EXPECT_NEAR(cos_data(i, 1), std::cos(i * M_PI / 180), 1e-6);// EXPECT_NEAR(cos_data(i, 2), std::cos(i * M_PI / 180 + M_PI), 1e-6);// EXPECT_NEAR(cos_data(i, 3), std::cos(i * M_PI / 180 + M_PI), 1e-6);
}
}
The text was updated successfully, but these errors were encountered:
XinyuKhan
changed the title
xt::cos funtion ruture totally wrong number in release build
xt::cos funtion ruturn totally wrong number in release build
Oct 19, 2024
More Information: There is no problem when I use gcc 11 with -ffast-math flag and gcc13 without -ffast-math. But problem is exist when I use gcc13 with -ffast-math
Version:
xtensor version: 0.25.0
xsimd version: 13.0.0
xtl version: 0.7.7
Here is the gcc info
Here is the complile flag
-fPIC -Wno-array-bounds -std=gnu++20 -mno-avx512f -msse4.2 -mavx2 -mfma
The text was updated successfully, but these errors were encountered: