Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions test/test_rounding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ struct rounding_test
std::transform(input.cbegin(), input.cend(), expected.begin(),
[](const value_type& v)
{ return std::ceil(v); });
for (size_t i = 0; i < nb_batches; i += size)
for (size_t i = 0; i < nb_batches; i++)
{
batch_type in, out, ref;
detail::load_batch(in, input, i);
detail::load_batch(in, input, i * size);
out = ceil(in);
detail::load_batch(ref, expected, i);
detail::load_batch(ref, expected, i * size);
INFO("ceil");
CHECK_BATCH_EQ(ref, out);
}
Expand All @@ -71,12 +71,12 @@ struct rounding_test
std::transform(input.cbegin(), input.cend(), expected.begin(),
[](const value_type& v)
{ return std::floor(v); });
for (size_t i = 0; i < nb_batches; i += size)
for (size_t i = 0; i < nb_batches; i++)
{
batch_type in, out, ref;
detail::load_batch(in, input, i);
detail::load_batch(in, input, i * size);
out = floor(in);
detail::load_batch(ref, expected, i);
detail::load_batch(ref, expected, i * size);
INFO("floor");
CHECK_BATCH_EQ(ref, out);
}
Expand All @@ -86,12 +86,12 @@ struct rounding_test
std::transform(input.cbegin(), input.cend(), expected.begin(),
[](const value_type& v)
{ return std::trunc(v); });
for (size_t i = 0; i < nb_batches; i += size)
for (size_t i = 0; i < nb_batches; i++)
{
batch_type in, out, ref;
detail::load_batch(in, input, i);
detail::load_batch(in, input, i * size);
out = trunc(in);
detail::load_batch(ref, expected, i);
detail::load_batch(ref, expected, i * size);
INFO("trunc");
CHECK_BATCH_EQ(ref, out);
}
Expand All @@ -101,12 +101,12 @@ struct rounding_test
std::transform(input.cbegin(), input.cend(), expected.begin(),
[](const value_type& v)
{ return std::round(v); });
for (size_t i = 0; i < nb_batches; i += size)
for (size_t i = 0; i < nb_batches; i++)
{
batch_type in, out, ref;
detail::load_batch(in, input, i);
detail::load_batch(in, input, i * size);
out = round(in);
detail::load_batch(ref, expected, i);
detail::load_batch(ref, expected, i * size);
INFO("round");
CHECK_BATCH_EQ(ref, out);
}
Expand All @@ -116,12 +116,12 @@ struct rounding_test
std::transform(input.cbegin(), input.cend(), expected.begin(),
[](const value_type& v)
{ return std::nearbyint(v); });
for (size_t i = 0; i < nb_batches; i += size)
for (size_t i = 0; i < nb_batches; i++)
{
batch_type in, out, ref;
detail::load_batch(in, input, i);
detail::load_batch(in, input, i * size);
out = nearbyint(in);
detail::load_batch(ref, expected, i);
detail::load_batch(ref, expected, i * size);
INFO("nearbyint");
CHECK_BATCH_EQ(ref, out);
}
Expand All @@ -132,13 +132,13 @@ struct rounding_test
std::transform(input.cbegin(), input.cend(), expected.begin(),
[](const value_type& v)
{ return xsimd::nearbyint_as_int(v); });
for (size_t i = 0; i < nb_batches; i += size)
for (size_t i = 0; i < nb_batches; i++)
{
batch_type in;
int_batch_type out, ref;
detail::load_batch(in, input, i);
detail::load_batch(in, input, i * size);
out = nearbyint_as_int(in);
detail::load_batch(ref, expected, i);
detail::load_batch(ref, expected, i * size);
INFO("nearbyint_as_int");
CHECK_BATCH_EQ(ref, out);
}
Expand All @@ -148,12 +148,12 @@ struct rounding_test
std::transform(input.cbegin(), input.cend(), expected.begin(),
[](const value_type& v)
{ return std::rint(v); });
for (size_t i = 0; i < nb_batches; i += size)
for (size_t i = 0; i < nb_batches; i++)
{
batch_type in, out, ref;
detail::load_batch(in, input, i);
detail::load_batch(in, input, i * size);
out = rint(in);
detail::load_batch(ref, expected, i);
detail::load_batch(ref, expected, i * size);
INFO("rint");
CHECK_BATCH_EQ(ref, out);
}
Expand Down
Loading