-
Notifications
You must be signed in to change notification settings - Fork 39
Adds row stride support to offset calculation methods #22
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
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -36,14 +36,14 @@ struct BlockInfo { | |||||
| } | ||||||
|
|
||||||
| template <typename index_t> | ||||||
| __forceinline__ __device__ index_t zoh_offset(const index_t batch_stride, const int bidb | ||||||
| __forceinline__ __device__ index_t zoh_offset(const index_t batch_stride, const int row_stride, const int bidb | ||||||
| ) const { | ||||||
| return bidb * batch_stride; | ||||||
| return sum_s_q == -1 ? bidb * batch_stride : uint32_t(sum_s_q) * row_stride; | ||||||
|
||||||
| } | ||||||
|
|
||||||
| template <typename index_t> | ||||||
| __forceinline__ __device__ index_t active_mask_offset(const index_t batch_stride, const int bidb) const { | ||||||
| return bidb * batch_stride; | ||||||
| __forceinline__ __device__ index_t active_mask_offset(const index_t batch_stride, int row_stride, const int bidb) const { | ||||||
|
||||||
| __forceinline__ __device__ index_t active_mask_offset(const index_t batch_stride, int row_stride, const int bidb) const { | |
| __forceinline__ __device__ index_t active_mask_offset(const index_t batch_stride, const int row_stride, const int bidb) const { |
Copilot
AI
Jun 23, 2025
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 logic in zoh_offset and active_mask_offset is identical; consider extracting the conditional expression into a shared helper to reduce duplication.
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
row_strideparameter is declared asintwhilebatch_strideusesindex_t; consider makingrow_strideanindex_tas well to maintain consistency and avoid implicit narrowing or overflow.