]> git.djapps.eu Git - pkg/ggml/sources/ggml/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:33:50 +0000 (13:33 +0300)
commitdcc6c4ae827320996a5017162c3288b1d73b6d3d
tree964486e13152c73b77cc9f4f5281dc8b57cafbf6
parentfb1b09fe04c039788d5e814c0d55715ef108da73
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
src/ggml-cann/common.h
src/ggml-cann/ggml-cann.cpp