ggml : fix unreachable code warnings

ggml-ci
This commit is contained in:
Georgi Gerganov 2024-02-16 13:46:15 +02:00
parent 6039d58513
commit c607df8b8a
No known key found for this signature in database
GPG key ID: BF970631944C16B7
2 changed files with 7 additions and 2 deletions

View file

@ -1006,6 +1006,7 @@ static int ggml_backend_sched_backend_from_buffer(ggml_backend_sched_t sched, gg
} }
} }
GGML_ASSERT(false && "tensor buffer type not supported by any backend"); GGML_ASSERT(false && "tensor buffer type not supported by any backend");
return -1; // silence warning
} }
#if 0 #if 0

8
ggml.c
View file

@ -18576,7 +18576,9 @@ static enum ggml_opt_result linesearch_backtracking(
(*step) *= width; (*step) *= width;
} }
GGML_UNREACHABLE(); GGML_ASSERT(false && "line search failed");
return GGML_LINESEARCH_FAIL;
} }
static enum ggml_opt_result ggml_opt_lbfgs( static enum ggml_opt_result ggml_opt_lbfgs(
@ -18844,7 +18846,9 @@ static enum ggml_opt_result ggml_opt_lbfgs(
step[0] = 1.0; step[0] = 1.0;
} }
GGML_UNREACHABLE(); GGML_ASSERT(false && "lbfgs failed");
return GGML_OPT_DID_NOT_CONVERGE;
} }
struct ggml_opt_params ggml_opt_default_params(enum ggml_opt_type type) { struct ggml_opt_params ggml_opt_default_params(enum ggml_opt_type type) {