Skip to content

Commit d1e09ef

Browse files
committed
Use const for ne11 and size_t variables in set_rows_sycl_q
ggml-ci
1 parent 9539e37 commit d1e09ef

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ggml/src/ggml-sycl/set_rows.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static void set_rows_sycl_q(const char * __restrict__ src0_d,
2929
const int64_t ne02,
3030
const int64_t ne03,
3131
const int64_t ne10,
32-
int64_t ne11,
32+
const int64_t ne11,
3333
const int64_t ne12,
3434
const int64_t ne13,
3535
// strides for src0
@@ -66,11 +66,11 @@ static void set_rows_sycl_q(const char * __restrict__ src0_d,
6666
const int64_t i12 = i03 % ne12;
6767
const int64_t i11 = i02 % ne11;
6868
const int64_t i10 = i01;
69-
size_t src_offset = calculate_offset<3>({ nb01, nb02, nb03 }, { i01, i02, i03 });
69+
const size_t src_offset = calculate_offset<3>({ nb01, nb02, nb03 }, { i01, i02, i03 });
7070
const char * src_block = src0_d + src_offset + i00 * sizeof(float);
71-
size_t src1_offset = calculate_offset<3>({ nb10, nb11, nb12 }, { i10, i11, i12 });
71+
const size_t src1_offset = calculate_offset<3>({ nb10, nb11, nb12 }, { i10, i11, i12 });
7272
const int64_t dst_row = src1_d[src1_offset / sizeof(int64_t)];
73-
size_t dst_offset =
73+
const size_t dst_offset =
7474
calculate_offset<3>({ nb1, nb2, nb3 }, { dst_row, i02, i03 }) + (i00 / qk) * sizeof(blockType);
7575
char * dst_block = reinterpret_cast<char *>(reinterpret_cast<char *>(dst_d) + dst_offset);
7676
cpyblck(src_block, dst_block);

0 commit comments

Comments
 (0)