Skip to content

Commit 87db860

Browse files
bachelor-douMinh141120
authored andcommitted
CANN: Simplify the environment variable setting(ggml-org#13104)
* Simplify the environment variable setting to specify the memory pool type. * Adjust the GGML_CANN_ASYNC_MODE setting to accept yes, enable, 1, or on (case-insensitive) as valid options. * update * fix CI * update * delete whitespace * fix according to review * update CANN.md * update CANN.md
1 parent 25febe5 commit 87db860

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ggml/src/ggml-cann/common.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <unistd.h>
3939
#include <functional>
4040
#include <optional>
41+
#include <optional>
4142

4243
#include "../include/ggml-cann.h"
4344
#include "../include/ggml.h"
@@ -359,7 +360,7 @@ struct ggml_backend_cann_context {
359360
ggml_cann_set_device(device);
360361
description = aclrtGetSocName();
361362

362-
async_mode = parse_bool(get_env("GGML_CANN_ASYNC_MODE").value_or(""));
363+
bool async_mode = parse_bool(get_env("GGML_CANN_ASYNC_MODE").value_or(""));
363364
GGML_LOG_INFO("%s: device %d async operator submission is %s\n", __func__,
364365
device, async_mode ? "ON" : "OFF");
365366
}

0 commit comments

Comments
 (0)