Skip to content

Commit 853dade

Browse files
committed
CANN: add Comments
1 parent 9fe1150 commit 853dade

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ggml/src/ggml-cann/ggml-cann.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2092,6 +2092,16 @@ static bool ggml_backend_cann_cpy_tensor_async(
20922092
ACL_CHECK(aclrtMemcpyAsync(dst->data, copy_size, src->data, copy_size,
20932093
ACL_MEMCPY_DEVICE_TO_DEVICE,
20942094
cann_ctx_src->stream()));
2095+
// record event on src stream after the copy
2096+
// TODO: this event is not effective with acl graph mode, change to use aclrtSynchronizeStream
2097+
// if (!cann_ctx_src->copy_event) {
2098+
// ACL_CHECK(aclrtCreateEventWithFlag(&cann_ctx_src->copy_event, ACL_EVENT_SYNC));
2099+
// }
2100+
// ACL_CHECK(aclrtRecordEvent(cann_ctx_src->copy_event, cann_ctx_src->stream()));
2101+
2102+
// // wait on dst stream for the copy to complete
2103+
// ggml_cann_set_device(cann_ctx_dst->device);
2104+
// ACL_CHECK(aclrtStreamWaitEvent(cann_ctx_dst->stream(), cann_ctx_src->copy_event));
20952105
ACL_CHECK(aclrtSynchronizeStream(cann_ctx_src->stream()));
20962106
} else {
20972107
// src and dst are on the same backend

0 commit comments

Comments
 (0)