diff --git a/ggml/src/ggml-cann/ggml-cann.cpp b/ggml/src/ggml-cann/ggml-cann.cpp index 7f6214e4fb..acf88db9b7 100644 --- a/ggml/src/ggml-cann/ggml-cann.cpp +++ b/ggml/src/ggml-cann/ggml-cann.cpp @@ -122,7 +122,7 @@ std::optional get_env(const std::string & name) { * @brief Verify whether the environment variable is a valid value. */ bool parse_bool(const std::string & value) { - std::unordered_set valid_values = { "on", "1", "yes", "y", "enable", "true" }; + static const std::unordered_set valid_values = { "on", "1", "yes", "y", "enable", "true" }; return valid_values.find(value) != valid_values.end(); }