Skip to content

Commit 3930184

Browse files
committed
Try to reduce some unused and typecast warnings
1 parent 43ed389 commit 3930184

File tree

11 files changed

+64
-23
lines changed

11 files changed

+64
-23
lines changed

ggml/src/ggml-sycl/common.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ struct bin_bcast_sycl {
626626
});
627627
}
628628
}
629+
(void) ctx;
629630
}
630631
};
631632

ggml/src/ggml-sycl/concat.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static void concat_f32_dim1(const float *x, const float *y, float *dst,
4747
// operation
4848
int offset_dst = nidx + item_ct1.get_group(1) * ne0 +
4949
item_ct1.get_group(0) * ne0 * item_ct1.get_group_range(1);
50-
if (item_ct1.get_group(1) < ne01) { // src0
50+
if (item_ct1.get_group(1) < (size_t) ne01) { // src0
5151
int offset_src =
5252
nidx + item_ct1.get_group(1) * ne0 + item_ct1.get_group(0) * ne0 * ne01;
5353
dst[offset_dst] = x[offset_src];
@@ -70,7 +70,7 @@ static void concat_f32_dim2(const float *x, const float *y, float *dst,
7070
// operation
7171
int offset_dst = nidx + item_ct1.get_group(1) * ne0 +
7272
item_ct1.get_group(0) * ne0 * item_ct1.get_group_range(1);
73-
if (item_ct1.get_group(0) < ne02) { // src0
73+
if (item_ct1.get_group(0) < (size_t) ne02) { // src0
7474
int offset_src = nidx + item_ct1.get_group(1) * ne0 +
7575
item_ct1.get_group(0) * ne0 * item_ct1.get_group_range(1);
7676
dst[offset_dst] = x[offset_src];

ggml/src/ggml-sycl/dpct/helper.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,7 @@ namespace dpct
12371237
12381238
std::map<byte_t *, allocation>::iterator get_map_iterator(const void *ptr)
12391239
{
1240-
auto it = m_map.upper_bound((byte_t *)ptr);
1240+
auto it = m_map.upper_bound(const_cast<byte_t *>(reinterpret_cast<const byte_t *>(ptr)));
12411241
if (it == m_map.end())
12421242
{
12431243
// Not a virtual pointer.

ggml/src/ggml-sycl/element_wise.cpp

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ void upscale_f32(const float *x, float *dst, const int nb00, const int nb01,
237237
int i02 = i12 / sf2;
238238
int i03 = i13 / sf3;
239239

240-
dst[index] = *(float *)((char *)x + i03 * nb03 + i02 * nb02 + i01 * nb01 + i00 * nb00);
240+
dst[index] = *(float *)((const char *)x + i03 * nb03 + i02 * nb02 + i01 * nb01 + i00 * nb00);
241241
}
242242

243243
void pad_f32(const float *x, float *dst, const int ne0, const int ne00, const int ne01, const int ne02,
@@ -523,6 +523,7 @@ inline void ggml_sycl_op_silu(ggml_backend_sycl_context & ctx, const ggml_tensor
523523
(void) src1;
524524
(void) dst;
525525
(void) src1_dd;
526+
(void) ctx;
526527
}
527528

528529
inline void ggml_sycl_op_gelu(ggml_backend_sycl_context & ctx, const ggml_tensor *src0, const ggml_tensor *src1,
@@ -538,6 +539,7 @@ inline void ggml_sycl_op_gelu(ggml_backend_sycl_context & ctx, const ggml_tensor
538539
(void) src1;
539540
(void) dst;
540541
(void) src1_dd;
542+
(void) ctx;
541543
}
542544
inline void ggml_sycl_op_gelu_quick(ggml_backend_sycl_context & ctx, const ggml_tensor *src0,
543545
const ggml_tensor *src1, ggml_tensor *dst,
@@ -553,6 +555,7 @@ inline void ggml_sycl_op_gelu_quick(ggml_backend_sycl_context & ctx, const ggml_
553555
(void) src1;
554556
(void) dst;
555557
(void) src1_dd;
558+
(void) ctx;
556559
}
557560

558561
inline void ggml_sycl_op_tanh(ggml_backend_sycl_context & ctx, const ggml_tensor *src0, const ggml_tensor *src1,
@@ -567,6 +570,7 @@ inline void ggml_sycl_op_tanh(ggml_backend_sycl_context & ctx, const ggml_tensor
567570
(void) src1;
568571
(void) dst;
569572
(void) src1_dd;
573+
(void) ctx;
570574
}
571575

572576
inline void ggml_sycl_op_relu(ggml_backend_sycl_context & ctx, const ggml_tensor *src0, const ggml_tensor *src1,
@@ -582,6 +586,7 @@ inline void ggml_sycl_op_relu(ggml_backend_sycl_context & ctx, const ggml_tensor
582586
(void) src1;
583587
(void) dst;
584588
(void) src1_dd;
589+
(void) ctx;
585590
}
586591

587592
inline void ggml_sycl_op_hardsigmoid(ggml_backend_sycl_context & ctx, const ggml_tensor *src0,
@@ -598,6 +603,7 @@ inline void ggml_sycl_op_hardsigmoid(ggml_backend_sycl_context & ctx, const ggml
598603
(void) src1;
599604
(void) dst;
600605
(void) src1_dd;
606+
(void) ctx;
601607
}
602608

603609
inline void ggml_sycl_op_hardswish(ggml_backend_sycl_context & ctx, const ggml_tensor *src0,
@@ -613,6 +619,7 @@ inline void ggml_sycl_op_hardswish(ggml_backend_sycl_context & ctx, const ggml_t
613619
(void) src1;
614620
(void) dst;
615621
(void) src1_dd;
622+
(void) ctx;
616623
}
617624

618625
inline void ggml_sycl_op_exp(ggml_backend_sycl_context & ctx, const ggml_tensor *src0,
@@ -628,6 +635,7 @@ inline void ggml_sycl_op_exp(ggml_backend_sycl_context & ctx, const ggml_tensor
628635
(void) src1;
629636
(void) dst;
630637
(void) src1_dd;
638+
(void) ctx;
631639
}
632640

633641
inline void ggml_sycl_op_log(ggml_backend_sycl_context & ctx, const ggml_tensor *src0,
@@ -643,6 +651,7 @@ inline void ggml_sycl_op_log(ggml_backend_sycl_context & ctx, const ggml_tensor
643651
(void) src1;
644652
(void) dst;
645653
(void) src1_dd;
654+
(void) ctx;
646655
}
647656

648657
inline void ggml_sycl_op_sigmoid(ggml_backend_sycl_context & ctx, const ggml_tensor *src0,
@@ -658,6 +667,7 @@ inline void ggml_sycl_op_sigmoid(ggml_backend_sycl_context & ctx, const ggml_ten
658667
(void) src1;
659668
(void) dst;
660669
(void) src1_dd;
670+
(void) ctx;
661671
}
662672

663673
inline void ggml_sycl_op_sqrt(ggml_backend_sycl_context & ctx, const ggml_tensor *src0,
@@ -673,6 +683,7 @@ inline void ggml_sycl_op_sqrt(ggml_backend_sycl_context & ctx, const ggml_tensor
673683
(void) src1;
674684
(void) dst;
675685
(void) src1_dd;
686+
(void) ctx;
676687
}
677688

678689
inline void ggml_sycl_op_sin(ggml_backend_sycl_context & ctx, const ggml_tensor *src0,
@@ -688,6 +699,7 @@ inline void ggml_sycl_op_sin(ggml_backend_sycl_context & ctx, const ggml_tensor
688699
(void) src1;
689700
(void) dst;
690701
(void) src1_dd;
702+
(void) ctx;
691703
}
692704

693705
inline void ggml_sycl_op_cos(ggml_backend_sycl_context & ctx, const ggml_tensor *src0,
@@ -703,6 +715,7 @@ inline void ggml_sycl_op_cos(ggml_backend_sycl_context & ctx, const ggml_tensor
703715
(void) src1;
704716
(void) dst;
705717
(void) src1_dd;
718+
(void) ctx;
706719
}
707720

708721
inline void ggml_sycl_op_step(ggml_backend_sycl_context & ctx, const ggml_tensor *src0,
@@ -718,6 +731,7 @@ inline void ggml_sycl_op_step(ggml_backend_sycl_context & ctx, const ggml_tensor
718731
(void) src1;
719732
(void) dst;
720733
(void) src1_dd;
734+
(void) ctx;
721735
}
722736

723737
inline void ggml_sycl_op_neg(ggml_backend_sycl_context & ctx, const ggml_tensor *src0,
@@ -733,6 +747,7 @@ inline void ggml_sycl_op_neg(ggml_backend_sycl_context & ctx, const ggml_tensor
733747
(void) src1;
734748
(void) dst;
735749
(void) src1_dd;
750+
(void) ctx;
736751
}
737752

738753
inline void ggml_sycl_op_leaky_relu(ggml_backend_sycl_context & ctx, const ggml_tensor *src0,
@@ -752,6 +767,7 @@ inline void ggml_sycl_op_leaky_relu(ggml_backend_sycl_context & ctx, const ggml_
752767
(void) src1;
753768
(void) dst;
754769
(void) src1_dd;
770+
(void) ctx;
755771
}
756772

757773
inline void ggml_sycl_op_sqr(ggml_backend_sycl_context & ctx, const ggml_tensor *src0, const ggml_tensor *src1,
@@ -767,6 +783,7 @@ inline void ggml_sycl_op_sqr(ggml_backend_sycl_context & ctx, const ggml_tensor
767783
(void) src1;
768784
(void) dst;
769785
(void) src1_dd;
786+
(void) ctx;
770787
}
771788

772789
inline void ggml_sycl_op_upscale(ggml_backend_sycl_context & ctx, const ggml_tensor *src0,
@@ -790,6 +807,7 @@ inline void ggml_sycl_op_upscale(ggml_backend_sycl_context & ctx, const ggml_ten
790807
(void) src1;
791808
(void) dst;
792809
(void) src1_dd;
810+
(void) ctx;
793811
}
794812

795813
inline void ggml_sycl_op_pad(ggml_backend_sycl_context & ctx, const ggml_tensor *src0, const ggml_tensor *src1,
@@ -808,6 +826,7 @@ inline void ggml_sycl_op_pad(ggml_backend_sycl_context & ctx, const ggml_tensor
808826
(void) src1;
809827
(void) dst;
810828
(void) src1_dd;
829+
(void) ctx;
811830
}
812831

813832
inline void ggml_sycl_op_acc(ggml_backend_sycl_context & ctx, const ggml_tensor *src0, const ggml_tensor *src1,
@@ -828,6 +847,7 @@ inline void ggml_sycl_op_acc(ggml_backend_sycl_context & ctx, const ggml_tensor
828847
acc_f32_sycl(src0_dd, src1_dd, dst_dd, ggml_nelements(dst), src1->ne[0], src1->ne[1], src1->ne[2], nb1, nb2, offset, main_stream);
829848

830849
(void) dst;
850+
(void) ctx;
831851
}
832852

833853
inline void ggml_sycl_op_add(ggml_backend_sycl_context & ctx, const ggml_tensor *src0, const ggml_tensor *src1,

ggml/src/ggml-sycl/ggml-sycl.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2640,6 +2640,7 @@ static void ggml_sycl_op_pool2d(ggml_backend_sycl_context & ctx, const ggml_tens
26402640

26412641
(void) src1;
26422642
(void) src1_dd;
2643+
(void) ctx;
26432644
}
26442645

26452646
inline void ggml_sycl_op_sum(ggml_backend_sycl_context & ctx, const ggml_tensor *src0,
@@ -2657,6 +2658,7 @@ inline void ggml_sycl_op_sum(ggml_backend_sycl_context & ctx, const ggml_tensor
26572658
(void) src1;
26582659
(void) dst;
26592660
(void) src1_dd;
2661+
(void) ctx;
26602662
}
26612663

26622664
inline void ggml_sycl_op_sum_rows(ggml_backend_sycl_context & ctx, const ggml_tensor *src0,
@@ -2676,6 +2678,7 @@ inline void ggml_sycl_op_sum_rows(ggml_backend_sycl_context & ctx, const ggml_te
26762678
(void) src1;
26772679
(void) dst;
26782680
(void) src1_dd;
2681+
(void) ctx;
26792682
}
26802683

26812684
inline void ggml_sycl_op_argsort(ggml_backend_sycl_context & ctx, const ggml_tensor *src0,
@@ -2697,6 +2700,7 @@ inline void ggml_sycl_op_argsort(ggml_backend_sycl_context & ctx, const ggml_ten
26972700
(void) src1;
26982701
(void) dst;
26992702
(void) src1_dd;
2703+
(void) ctx;
27002704
}
27012705

27022706
inline void ggml_sycl_op_argmax(ggml_backend_sycl_context & ctx, const ggml_tensor *src0,
@@ -2716,6 +2720,7 @@ inline void ggml_sycl_op_argmax(ggml_backend_sycl_context & ctx, const ggml_tens
27162720
(void) src1;
27172721
(void) dst;
27182722
(void) src1_dd;
2723+
(void) ctx;
27192724
}
27202725

27212726
inline void ggml_sycl_op_diag_mask_inf(ggml_backend_sycl_context & ctx, const ggml_tensor *src0,
@@ -2738,6 +2743,7 @@ inline void ggml_sycl_op_diag_mask_inf(ggml_backend_sycl_context & ctx, const gg
27382743
(void) src1;
27392744
(void) dst;
27402745
(void) src1_dd;
2746+
(void) ctx;
27412747
}
27422748

27432749
inline void ggml_sycl_op_scale(ggml_backend_sycl_context & ctx, const ggml_tensor *src0, const ggml_tensor *src1,
@@ -2761,6 +2767,7 @@ inline void ggml_sycl_op_scale(ggml_backend_sycl_context & ctx, const ggml_tenso
27612767
(void) src1;
27622768
(void) dst;
27632769
(void) src1_dd;
2770+
(void) ctx;
27642771
}
27652772

27662773
inline void ggml_sycl_op_clamp(ggml_backend_sycl_context & ctx, const ggml_tensor *src0, const ggml_tensor *src1,
@@ -2786,6 +2793,7 @@ inline void ggml_sycl_op_clamp(ggml_backend_sycl_context & ctx, const ggml_tenso
27862793
(void) src1;
27872794
(void) dst;
27882795
(void) src1_dd;
2796+
(void) ctx;
27892797
}
27902798

27912799
static void ggml_sycl_set_peer_access(const int n_tokens, int main_device) {

ggml/src/ggml-sycl/im2col.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,5 @@ void ggml_sycl_op_im2col(
122122

123123
(void) src0;
124124
(void) src0_dd;
125+
(void) ctx;
125126
}

ggml/src/ggml-sycl/mmvq.cpp

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -753,10 +753,10 @@ static void mul_mat_vec_iq2_xs_q8_1_sycl(const void *vx, const void *vy,
753753
const sycl::range<3> block_nums(1, 1, block_num_y);
754754
const sycl::range<3> block_dims(1, GGML_SYCL_MMV_Y, QK_WARP_SIZE);
755755
{
756-
757-
stream->submit([&](sycl::handler &cgh) {
758-
auto iq2xs_grid_ptr_ct1 = &iq2xs_grid[0];
759-
auto ksigns64_ptr_ct1 = &ksigns64[0];
756+
stream->submit([&](sycl::handler & cgh) {
757+
//TODO: What's the purpose of these?
758+
//auto iq2xs_grid_ptr_ct1 = &iq2xs_grid[0];
759+
//auto ksigns64_ptr_ct1 = &ksigns64[0];
760760

761761
cgh.parallel_for(
762762
sycl::nd_range<3>(block_nums * block_dims, block_dims),
@@ -780,8 +780,9 @@ static void mul_mat_vec_iq2_s_q8_1_sycl(const void *vx, const void *vy,
780780
{
781781

782782
stream->submit([&](sycl::handler &cgh) {
783-
auto iq2xs_grid_ptr_ct1 = &iq2xs_grid[0];
784-
auto ksigns64_ptr_ct1 = &ksigns64[0];
783+
// TODO: What's the purpose of these?
784+
// auto iq2xs_grid_ptr_ct1 = &iq2xs_grid[0];
785+
// auto ksigns64_ptr_ct1 = &ksigns64[0];
785786

786787
cgh.parallel_for(
787788
sycl::nd_range<3>(block_nums * block_dims, block_dims),
@@ -805,8 +806,9 @@ static void mul_mat_vec_iq3_xxs_q8_1_sycl(const void *vx, const void *vy,
805806
{
806807

807808
stream->submit([&](sycl::handler &cgh) {
808-
auto iq3xxs_grid_ptr_ct1 = &iq3xxs_grid[0];
809-
auto ksigns64_ptr_ct1 = &ksigns64[0];
809+
// TODO: What's the purpose of these?
810+
// auto iq3xxs_grid_ptr_ct1 = &iq3xxs_grid[0];
811+
// auto ksigns64_ptr_ct1 = &ksigns64[0];
810812

811813
cgh.parallel_for(
812814
sycl::nd_range<3>(block_nums * block_dims, block_dims),
@@ -830,7 +832,8 @@ static void mul_mat_vec_iq3_s_q8_1_sycl(const void *vx, const void *vy,
830832
{
831833

832834
stream->submit([&](sycl::handler &cgh) {
833-
auto iq3s_grid_ptr_ct1 = &iq3s_grid[0];
835+
// TODO: What's the purpose of this?
836+
// auto iq3s_grid_ptr_ct1 = &iq3s_grid[0];
834837

835838
cgh.parallel_for(
836839
sycl::nd_range<3>(block_nums * block_dims, block_dims),
@@ -854,8 +857,9 @@ static void mul_mat_vec_iq1_s_q8_1_sycl(const void *vx, const void *vy,
854857
{
855858

856859
stream->submit([&](sycl::handler &cgh) {
857-
auto iq1s_grid_ptr_ct1 = &iq1s_grid_gpu[0];
858-
auto ksigns64_ptr_ct1 = &ksigns64[0];
860+
// TODO: What's the purpose of these?
861+
// auto iq1s_grid_ptr_ct1 = &iq1s_grid_gpu[0];
862+
// auto ksigns64_ptr_ct1 = &ksigns64[0];
859863

860864
cgh.parallel_for(
861865
sycl::nd_range<3>(block_nums * block_dims, block_dims),
@@ -954,7 +958,8 @@ void ggml_sycl_op_mul_mat_vec_q(
954958
const size_t q8_1_bs = QK8_1;
955959
// the main device has a larger memory buffer to hold the results from all GPUs
956960
// nrows_dst == nrows of the matrix that the kernel writes into
957-
const int64_t nrows_dst = id == ctx.device ? ne00 : row_diff;
961+
// TODO: nrows_dst is unused. Please check.
962+
// const int64_t nrows_dst = id == ctx.device ? ne00 : row_diff;
958963
for (int i = 0; i < src1_ncols; i++)
959964
{
960965
const size_t src1_ddq_i_offset = i * src1_padded_col_size * q8_1_ts / q8_1_bs;

ggml/src/ggml-sycl/norm.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ void ggml_sycl_op_group_norm(ggml_backend_sycl_context& ctx, const ggml_tensor*
352352
(void)src1;
353353
(void)dst;
354354
(void)src1_dd;
355+
(void) ctx;
355356
}
356357

357358
void ggml_sycl_op_rms_norm(ggml_backend_sycl_context& ctx, const ggml_tensor* src0,

ggml/src/ggml-sycl/rope.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,4 +272,5 @@ void ggml_sycl_op_rope(
272272
(void) src1;
273273
(void) dst;
274274
(void) src1_dd;
275+
(void) ctx;
275276
}

0 commit comments

Comments
 (0)