]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
CANN: Optimize ggml_cann_set_device (#15935)
authorChenguang Li <redacted>
Wed, 17 Sep 2025 06:33:08 +0000 (14:33 +0800)
committerGitHub <redacted>
Wed, 17 Sep 2025 06:33:08 +0000 (14:33 +0800)
commitd5fabe3682de515fd09d6c981f7a0d1b75614455
tree7f89976d008da0f5e0b6b8c3f4680baa5e11e5a1
parent8ff206097c2bf3ca1c7aa95f9d6db779fc7bdd68
CANN: Optimize ggml_cann_set_device (#15935)

* CANN: Fix ggml_cann_set_device to avoid redundant device switches

- Added a check to skip aclrtSetDevice if the current device is already set.
- Prevents unnecessary context switches while keeping thread/device consistency.

* CANN: add device default id
ggml/src/ggml-cann/common.h
ggml/src/ggml-cann/ggml-cann.cpp