From: hipudding Date: Wed, 7 Jan 2026 08:11:31 +0000 (+0800) Subject: CANN: Fix rename for get_env (#18652) X-Git-Tag: upstream/0.0.7721~67 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=3333951d86c0a67bac318cc6b0a924b673f6e4e5;p=pkg%2Fggml%2Fsources%2Fllama.cpp CANN: Fix rename for get_env (#18652) In #18624, get_env in ggml-cann was renamed to get_env_as_lowercase to accurately reflect the function’s behavior and reduce the chance of misuse. However, the update missed renaming call sites in other files. This commit fixes that oversight. --- diff --git a/ggml/src/ggml-cann/aclnn_ops.cpp b/ggml/src/ggml-cann/aclnn_ops.cpp index 50b6bd00..6b718e01 100644 --- a/ggml/src/ggml-cann/aclnn_ops.cpp +++ b/ggml/src/ggml-cann/aclnn_ops.cpp @@ -1963,7 +1963,7 @@ static void ggml_cann_mat_mul_fp(ggml_backend_cann_context & ctx, ggml_tensor * acl_tensor_ptr acl_weight_tensor; // Only check env once. - static bool weight_to_nz = parse_bool(get_env("GGML_CANN_WEIGHT_NZ").value_or("on")); + static bool weight_to_nz = parse_bool(get_env_as_lowercase("GGML_CANN_WEIGHT_NZ").value_or("on")); if (weight_to_nz && is_matmul_weight(weight)) { acl_weight_tensor = ggml_cann_create_tensor(weight, transpose_ne, transpose_nb, n_dims, ACL_FORMAT_FRACTAL_NZ); } else { diff --git a/ggml/src/ggml-cann/common.h b/ggml/src/ggml-cann/common.h index e9a21e1b..6895349b 100644 --- a/ggml/src/ggml-cann/common.h +++ b/ggml/src/ggml-cann/common.h @@ -103,7 +103,7 @@ const ggml_cann_device_info & ggml_cann_info(); void ggml_cann_set_device(int32_t device); int32_t ggml_cann_get_device(); -std::optional get_env(const std::string & name); +std::optional get_env_as_lowercase(const std::string & name); bool parse_bool(const std::string & value); int parse_integer(const std::string & value);