Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): add an option to fail on compile warning #3952

Merged
Prev Previous commit
Next Next commit
ggml : fix unreachable code warnings
ggml-ci
  • Loading branch information
ggerganov committed Feb 16, 2024
commit c607df8b8aaf33c8260d50245e92f69df4cc4cf5
1 change: 1 addition & 0 deletions ggml-backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
return -1; // silence warning
}

#if 0
Expand Down
8 changes: 6 additions & 2 deletions ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -18576,7 +18576,9 @@ static enum ggml_opt_result linesearch_backtracking(
(*step) *= width;
}

GGML_UNREACHABLE();
GGML_ASSERT(false && "line search failed");

return GGML_LINESEARCH_FAIL;
}

static enum ggml_opt_result ggml_opt_lbfgs(
Expand Down Expand Up @@ -18844,7 +18846,9 @@ static enum ggml_opt_result ggml_opt_lbfgs(
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) {
Expand Down
Loading