Skip to content

Commit 8ddcc34

Browse files
committed
Removes col_stride parameter from offset methods
Simplifies mask_offset and bias_offset method signatures by removing the unused col_stride parameter and eliminating col_stride multiplication in offset calculations. The leftpad_k value is now added directly to the offset instead of being multiplied by col_stride, streamlining the computation logic.
1 parent 1c76b31 commit 8ddcc34

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

csrc/src/block_info.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ struct BlockInfo {
3636
}
3737

3838
template <typename index_t>
39-
__forceinline__ __device__ index_t mask_offset(const index_t batch_stride, const index_t row_stride, const index_t col_stride, const int bidb) const {
39+
__forceinline__ __device__ index_t mask_offset(const index_t batch_stride, const index_t row_stride, const int bidb) const {
4040
index_t offset = sum_s_q == -1 ? bidb * batch_stride : uint32_t(sum_s_q) * row_stride;
41-
sum_s_k == -1 ? offset += leftpad_k * col_stride : offset += uint32_t(sum_s_k + leftpad_k) * col_stride;
41+
sum_s_k == -1 ? offset += leftpad_k : offset += uint32_t(sum_s_k + leftpad_k);
4242
return offset;
4343
}
4444

4545
template <typename index_t>
46-
__forceinline__ __device__ index_t bias_offset(const index_t batch_stride, const index_t row_stride, const index_t col_stride, const int bidb) const {
46+
__forceinline__ __device__ index_t bias_offset(const index_t batch_stride, const index_t row_stride, const int bidb) const {
4747
index_t offset = sum_s_q == -1 ? bidb * batch_stride : uint32_t(sum_s_q) * row_stride;
48-
sum_s_k == -1 ? offset += leftpad_k * col_stride : offset += uint32_t(sum_s_k + leftpad_k) * col_stride;
48+
sum_s_k == -1 ? offset += leftpad_k : offset += uint32_t(sum_s_k + leftpad_k);
4949
return offset;
5050
}
5151

0 commit comments

Comments
 (0)