Skip to content

Commit 1580805

Browse files
committed
metal : fix API debug warnings
1 parent a184e10 commit 1580805

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ggml-metal.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,7 @@ void ggml_metal_graph_compute(
12381238
// not sure how to avoid this
12391239
// TODO: make a simpler cpy_bytes kernel
12401240

1241-
const int nth = MIN(1024, ne00);
1241+
const int nth = MIN((int) ctx->pipeline_cpy_f32_f32.maxTotalThreadsPerThreadgroup, ne00);
12421242

12431243
[encoder setComputePipelineState:ctx->pipeline_cpy_f32_f32];
12441244
[encoder setBuffer:id_src0 offset:offs_src0 atIndex:0];
@@ -2239,7 +2239,7 @@ void ggml_metal_graph_compute(
22392239
[encoder setBytes:&nb3 length:sizeof(nb3) atIndex:17];
22402240
[encoder setBytes:&sf length:sizeof(sf) atIndex:18];
22412241

2242-
const int nth = MIN(1024, ne0);
2242+
const int nth = MIN((int) ctx->pipeline_upscale_f32.maxTotalThreadsPerThreadgroup, ne0);
22432243

22442244
[encoder dispatchThreadgroups:MTLSizeMake(ne1, ne2, ne3) threadsPerThreadgroup:MTLSizeMake(nth, 1, 1)];
22452245
} break;

ggml-metal.metal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3523,7 +3523,7 @@ void dequantize_q8_0(device const block_q8_0 *xb, short il, thread type4x4 & reg
35233523
device const int8_t * qs = ((device const int8_t *)xb->qs);
35243524
const half d = xb->d;
35253525

3526-
for (int i=0;i<16;i++) {
3526+
for (int i = 0; i < 16; i++) {
35273527
reg[i/4][i%4] = (qs[i + 16*il] * d);
35283528
}
35293529
}

0 commit comments

Comments
 (0)