]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
CANN: Fix rename for get_env (#18652)
authorhipudding <redacted>
Wed, 7 Jan 2026 08:11:31 +0000 (16:11 +0800)
committerGitHub <redacted>
Wed, 7 Jan 2026 08:11:31 +0000 (16:11 +0800)
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.

ggml/src/ggml-cann/aclnn_ops.cpp
ggml/src/ggml-cann/common.h

index 50b6bd00e4cfe6ea02701de8b539d6034f7d8b6d..6b718e01c31242995051a2a1a8e4cfc0d29690b8 100644 (file)
@@ -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 {
index e9a21e1b055cc7bbcd1979354aaf3ff4e501451e..6895349b20747ba0eba6950457bf2c23d3bbbcb2 100644 (file)
@@ -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<std::string> get_env(const std::string & name);
+std::optional<std::string> get_env_as_lowercase(const std::string & name);
 bool                       parse_bool(const std::string & value);
 int                        parse_integer(const std::string & value);