-
Notifications
You must be signed in to change notification settings - Fork 130
[SYCL]Update tests for half operator #1012
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 |
|---|---|---|
|
|
@@ -146,7 +146,7 @@ template <typename T> void exit_if_not_equal(T *val, T *ref, const char *name) { | |
| template <> void exit_if_not_equal(half val, half ref, const char *name) { | ||
| int16_t cmp_val = reinterpret_cast<int16_t &>(val); | ||
| int16_t cmp_ref = reinterpret_cast<int16_t &>(ref); | ||
| if (std::abs(cmp_val - cmp_ref) > 1) { | ||
| if (std::abs(cmp_val - cmp_ref) > 2) { | ||
|
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. Do you know why we need this at all? Other fp types seem to be checked for exact equality (line 112).
Author
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 compares the results on the host vs device. The host does not have support for |
||
| std::cout << "Unexpected result for " << name << ": " << (float)val | ||
| << " expected value: " << (float)ref << std::endl; | ||
| exit(1); | ||
|
|
||
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.
I wonder if we can use something like this (not sure about the proper spelling)
to eliminate the changes below.
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.
I think using
esimd::simd<T, N>in the code below is clearer compared to introducingsimdalias.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.
I agree with @kbobrovs I think
esimd::simd<T, N>is more clear.