Skip to content

Commit 0f7c696

Browse files
authored
musa: fix build warnings (ggml-org#15611)
Signed-off-by: Xiaodong Ye <[email protected]>
1 parent 835b2b9 commit 0f7c696

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

ggml/src/ggml-cuda/binbcast.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static __global__ void k_bin_bcast(const src0_t * src0,
5454
const uint32_t i2 = fastdiv((blockDim.z * blockIdx.z + threadIdx.z), ne3);
5555
const uint32_t i3 = (blockDim.z * blockIdx.z + threadIdx.z) - (i2 * ne3.z);
5656

57-
if (i0s >= ne0 || i1 >= ne1 || i2 >= ne2 || i3 >= ne3.z) {
57+
if (i0s >= (uint32_t)ne0 || i1 >= (uint32_t)ne1 || i2 >= (uint32_t)ne2 || i3 >= ne3.z) {
5858
return;
5959
}
6060

ggml/src/ggml-cuda/mmq.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static __global__ void mmq_ids_helper(
8181
#pragma unroll
8282
for (int offset = neu_padded; offset < warp_size; offset += neu_padded) {
8383
const int tmp = __shfl_up_sync(0xFFFFFFFF, it_compact_add_self, offset, warp_size);
84-
if (threadIdx.x >= offset) {
84+
if (threadIdx.x >= static_cast<unsigned int>(offset)) {
8585
it_compact_add_lower += tmp;
8686
}
8787
}
@@ -110,7 +110,7 @@ static __global__ void mmq_ids_helper(
110110

111111
expert_bounds[expert] = nex_prev;
112112

113-
if (expert < gridDim.x - 1) {
113+
if (expert < static_cast<int>(gridDim.x) - 1) {
114114
return;
115115
}
116116

ggml/src/ggml-cuda/mmvq.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ static __global__ void mul_mat_vec_q(
220220
tmp[j][i] = warp_reduce_sum<warp_size>(tmp[j][i]);
221221
}
222222

223-
if (threadIdx.x < rows_per_cuda_block && (rows_per_cuda_block == 1 || row0 + int(threadIdx.x) < stride_col_dst)) {
223+
if (threadIdx.x < rows_per_cuda_block && (rows_per_cuda_block == 1 || uint32_t(row0 + threadIdx.x) < stride_col_dst)) {
224224
dst[j*stride_col_dst + threadIdx.x] = tmp[j][threadIdx.x];
225225
}
226226
}

ggml/src/ggml-cuda/pad_reflect_1d.cu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ static __global__ __launch_bounds__(CUDA_PAD_REFLECT_1D_BLOCK_SIZE, 1) void
5151
}
5252
const float value = *(const float *) (src0_ptr + src_idx * nb00);
5353
*(float *) (dst_ptr + i0 * nb0) = value;
54+
55+
GGML_UNUSED(p1);
5456
}
5557

5658
void ggml_cuda_op_pad_reflect_1d(ggml_backend_cuda_context & ctx, ggml_tensor * dst) {

0 commit comments

Comments
 (0)