-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix apple clang build #1479
Fix apple clang build #1479
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,8 @@ | |
#include <malloc.h> | ||
#endif | ||
|
||
#include <iostream> | ||
|
||
namespace eve | ||
{ | ||
//================================================================================================ | ||
|
@@ -72,11 +74,13 @@ namespace eve | |
|
||
void * allocate_aligned(std::size_t n, std::size_t a) | ||
{ | ||
if (a < 8U) a = 8U; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. max. I thought about it but I figured I can not bring algorithm. Also size_t and U are different types on apple clang - I'd have to cast There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tried - because of the cast I don't want to. |
||
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 | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
|
@@ -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)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this pops up because size_t is not passing the concept. And going to pow is not working. |
||
}; | ||
auto test = z <= V(1); | ||
if( eve::all(test) ) return eval_small(z); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" ) | ||
|
@@ -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> ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I need to get more info on what Apple Clang doesn't liek about those. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So is char. But it doesn't work. If we want to support all of the weird types that are not actually the same, we have to solve it as a separate problem. |
||
TTS_EXPECT( eve::arithmetic_scalar_value<std::ptrdiff_t> ); | ||
}; | ||
|
||
TTS_CASE("Check for arithmetic_scalar_value on product_type" ) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cast is because you can't eve::convert ptrdifft