Following the API calls, add exception handling branches and specify log printing of error and information levels. The following is a code snippet of key steps only, which is not ready to be built or run.
#include "acl/acl.h" // ...... //Explicitly create a stream. aclrtStream stream; aclrtCreateStream(&stream); //Pass the stream argument to the task triggering call. aclrtMemcpyAsync(dstPtr, dstSize, srcPtr, srcSize, ACL_MEMCPY_HOST_TO_DEVICE, stream); //Call aclrtSynchronizeStream to wait for the stream tasks to complete. aclrtSynchronizeStream(stream); //Explicitly destroy the stream after using the stream. aclrtDestroyStream(stream); // ......