Skip to content

Commit d9204ea

Browse files
committed
mumat-tune: fixed analyze, format
1 parent f901ed8 commit d9204ea

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

examples/mulmat-tune/mulmat-tune-tool.c

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ int main(int argc, char **argv) {
8686
{
8787
const char *name = ggml_get_blas_vendor();
8888
int n = sizeof(tune.blas_vendor);
89-
strncpy(tune.blas_vendor, name, n-1);
89+
strncpy(tune.blas_vendor, name, n - 1);
9090
}
9191

9292
const char *arg_model = NULL;
@@ -161,17 +161,23 @@ int main(int argc, char **argv) {
161161
enum ggml_type type;
162162
if (strcmp(arg_type, "F32") == 0) {
163163
type = GGML_TYPE_F32;
164-
} else if (strcmp(arg_type, "F16") == 0 || strcmp(arg_type, "f16") == 0) {
164+
} else if (strcmp(arg_type, "F16") == 0 ||
165+
strcmp(arg_type, "f16") == 0) {
165166
type = GGML_TYPE_F16;
166-
} else if (strcmp(arg_type, "Q4_0") == 0 || strcmp(arg_type, "q4_0") == 0) {
167+
} else if (strcmp(arg_type, "Q4_0") == 0 ||
168+
strcmp(arg_type, "q4_0") == 0) {
167169
type = GGML_TYPE_Q4_0;
168-
} else if (strcmp(arg_type, "Q4_1") == 0 || strcmp(arg_type, "q4_1") == 0) {
170+
} else if (strcmp(arg_type, "Q4_1") == 0 ||
171+
strcmp(arg_type, "q4_1") == 0) {
169172
type = GGML_TYPE_Q4_1;
170-
} else if (strcmp(arg_type, "Q5_0") == 0 || strcmp(arg_type, "q5_0") == 0) {
173+
} else if (strcmp(arg_type, "Q5_0") == 0 ||
174+
strcmp(arg_type, "q5_0") == 0) {
171175
type = GGML_TYPE_Q5_0;
172-
} else if (strcmp(arg_type, "Q5_1") == 0 || strcmp(arg_type, "q5_1") == 0) {
176+
} else if (strcmp(arg_type, "Q5_1") == 0 ||
177+
strcmp(arg_type, "q5_1") == 0) {
173178
type = GGML_TYPE_Q5_1;
174-
} else if (strcmp(arg_type, "Q8_0") == 0 || strcmp(arg_type, "q8_0") == 0) {
179+
} else if (strcmp(arg_type, "Q8_0") == 0 ||
180+
strcmp(arg_type, "q8_0") == 0) {
175181
type = GGML_TYPE_Q8_0;
176182
} else {
177183
fprintf(stderr, "invalid type: %s]\n", arg_type);
@@ -545,8 +551,7 @@ static void cmd_analyze(struct ggml_mulmat_tune *tune) {
545551
printf("\n");
546552

547553
for (int ip = 0; ip < tune->n_profiles; ip++) {
548-
const struct ggml_task_profile *profile =
549-
&tune->profiles[ip * 3];
554+
const struct ggml_task_profile *profile = &tune->profiles[ip];
550555
int *total_time = malloc(sizeof(int) * m_num);
551556
for (int k = 0; k < 3; k++) {
552557
if (!profile->stages[k].valid) {

0 commit comments

Comments
 (0)