Skip to content

Commit 904837e

Browse files
authored
cann: fix crash when llama-bench is running on multiple cann devices (#9627)
1 parent 70392f1 commit 904837e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ggml/src/ggml-cann/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ struct ggml_backend_cann_context {
227227
* @brief Destructor for cleaning up resources.
228228
*/
229229
~ggml_backend_cann_context() {
230+
ggml_cann_set_device(device);
230231
if (copy_event != nullptr) {
231232
ACL_CHECK(aclrtDestroyEvent(copy_event));
232233
}

0 commit comments

Comments
 (0)