Skip to content

Commit

Permalink
Fix is_data_aligned convention
Browse files Browse the repository at this point in the history
  • Loading branch information
srinivasyadav18 committed Apr 9, 2021
1 parent 9aae89b commit a2d7511
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Expand Up @@ -33,7 +33,7 @@ namespace hpx { namespace parallel { namespace util { namespace detail {
typedef typename std::iterator_traits<Iter>::value_type value_type;
return (reinterpret_cast<std::uintptr_t>(std::addressof(*it)) &
(traits::vector_pack_alignment<value_type>::value -
1)) != 0;
1)) == 0;
}
};

Expand Down Expand Up @@ -304,7 +304,7 @@ namespace hpx { namespace parallel { namespace util { namespace detail {
typename hpx::util::invoke_result<F, V1*, V2*>::type
callv(F&& f, Iter1& it1, Iter2& it2)
{
if (is_data_aligned(it1) || is_data_aligned(it2))
if (!is_data_aligned(it1) || !is_data_aligned(it2))
{
return invoke_vectorized_in2<V1, V2>::call_unaligned(
std::forward<F>(f), it1, it2);
Expand Down Expand Up @@ -452,7 +452,7 @@ namespace hpx { namespace parallel { namespace util { namespace detail {

typedef typename traits::vector_pack_type<value_type>::type V;

if (is_data_aligned(it) || is_data_aligned(dest))
if (!is_data_aligned(it) || !is_data_aligned(dest))
{
invoke_vectorized_inout1<V>::call_unaligned(
std::forward<F>(f), it, dest);
Expand All @@ -477,8 +477,8 @@ namespace hpx { namespace parallel { namespace util { namespace detail {
typedef typename traits::vector_pack_type<value1_type>::type V1;
typedef typename traits::vector_pack_type<value2_type>::type V2;

if (is_data_aligned(it1) || is_data_aligned(it2) ||
is_data_aligned(dest))
if (!is_data_aligned(it1) || !is_data_aligned(it2) ||
!is_data_aligned(dest))
{
invoke_vectorized_inout2<V1, V2>::call_unaligned(
std::forward<F>(f), it1, it2, dest);
Expand Down
Expand Up @@ -124,7 +124,7 @@ namespace hpx { namespace parallel { namespace util {
iterator_datapar_compatible<Begin>::value, Begin>::type
call(Begin first, End last, F&& f)
{
while (is_data_aligned(first) && first != last)
while (!is_data_aligned(first) && first != last)
{
datapar_loop_step<Begin>::call1(f, first);
}
Expand Down Expand Up @@ -182,8 +182,8 @@ namespace hpx { namespace parallel { namespace util {

typedef typename traits::vector_pack_type<value_type>::type V;

if (detail::is_data_aligned(it1) ||
detail::is_data_aligned(it2))
if (!detail::is_data_aligned(it1) ||
!detail::is_data_aligned(it2))
{
return std::make_pair(std::move(it1), std::move(it2));
}
Expand Down Expand Up @@ -244,7 +244,7 @@ namespace hpx { namespace parallel { namespace util {
{
std::size_t len = count;

for (/* */; detail::is_data_aligned(first) && len != 0; --len)
for (/* */; !detail::is_data_aligned(first) && len != 0; --len)
{
datapar_loop_step<InIter>::call1(f, first);
}
Expand Down
Expand Up @@ -47,7 +47,7 @@ namespace hpx { namespace parallel { namespace util {
{
std::size_t len = count;

for (/* */; is_data_aligned(first) && len != 0; --len)
for (/* */; !is_data_aligned(first) && len != 0; --len)
{
datapar_transform_loop_step::call1(f, first, dest);
}
Expand Down Expand Up @@ -174,7 +174,7 @@ namespace hpx { namespace parallel { namespace util {
{
std::size_t len = count;

for (/* */; is_data_aligned(first1) && len != 0; --len)
for (/* */; !is_data_aligned(first1) && len != 0; --len)
{
datapar_transform_loop_step::call1(f, first1, first2, dest);
}
Expand Down

0 comments on commit a2d7511

Please sign in to comment.