-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: RNG is now a planner argument, expose XORShift generation #29
Conversation
…otate bases after 1M
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.
Mostly looks good, thanks for this! Left some comments about style fixes and a few potential small correctness issues. Are all the formatting changes from the shift to Clang 18, or did you also change the clang-format
config - in which case that's missing from this PR.
float min_val; | ||
float max_val; | ||
|
||
avx_xorshift128plus_key_t key{}; | ||
using IntVector = Vector<SIMDVector<__m256i>, 1, dim>; |
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.
We should probably use a specialization of the IntVector
template defined in vector.hh
instead?
src/impl/vamp/vector/interface.hh
Outdated
constexpr float lo = -0.5F; | ||
constexpr float hi = 0.5F; | ||
const auto normalized = D(apply<S::template map_to_range<typename OtherT::S::VectorT>>(v.data)); | ||
return min_v + (normalized * (max_v - min_v)); | ||
|
||
return min_v + ((normalized - lo) / (hi - lo)) * (max_v - min_v); | ||
} |
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.
Was this broken before? We should also be using the scalar types specified by the vector interface rather than hardcoding float
.
const auto normalized = D(apply<S::template map_to_range<typename OtherT::S::VectorT>>(v.data)); | ||
return min_v + (normalized * (max_v - min_v)); | ||
|
||
return min_v + ((normalized - lo) / (hi - lo)) * (max_v - min_v); |
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.
Confused about this change - doesn't the division simplify to a denominator of 1?
All formatting changes are from updating to Clang 18. I'll take a look through the suggestions! |
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.
LGTM, thanks! Leaving the unresolved but out-of-scope comments open for later.
No description provided.