Shorten switch statements

This commit is contained in:
0cc4m 2023-06-13 15:21:44 +02:00
parent 2a972f3649
commit f1ac03ed37

View file

@ -991,27 +991,20 @@ static cl_kernel* ggml_get_to_fp32_cl(ggml_type type) {
static size_t ggml_cl_global_denom(ggml_type type) {
switch (type) {
case GGML_TYPE_Q4_0:
return 1;
case GGML_TYPE_Q4_1:
return 1;
case GGML_TYPE_Q5_0:
return 1;
case GGML_TYPE_Q5_1:
return 1;
case GGML_TYPE_Q8_0:
return 1;
case GGML_TYPE_Q2_K:
return 4;
case GGML_TYPE_Q3_K:
return 4;
case GGML_TYPE_Q4_K:
return 8;
case GGML_TYPE_Q5_K:
return 4;
case GGML_TYPE_Q6_K:
return 4;
case GGML_TYPE_F16:
return 1;
default:
return 1;
}
@ -1020,27 +1013,20 @@ static size_t ggml_cl_global_denom(ggml_type type) {
static size_t ggml_cl_local_size(ggml_type type) {
switch (type) {
case GGML_TYPE_Q4_0:
return 0;
case GGML_TYPE_Q4_1:
return 0;
case GGML_TYPE_Q5_0:
return 0;
case GGML_TYPE_Q5_1:
return 0;
case GGML_TYPE_Q8_0:
return 0;
case GGML_TYPE_Q2_K:
return 64;
case GGML_TYPE_Q3_K:
return 64;
case GGML_TYPE_Q4_K:
return 32;
case GGML_TYPE_Q5_K:
return 64;
case GGML_TYPE_Q6_K:
return 64;
case GGML_TYPE_F16:
return 0;
default:
return 0;
}