-
Notifications
You must be signed in to change notification settings - Fork 208
[FEA] Matrix shift rows and columns #2634
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
Conversation
cpp/include/raft/matrix/shift.cuh
Outdated
* @param[in] shift_type: ShiftType::ROW shifts rows and ShiftType::COL shift columns | ||
*/ | ||
template <typename math_t, typename matrix_idx_t> | ||
void shift_self(raft::resources const& handle, |
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.
Can we incorporate this as a specialized input into the prior functions so that we can avoid having a separate function just for this? Every template function we expose becomes another compiled kernel into the user's binary. The more we can consolidate, the better.
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.
val is now a nullopt. If not specified, we fill with row ids and column ids.
/ok to test |
/ok to test be95a4a |
/ok to test 7f12f71 |
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!
/merge |
/ok to test 3c52fba |
1 similar comment
/ok to test 3c52fba |
Implementation for in-place row or column shifting for matrices.
Supports the following shift-then-fill
Has the following options
ShiftDirection
: can shift towards the beginning (left for columns, top for rows) or the end (right for columns, bottom for rows).ShiftType
: either row or columnCurrently needed for the case where we need to add a self loop in a knn graph.