cann: fix crash when llama-bench is running on multiple cann devices (#9627)

This commit is contained in:
Dou Xinpeng 2024-09-25 11:30:38 +08:00 committed by GitHub
parent 70392f1f81
commit 904837e0cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -227,6 +227,7 @@ struct ggml_backend_cann_context {
* @brief Destructor for cleaning up resources.
*/
~ggml_backend_cann_context() {
ggml_cann_set_device(device);
if (copy_event != nullptr) {
ACL_CHECK(aclrtDestroyEvent(copy_event));
}