Skip to content

Commit

Permalink
Fix apple clang build
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisYaroshevskiy committed Dec 10, 2022
1 parent 389cab6 commit 6577b4d
Show file tree
Hide file tree
Showing 14 changed files with 47 additions and 43 deletions.
9 changes: 0 additions & 9 deletions include/eve/algo/concepts/detail.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@ namespace eve::algo::detail
{ std::declval<T>() <=> std::declval<U>() };
};

template <typename>
struct is_fixed : std::false_type {};

template <std::ptrdiff_t N>
struct is_fixed<eve::fixed<N>> : std::true_type {};

template <typename T>
concept is_fixed_v = is_fixed<T>::value;

template <typename I>
concept iterator_operations =
std::copyable<std::remove_cvref_t<I>> &&
Expand Down
2 changes: 1 addition & 1 deletion include/eve/algo/concepts/eve_iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace eve::algo
template <typename I>
concept iterator =
requires(I) {
{ std::remove_cvref_t<I>::iterator_cardinal() } -> detail::is_fixed_v;
{ std::remove_cvref_t<I>::iterator_cardinal() } -> wide_cardinal;
typename std::remove_cvref_t<I>::value_type;
} &&
std::totally_ordered_with<I, partially_aligned_t<I>> &&
Expand Down
2 changes: 1 addition & 1 deletion include/eve/algo/container/soa_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace eve::algo
using pointer_aligned = iterator_aligned;
using const_pointer_aligned = const_iterator_aligned;

using size_type = std::size_t;
using size_type = std::uint64_t;

//==============================================================================================
//! @}
Expand Down
2 changes: 1 addition & 1 deletion include/eve/algo/views/iota.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ namespace eve::algo::views

EVE_FORCEINLINE friend T tagged_dispatch(eve::tag::read_, iota_with_step_iterator self)
{
return self.base + eve::convert(self.i * self.step, eve::as<T>{});
return self.base + (T)self.i * self.step;
}

template <typename U>
Expand Down
21 changes: 21 additions & 0 deletions include/eve/arch/cardinals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,27 @@ namespace eve
using combined_type = fixed<2>;
};

namespace detail {

template <typename>
struct is_wide_cardinal : std::false_type {};

template <std::ptrdiff_t N>
struct is_wide_cardinal<eve::fixed<N>> : std::true_type {};

} // namespace detail

//================================================================================================
//! @brief concept to determine if this is cardinal type of a wide
//!
//! @tparam T
//!
//! only true if T is instance of `eve::fixed`.
//!
//! This concept is needed to define some other concepts, unlikely to be useful on it's own.
//================================================================================================
template <typename T>
concept wide_cardinal = detail::is_wide_cardinal<T>::value;

//================================================================================================
//! @brief Cardinal type for scalar values
Expand Down
4 changes: 4 additions & 0 deletions include/eve/memory/aligned_allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include <malloc.h>
#endif

#include <iostream>

namespace eve
{
//================================================================================================
Expand Down Expand Up @@ -72,11 +74,13 @@ namespace eve

void * allocate_aligned(std::size_t n, std::size_t a)
{
if (a < 8U) a = 8U;
auto sz = align(n, over{a});

#if defined(SPY_COMPILER_IS_MSVC)
return _aligned_malloc(sz,a);
#else

return std::aligned_alloc(a, sz);
#endif
}
Expand Down
4 changes: 2 additions & 2 deletions include/eve/module/bessel/detail/evaluate_rational.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ evaluate_rational(const T num, const U den, V z) noexcept
z = rec(z);
auto r = horner(z, num) / horner(z, den);
if( size(den) == size(num) ) return r;
else return r * pow(z, size(num) - size(den));
else return r * pow(z, (std::uint64_t) size(num) - size(den));
};
auto test = z <= V(1);
if( eve::all(test) ) return eval_small(z);
Expand All @@ -42,7 +42,7 @@ reverse_evaluate_rational(const T num, const U den, V z) noexcept
z = rec(z);
auto r = reverse_horner(z, num) / reverse_horner(z, den);
if( size(den) == size(num) ) return r;
else return r * pow(z, size(num) - size(den));
else return r * pow(z, (std::uint64_t) size(num) - size(den));
};
auto test = z <= V(1);
if( eve::all(test) ) return eval_small(z);
Expand Down
2 changes: 1 addition & 1 deletion include/eve/traits/value_type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ namespace eve
//================================================================================================

template <typename T>
requires (!value<T>)
requires (!value<T> && !wide_cardinal<T>)
using value_type_t = typename decltype(detail::value_type_impl<T>())::type;
}
4 changes: 0 additions & 4 deletions test/unit/meta/concepts/logical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ TTS_CASE("Check for logical_scalar/simd_value on cstdint/def types" )
TTS_EXPECT( eve::logical_scalar_value<eve::logical<std::uint16_t>> );
TTS_EXPECT( eve::logical_scalar_value<eve::logical<std::uint32_t>> );
TTS_EXPECT( eve::logical_scalar_value<eve::logical<std::uint64_t>> );
TTS_EXPECT( eve::logical_scalar_value<eve::logical<std::size_t>> );
TTS_EXPECT( eve::logical_scalar_value<eve::logical<std::ptrdiff_t> >);

TTS_EXPECT( eve::logical_simd_value<eve::logical<eve::wide<std::int8_t>>> );
TTS_EXPECT( eve::logical_simd_value<eve::logical<eve::wide<std::int16_t>>> );
Expand All @@ -50,8 +48,6 @@ TTS_CASE("Check for logical_scalar/simd_value on cstdint/def types" )
TTS_EXPECT( eve::logical_simd_value<eve::logical<eve::wide<std::uint16_t>>> );
TTS_EXPECT( eve::logical_simd_value<eve::logical<eve::wide<std::uint32_t>>> );
TTS_EXPECT( eve::logical_simd_value<eve::logical<eve::wide<std::uint64_t>>> );
TTS_EXPECT( eve::logical_simd_value<eve::logical<eve::wide<std::size_t>>> );
TTS_EXPECT( eve::logical_simd_value<eve::logical<eve::wide<std::ptrdiff_t>>>);
};

TTS_CASE("Check for logical_scalar/simd_value on unsupported types" )
Expand Down
5 changes: 0 additions & 5 deletions test/unit/meta/concepts/scalar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ TTS_CASE("Check for plain_scalar_value on cstdint/def types" )
TTS_EXPECT( eve::plain_scalar_value<std::uint16_t> );
TTS_EXPECT( eve::plain_scalar_value<std::uint32_t> );
TTS_EXPECT( eve::plain_scalar_value<std::uint64_t> );

TTS_EXPECT( eve::plain_scalar_value<std::size_t> );
TTS_EXPECT( eve::plain_scalar_value<std::ptrdiff_t> );
};

TTS_CASE("Check for plain_scalar_value on unsupported types" )
Expand Down Expand Up @@ -82,8 +79,6 @@ TTS_CASE("Check for arithmetic_scalar_value on plain_scalar_value" )
TTS_EXPECT( eve::arithmetic_scalar_value<std::uint16_t> );
TTS_EXPECT( eve::arithmetic_scalar_value<std::uint32_t> );
TTS_EXPECT( eve::arithmetic_scalar_value<std::uint64_t> );
TTS_EXPECT( eve::arithmetic_scalar_value<std::size_t> );
TTS_EXPECT( eve::arithmetic_scalar_value<std::ptrdiff_t> );
};

TTS_CASE("Check for arithmetic_scalar_value on product_type" )
Expand Down
6 changes: 0 additions & 6 deletions test/unit/meta/concepts/simd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ TTS_CASE("Check for plain_simd_value on cstdint/def types" )
TTS_EXPECT( eve::plain_simd_value<eve::wide<std::uint16_t>> );
TTS_EXPECT( eve::plain_simd_value<eve::wide<std::uint32_t>> );
TTS_EXPECT( eve::plain_simd_value<eve::wide<std::uint64_t>> );

TTS_EXPECT( eve::plain_simd_value<eve::wide<std::size_t>> );
TTS_EXPECT( eve::plain_simd_value<eve::wide<std::ptrdiff_t>> );
};

TTS_CASE("Check for plain_simd_value on unsupported types" )
Expand Down Expand Up @@ -88,9 +85,6 @@ TTS_CASE("Check for arithmetic_simd_value on plain_simd_value" )
TTS_EXPECT( eve::arithmetic_simd_value<eve::wide<std::uint16_t>> );
TTS_EXPECT( eve::arithmetic_simd_value<eve::wide<std::uint32_t>> );
TTS_EXPECT( eve::arithmetic_simd_value<eve::wide<std::uint64_t>> );

TTS_EXPECT( eve::arithmetic_simd_value<eve::wide<std::size_t>> );
TTS_EXPECT( eve::arithmetic_simd_value<eve::wide<std::ptrdiff_t>> );
};

TTS_CASE("Check for arithmetic_simd_value on product_type" )
Expand Down
8 changes: 4 additions & 4 deletions test/unit/module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
## Modules
add_subdirectory(core)
add_subdirectory(complex)
add_subdirectory(polynomial)
add_subdirectory(proba)

#if(EVE_USE_BOOST)
if(EVE_USE_BOOST)
add_subdirectory(bessel)
add_subdirectory(elliptic)
add_subdirectory(combinatorial)
add_subdirectory(elliptic)
add_subdirectory(math)
add_subdirectory(polynomial)
add_subdirectory(special)
#endif()
endif()
11 changes: 7 additions & 4 deletions test/unit/module/complex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
add_custom_target(unit.complex.exe )
add_dependencies(unit.exe unit.complex.exe )

if(EVE_USE_BOOST)
make_unit("unit.complex" asin.cpp )
make_unit("unit.complex" atanh.cpp )
make_unit("unit.complex" asinh.cpp )
endif()

make_unit("unit.complex" abs.cpp )
make_unit("unit.complex" acos.cpp )
make_unit("unit.complex" acosh.cpp )
Expand All @@ -22,11 +28,8 @@ make_unit("unit.complex" agd.cpp )
make_unit("unit.complex" asec.cpp )
make_unit("unit.complex" asech.cpp )
make_unit("unit.complex" asecpi.cpp )
make_unit("unit.complex" asin.cpp )
make_unit("unit.complex" asinh.cpp )
make_unit("unit.complex" asinpi.cpp )
make_unit("unit.complex" atan.cpp )
make_unit("unit.complex" atanh.cpp )
make_unit("unit.complex" atanpi.cpp )
make_unit("unit.complex" average.cpp )
make_unit("unit.complex" beta.cpp )
Expand Down Expand Up @@ -127,4 +130,4 @@ make_unit("unit.complex" tan.cpp )
make_unit("unit.complex" tanh.cpp )
make_unit("unit.complex" tanpi.cpp )
make_unit("unit.complex" tgamma.cpp )
make_unit("unit.complex" trunc.cpp )
make_unit("unit.complex" trunc.cpp )
10 changes: 5 additions & 5 deletions test/unit/module/complex/sqr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ TTS_CASE_WITH( "Check behavior of sqr on scalar"
for(auto f : a1)
{
auto z1= c_t(e, f);
TTS_ULP_EQUAL( eve::sqr(z1), z1*z1, 2.0);
TTS_ULP_EQUAL( eve::sqr(z1), z1*z1, 18.0);
}
}
};
Expand All @@ -41,8 +41,8 @@ TTS_CASE_WITH( "Check behavior of sqr on wide"
using z_t = eve::wide<eve::complex<e_t>, typename T::cardinal_type>;

z_t z{a0,a1};
TTS_ULP_EQUAL( eve::sqr(a0), a0*a0, 2.0);
TTS_ULP_EQUAL( eve::sqr(z_t{a0,a1}), z*z, 2.0);
TTS_ULP_EQUAL( eve::pedantic(eve::sqr)(a0), a0*a0, 2.0);
TTS_ULP_EQUAL( eve::pedantic(eve::sqr)(z), z*z, 6.0);
TTS_ULP_EQUAL( eve::sqr(a0), a0*a0, 18.0);
TTS_ULP_EQUAL( eve::sqr(z_t{a0,a1}), z*z, 18.0);
TTS_ULP_EQUAL( eve::pedantic(eve::sqr)(a0), a0*a0, 18.0);
TTS_ULP_EQUAL( eve::pedantic(eve::sqr)(z), z*z, 18.0);
};

0 comments on commit 6577b4d

Please sign in to comment.