@@ -427,7 +427,7 @@ static_assert(sizeof(vk_op_unary_push_constants) <= 128, "sizeof(vk_op_unary_pus
427
427
// and a shift:
428
428
//
429
429
// n/d = (mulhi(n, mp) + n) >> L;
430
- void init_fastdiv_values(uint32_t d, uint32_t &mp, uint32_t &L)
430
+ static void init_fastdiv_values(uint32_t d, uint32_t &mp, uint32_t &L)
431
431
{
432
432
// compute L = ceil(log2(d));
433
433
L = 0;
@@ -439,6 +439,7 @@ void init_fastdiv_values(uint32_t d, uint32_t &mp, uint32_t &L)
439
439
}
440
440
441
441
template <typename T> void init_pushconst_fastdiv(T &p) {
442
+ GGML_UNUSED(p);
442
443
static_assert(!std::is_const<T>::value, "unexpected type");
443
444
}
444
445
@@ -3417,7 +3418,7 @@ static uint32_t ggml_vk_guess_split_k(ggml_backend_vk_context * ctx, int m, int
3417
3418
return split_k;
3418
3419
}
3419
3420
3420
- static vk_pipeline ggml_vk_guess_matmul_pipeline(ggml_backend_vk_context * ctx, vk_matmul_pipeline& mmp, int m, int n, bool aligned, ggml_type type_a ) {
3421
+ static vk_pipeline ggml_vk_guess_matmul_pipeline(ggml_backend_vk_context * ctx, vk_matmul_pipeline& mmp, int m, int n, bool aligned) {
3421
3422
VK_LOG_DEBUG("ggml_vk_guess_matmul_pipeline(" << m << ", " << n << ", " << aligned << ")");
3422
3423
3423
3424
if (ctx->device->coopmat2) {
@@ -3439,9 +3440,9 @@ static vk_pipeline ggml_vk_guess_matmul_pipeline(ggml_backend_vk_context * ctx,
3439
3440
return aligned ? mmp->a_l : mmp->l;
3440
3441
}
3441
3442
3442
- static uint32_t ggml_vk_guess_matmul_pipeline_align(ggml_backend_vk_context * ctx, vk_matmul_pipeline& mmp, int m, int n, ggml_type type_a ) {
3443
+ static uint32_t ggml_vk_guess_matmul_pipeline_align(ggml_backend_vk_context * ctx, vk_matmul_pipeline& mmp, int m, int n) {
3443
3444
VK_LOG_DEBUG("ggml_vk_guess_matmul_pipeline_align(" << m << ", " << n << ")");
3444
- return ggml_vk_guess_matmul_pipeline(ctx, mmp, m, n, true, type_a )->align;
3445
+ return ggml_vk_guess_matmul_pipeline(ctx, mmp, m, n, true)->align;
3445
3446
}
3446
3447
3447
3448
static void ggml_vk_matmul(
@@ -3571,6 +3572,7 @@ static void ggml_vk_cpy_to_contiguous(ggml_backend_vk_context * ctx, vk_context&
3571
3572
(uint32_t)tensor->ne[0], (uint32_t)tensor->ne[1], (uint32_t)tensor->ne[2], (uint32_t)tensor->ne[3], 1 , (uint32_t)tensor->ne[0] , (uint32_t)(tensor->ne[0] * tensor->ne[1]) , (uint32_t)(tensor->ne[0] * tensor->ne[1] * tensor->ne[2]),
3572
3573
0,
3573
3574
0.0f, 0.0f,
3575
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3574
3576
};
3575
3577
init_pushconst_fastdiv(pc);
3576
3578
ggml_vk_sync_buffers(subctx);
@@ -3644,10 +3646,10 @@ static void ggml_vk_mul_mat_q_f16(ggml_backend_vk_context * ctx, vk_context& sub
3644
3646
const int y_ne = ne11 * ne10;
3645
3647
const int d_ne = ne11 * ne01;
3646
3648
3647
- const uint32_t kpad = ggml_vk_align_size(ne10, ggml_vk_guess_matmul_pipeline_align(ctx, mmp, ne01, ne11, src0->type ));
3649
+ const uint32_t kpad = ggml_vk_align_size(ne10, ggml_vk_guess_matmul_pipeline_align(ctx, mmp, ne01, ne11));
3648
3650
const bool aligned = ne10 == kpad && ne01 > 8 && ne11 > 8;
3649
3651
3650
- vk_pipeline pipeline = ggml_vk_guess_matmul_pipeline(ctx, mmp, ne01, ne11, aligned, src0->type );
3652
+ vk_pipeline pipeline = ggml_vk_guess_matmul_pipeline(ctx, mmp, ne01, ne11, aligned);
3651
3653
3652
3654
const uint32_t split_k = ggml_vk_guess_split_k(ctx, ne01, ne11, ne10, pipeline);
3653
3655
@@ -5351,7 +5353,8 @@ static void ggml_vk_scale(ggml_backend_vk_context * ctx, vk_context& subctx, con
5351
5353
(uint32_t)src0->ne[0], (uint32_t)src0->ne[1], (uint32_t)src0->ne[2], (uint32_t)src0->ne[3], (uint32_t)src0->nb[0] / src0_type_size, (uint32_t)src0->nb[1] / src0_type_size, (uint32_t)src0->nb[2] / src0_type_size, (uint32_t)src0->nb[3] / src0_type_size,
5352
5354
(uint32_t) dst->ne[0], (uint32_t) dst->ne[1], (uint32_t) dst->ne[2], (uint32_t) dst->ne[3], (uint32_t) dst->nb[0] / dst_type_size, (uint32_t) dst->nb[1] / dst_type_size, (uint32_t) dst->nb[2] / dst_type_size, (uint32_t) dst->nb[3] / dst_type_size,
5353
5355
0,
5354
- op_params[0], 0.0f
5356
+ op_params[0], 0.0f,
5357
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5355
5358
}, dryrun);
5356
5359
}
5357
5360
@@ -5365,6 +5368,7 @@ static void ggml_vk_sqr(ggml_backend_vk_context * ctx, vk_context& subctx, const
5365
5368
(uint32_t) dst->ne[0], (uint32_t) dst->ne[1], (uint32_t) dst->ne[2], (uint32_t) dst->ne[3], (uint32_t) dst->nb[0] / dst_type_size, (uint32_t) dst->nb[1] / dst_type_size, (uint32_t) dst->nb[2] / dst_type_size, (uint32_t) dst->nb[3] / dst_type_size,
5366
5369
0,
5367
5370
0.0f, 0.0f,
5371
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5368
5372
}, dryrun);
5369
5373
}
5370
5374
@@ -5378,6 +5382,7 @@ static void ggml_vk_sin(ggml_backend_vk_context * ctx, vk_context& subctx, const
5378
5382
(uint32_t) dst->ne[0], (uint32_t) dst->ne[1], (uint32_t) dst->ne[2], (uint32_t) dst->ne[3], (uint32_t) dst->nb[0] / dst_type_size, (uint32_t) dst->nb[1] / dst_type_size, (uint32_t) dst->nb[2] / dst_type_size, (uint32_t) dst->nb[3] / dst_type_size,
5379
5383
0,
5380
5384
0.0f, 0.0f,
5385
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5381
5386
}, dryrun);
5382
5387
}
5383
5388
@@ -5391,6 +5396,7 @@ static void ggml_vk_cos(ggml_backend_vk_context * ctx, vk_context& subctx, const
5391
5396
(uint32_t) dst->ne[0], (uint32_t) dst->ne[1], (uint32_t) dst->ne[2], (uint32_t) dst->ne[3], (uint32_t) dst->nb[0] / dst_type_size, (uint32_t) dst->nb[1] / dst_type_size, (uint32_t) dst->nb[2] / dst_type_size, (uint32_t) dst->nb[3] / dst_type_size,
5392
5397
0,
5393
5398
0.0f, 0.0f,
5399
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5394
5400
}, dryrun);
5395
5401
}
5396
5402
@@ -5405,6 +5411,7 @@ static void ggml_vk_clamp(ggml_backend_vk_context * ctx, vk_context& subctx, con
5405
5411
(uint32_t) dst->ne[0], (uint32_t) dst->ne[1], (uint32_t) dst->ne[2], (uint32_t) dst->ne[3], (uint32_t) dst->nb[0] / dst_type_size, (uint32_t) dst->nb[1] / dst_type_size, (uint32_t) dst->nb[2] / dst_type_size, (uint32_t) dst->nb[3] / dst_type_size,
5406
5412
0,
5407
5413
op_params[0], op_params[1],
5414
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5408
5415
}, dryrun);
5409
5416
}
5410
5417
@@ -5418,6 +5425,7 @@ static void ggml_vk_pad(ggml_backend_vk_context * ctx, vk_context& subctx, const
5418
5425
(uint32_t) dst->ne[0], (uint32_t) dst->ne[1], (uint32_t) dst->ne[2], (uint32_t) dst->ne[3], (uint32_t) dst->nb[0] / dst_type_size, (uint32_t) dst->nb[1] / dst_type_size, (uint32_t) dst->nb[2] / dst_type_size, (uint32_t) dst->nb[3] / dst_type_size,
5419
5426
0,
5420
5427
0.0f, 0.0f,
5428
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5421
5429
}, dryrun);
5422
5430
}
5423
5431
@@ -5431,6 +5439,7 @@ static void ggml_vk_repeat(ggml_backend_vk_context * ctx, vk_context& subctx, co
5431
5439
(uint32_t) dst->ne[0], (uint32_t) dst->ne[1], (uint32_t) dst->ne[2], (uint32_t) dst->ne[3], (uint32_t) dst->nb[0] / dst_type_size, (uint32_t) dst->nb[1] / dst_type_size, (uint32_t) dst->nb[2] / dst_type_size, (uint32_t) dst->nb[3] / dst_type_size,
5432
5440
0,
5433
5441
0.0f, 0.0f,
5442
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5434
5443
}, dryrun);
5435
5444
}
5436
5445
@@ -5445,6 +5454,7 @@ static void ggml_vk_cpy(ggml_backend_vk_context * ctx, vk_context& subctx, const
5445
5454
(uint32_t) dst->ne[0], (uint32_t) dst->ne[1], (uint32_t) dst->ne[2], (uint32_t) dst->ne[3], (uint32_t) dst->nb[0] / dst_type_size, (uint32_t) dst->nb[1] / dst_type_size, (uint32_t) dst->nb[2] / dst_type_size, (uint32_t) dst->nb[3] / dst_type_size,
5446
5455
d_offset,
5447
5456
0.0f, 0.0f,
5457
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5448
5458
}, dryrun);
5449
5459
}
5450
5460
0 commit comments