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

This commit is contained in:
Dou Xinpeng
2024-10-03 12:22:17 +03:00
committed by Georgi Gerganov
parent bb57ecb85e
commit 96808786b7
+1
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));
}