-
Notifications
You must be signed in to change notification settings - Fork 801
[ESIMD][NFC] Removed unused math APIs #3968
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -303,16 +303,6 @@ esimd_lsr(T1 src0, T2 src1, int flag = saturation_off) { | |
| return Result[0]; | ||
| } | ||
|
|
||
| template <typename T0, typename T1, typename T2> | ||
| ESIMD_NODEBUG ESIMD_INLINE typename sycl::detail::enable_if_t< | ||
| detail::is_esimd_scalar<T1>::value && detail::is_esimd_vector<T2>::value && | ||
| std::is_integral<T0>::value && std::is_integral<T1>::value && | ||
| std::is_integral<T2>::value, | ||
| decltype(esimd_lsr<T0>(T2(), T1()))> | ||
| esimd_lsr(T1 src0, T2 src1, int flag = saturation_off) { | ||
| return esimd_lsr<T0>(src1, src0, flag); | ||
| } | ||
|
|
||
| // esimd_asr | ||
| template <typename T0, typename T1, int SZ, typename U> | ||
| ESIMD_NODEBUG ESIMD_INLINE | ||
|
|
@@ -346,16 +336,6 @@ esimd_asr(T1 src0, T2 src1, int flag = saturation_off) { | |
| return Result[0]; | ||
| } | ||
|
|
||
| template <typename T0, typename T1, typename T2> | ||
| ESIMD_NODEBUG ESIMD_INLINE typename sycl::detail::enable_if_t< | ||
| detail::is_esimd_scalar<T1>::value && detail::is_esimd_vector<T2>::value && | ||
| std::is_integral<T0>::value && std::is_integral<T1>::value && | ||
| std::is_integral<T2>::value, | ||
|
Contributor
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. Ditto |
||
| decltype(esimd_asr<T0>(T2(), T1()))> | ||
| esimd_asr(T1 src0, T2 src1, int flag = saturation_off) { | ||
| return esimd_asr<T0>(src1, src0, flag); | ||
| } | ||
|
|
||
| // esimd_imul | ||
| #ifndef ESIMD_HAS_LONG_LONG | ||
| // use mulh instruction for high half | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 looks like a bug. It should be std::is_integral<T2::element_type>::value
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 can't understand the value of this overload. Looks like it is an alias for the first version, where we have the first argument a vector, and the second argument a scalar. Here we just swap the order of arguments but to me, it really seems confusing. Unless I'm missing something.
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 this was ported to match existing CM math function. IIRC there was customer request to add this convenience API so that when the parameters are specified in different order we will swap it transparently and it's still expected to work.
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.
Still looks confusing :)
esimd_lsr(scalar, vector)will actually dovector >> scalar. I don't see much value in this API. Readers of the code will probably get confused over the order of arguments.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 see your confusion. This was added per previous customer request for programming convenience. I'm fine with removing it if it's confusing for ESIMD user. This could be done in kernel or utility file. I don't view it as a blocking issue.