-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add Sort API for Kernel Primitive API #39734
Conversation
Thanks for your contribution! |
dadda65
to
20a3ab1
Compare
|
||
// swap with monotonic_type | ||
template <typename T> | ||
__device__ inline void Comparator(T* first_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.
支持几类排序呢 ?升序,降序 等
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.
monotonic_type = 1 表示升序, 0 表示降序
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 for op benchmark
@@ -132,6 +132,40 @@ __device__ __forceinline__ T BlockYReduce(T val, ReduceOp reducer) { | |||
return shared_memory[threadIdx.x]; | |||
} | |||
|
|||
// Swap data | |||
template <typename T> | |||
__device__ void Swap(T* first_value, T* second_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.
可以加inline
IndexType* first_index, | ||
IndexType* second_index, | ||
int monotonic_type) { | ||
if ((first_value > second_value) == monotonic_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.
同上
PR types
Others
PR changes
Others
Describe
Add Sort API for Kernel Primitive API