Skip to content

Commit

Permalink
fix compilation random issues
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisYaroshevskiy committed Dec 10, 2023
1 parent 66a3507 commit a543ec8
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 26 deletions.
30 changes: 18 additions & 12 deletions include/eve/detail/shuffle_v2/idxm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,7 @@ most_repeated_pattern_impl()
template<std::ptrdiff_t... I>
constexpr auto most_repeated_pattern = most_repeated_pattern_impl<std::array {I...}>();

template<auto arr>
constexpr auto most_repeated_pattern_a = most_repeated_pattern_impl<arr>();
template<auto arr> constexpr auto most_repeated_pattern_a = most_repeated_pattern_impl<arr>();

template<std::size_t target, auto idxs>
constexpr auto
Expand Down Expand Up @@ -321,7 +320,7 @@ template<std::size_t Times, std::size_t N>
constexpr std::array<std::ptrdiff_t, Times * N>
repeat(std::span<const std::ptrdiff_t, N> in)
{
std::array<std::ptrdiff_t, Times *N> res = {};
std::array<std::ptrdiff_t, Times * N> res = {};

const auto *f = in.data();
const auto *l = in.data() + in.size();
Expand Down Expand Up @@ -687,7 +686,7 @@ template<std::ptrdiff_t G, std::size_t N>
constexpr std::array<std::ptrdiff_t, N * G>
expand_group(std::span<const std::ptrdiff_t, N> idxs)
{
std::array<std::ptrdiff_t, N *G> res = {};
std::array<std::ptrdiff_t, N * G> res = {};

std::ptrdiff_t *o = res.data();

Expand Down Expand Up @@ -876,16 +875,20 @@ template<std::size_t G, std::size_t N>
constexpr auto
put_bigger_groups_in_position(std::span<const std::ptrdiff_t, N> idxs)
{
constexpr std::size_t group_count = (G == 0 || G >= N) ? 1 : N / G;
if constexpr( G == 0 || G > N )
{
return std::optional<
kumi::tuple<std::array<std::ptrdiff_t, 1>, std::array<std::ptrdiff_t, N>>> {};
}
else
{
constexpr std::size_t group_count = (G == 0 || G >= N) ? 1 : N / G;

using group_pattern_t = std::array<std::ptrdiff_t, group_count>;
using withing_pattern_t = std::array<std::ptrdiff_t, N>;
using group_pattern_t = std::array<std::ptrdiff_t, group_count>;
using withing_pattern_t = std::array<std::ptrdiff_t, N>;

std::optional<kumi::tuple<group_pattern_t, withing_pattern_t>> res;
std::optional<kumi::tuple<group_pattern_t, withing_pattern_t>> res;

if constexpr( G == 0 || G > N ) { return res; }
else
{
group_pattern_t groups_pattern = {};
withing_pattern_t within_groups_pattern = {};

Expand Down Expand Up @@ -914,7 +917,10 @@ put_bigger_groups_in_position(std::span<const std::ptrdiff_t, N> idxs)
if( group_index < 0 )
{
groups_pattern[i] = we_;
for( std::size_t j = group_start; j != group_end; ++j ) { within_groups_pattern[j] = group_index; }
for( std::size_t j = group_start; j != group_end; ++j )
{
within_groups_pattern[j] = group_index;
}
continue;
}

Expand Down
6 changes: 6 additions & 0 deletions include/eve/forward.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,10 @@ template<relative_conditional_expr C, simd_value T> auto to_logical(C c, eve::as

template<relative_conditional_expr C, simd_value T>
auto EVE_FORCEINLINE to_logical(C c, eve::as<T>) noexcept requires(current_api >= avx512);

template<conditional_expr C, typename Op, typename Arg0, typename... Args>
EVE_FORCEINLINE auto mask_op(C const& c,
[[maybe_unused]] Op f,
[[maybe_unused]] Arg0 const& a0,
[[maybe_unused]] Args const&...as);
}
9 changes: 2 additions & 7 deletions include/eve/module/core/constant/simd/common/iota.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <eve/concept/value.hpp>
#include <eve/detail/abi.hpp>
#include <eve/forward.hpp>
#include <eve/module/core/constant/zero.hpp>

namespace eve::detail
{
Expand All @@ -23,12 +24,6 @@ iota_(EVE_REQUIRES(cpu_), eve::callable_options auto const& opts, eve::as<T> tgt

if constexpr( C::is_complete && C::is_inverted ) return T {[](int i, int) { return i; }};
else if constexpr( !C::has_alternative ) return iota[cx.else_(eve::zero(tgt))](tgt);
else if constexpr( C::is_complete && !C::is_inverted ) return T {cx.alternative};
else
{
T x = iota(tgt);
if constexpr( !C::is_complete ) x = eve::if_else(cx, x, cx.alternative);
return x;
}
else return mask_op(cx, iota, tgt);
}
}
2 changes: 1 addition & 1 deletion include/eve/module/core/regular/impl/bit_flip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace eve::detail
EVE_FORCEINLINE T
bit_flip_(EVE_SUPPORTS(cpu_), T a, I i) noexcept
{
[[maybe_unused]] constexpr size_t S8 = sizeof(element_type_t<T>)*8;
[[maybe_unused]] constexpr std::ptrdiff_t S8 = sizeof(element_type_t<T>)*8;
EVE_ASSERT(eve::all(i >= 0 && i < S8), "some index elements are out or range");
return bit_xor(a, bit_shl(one(as(a)), i));
}
Expand Down
2 changes: 1 addition & 1 deletion include/eve/module/core/regular/impl/bit_set.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace eve::detail
EVE_FORCEINLINE T
bit_set_(EVE_SUPPORTS(cpu_), T a, I i) noexcept
{
[[maybe_unused]] constexpr size_t S8 = sizeof(element_type_t<T>)*8;
[[maybe_unused]] constexpr std::ptrdiff_t S8 = sizeof(element_type_t<T>)*8;
EVE_ASSERT(eve::all(i >= 0 && i < S8), "indexis out or range");
return bit_or(a, bit_shl(one(as(a)), i));
}
Expand Down
2 changes: 1 addition & 1 deletion include/eve/module/core/regular/impl/bit_swap_pairs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace eve::detail
EVE_FORCEINLINE T
bit_swap_pairs_(EVE_SUPPORTS(cpu_), T a, I0 i0, I1 i1) noexcept
{
[[maybe_unused]] constexpr size_t S8 = sizeof(element_type_t<T>)*8;
[[maybe_unused]] constexpr std::ptrdiff_t S8 = sizeof(element_type_t<T>)*8;
EVE_ASSERT(eve::all(i0 < S8 && i1 < S8), "some indexes are out or range");
auto x = bit_and(bit_xor(bit_shr(a, i0), bit_shr(a, i1)), one(as(a)));
a ^= bit_shl(x, i1);
Expand Down
2 changes: 1 addition & 1 deletion include/eve/module/core/regular/impl/bit_unset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace eve::detail
EVE_FORCEINLINE T
bit_unset_(EVE_SUPPORTS(cpu_), T a, I i) noexcept
{
[[maybe_unused]] constexpr size_t S8 = sizeof(element_type_t<T>)*8;
[[maybe_unused]] constexpr std::ptrdiff_t S8 = sizeof(element_type_t<T>)*8;
EVE_ASSERT(eve::all(i >= 0 && i < S8), "some index elements are out or range");
return bit_andnot(a, bit_shl(one(as(a)), i));
}
Expand Down
1 change: 0 additions & 1 deletion include/eve/traits/overload/default_behaviors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include <eve/concept/value.hpp>
#include <eve/detail/skeleton.hpp>
#include <eve/detail/function/conditional.hpp>

namespace eve
{
Expand Down
2 changes: 1 addition & 1 deletion test/doc/core/regular/bit_reverse.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <eve/wide.hpp>
#include <eve/module/core.hpp>
#include <iostream>
#include <bit>

Expand Down
2 changes: 1 addition & 1 deletion test/doc/core/regular/byte_reverse.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <eve/wide.hpp>
#include <eve/module/core.hpp>
#include <iostream>

using wide_it = eve::wide<std::uint32_t, eve::fixed<4>>;
Expand Down

0 comments on commit a543ec8

Please sign in to comment.