-
Notifications
You must be signed in to change notification settings - Fork 754
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
[SYCL] Add E2E test for -foffload-fp32-prec-div/sqrt #17037
base: sycl
Are you sure you want to change the base?
Conversation
Signed-off-by: Sidorov, Dmitry <[email protected]>
9ea9efa
to
4a5678f
Compare
Signed-off-by: Sidorov, Dmitry <[email protected]>
@intel/llvm-reviewers-runtime please take a look |
return std::fmin(negative, positive); | ||
} | ||
|
||
template <typename T> int ulp_difference(const T &lhs, const T &rhs) { |
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.
Why does it return int
?
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.
The intention was to remove ulps diff as an integer, but implicit cast was undesired here (and actually was wrong). I've simplified the function.
Signed-off-by: Sidorov, Dmitry <[email protected]>
14b1a52
to
20068a6
Compare
CUDA results: guess I first need this patch to be merged #17044 |
int32_t lhsInt = *reinterpret_cast<int32_t *>(&lhs); | ||
int32_t rhsInt = *reinterpret_cast<int32_t *>(&rhs); |
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 needs to be std::bit_cast
to avoid UB.
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.
Applied, but do we enable C++20?
#include <sycl/usm.hpp> | ||
|
||
constexpr float value = 560.0f; | ||
constexpr float divider = 280.0f; |
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 test of division is 560/280
? That has an exact solution ( 2 ) . I know the float number space is sparse, but is 560 / 280 really a test that'll result in a measurable ULP difference? Wouldn't 279 be a better divider?
Signed-off-by: Sidorov, Dmitry <[email protected]>
b5b7681
to
8cd6672
Compare
Supporting doc: #17033