]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
CANN: Optimize ggml_cann_set_device (llama/15935)
authorChenguang Li <redacted>
Wed, 17 Sep 2025 06:33:08 +0000 (14:33 +0800)
committerGeorgi Gerganov <redacted>
Sat, 20 Sep 2025 10:45:30 +0000 (13:45 +0300)
commite32c3b0fd3f0ea16b93d9183f62d7e04ee42ec66
tree35db29bd1f41295a70b217cecb988914c426a01f
parent5c524bb8790b9ce92b3c9338154d8d243c620b5e
CANN: Optimize ggml_cann_set_device (llama/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