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

This commit is contained in:
douxinpeng 2024-09-24 12:44:50 +00:00
parent 70392f1f81
commit 4814bdff53

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));
}