Skip to content

Commit 2d24a9c

Browse files
use 64 bit math for initial offset calculation
1 parent e22e345 commit 2d24a9c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ggml/src/ggml-cuda/mmv.cu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ static __global__ void mul_mat_vec(
1919

2020
constexpr int warp_size = ggml_cuda_get_physical_warp_size();
2121

22-
x += sample_x *stride_sample_x + channel_x *stride_channel_x + row*stride_row;
23-
y += sample_y *stride_sample_y + channel_y *stride_channel_y;
24-
dst += sample_dst*stride_sample_dst + channel_dst*stride_channel_dst;
22+
x += int64_t(sample_x) *stride_sample_x + channel_x *stride_channel_x + row*stride_row;
23+
y += int64_t(sample_y) *stride_sample_y + channel_y *stride_channel_y;
24+
dst += int64_t(sample_dst)*stride_sample_dst + channel_dst*stride_channel_dst;
2525

2626
const float2 * y2 = (const float2 *) y;
2727

0 commit comments

Comments
 (0)