diff --git a/operator/ascendc/0_introduction/25_simple_add/add_custom.asc b/operator/ascendc/0_introduction/25_simple_add/add_custom.asc index 544e134f30e469577d839d112157425935cb9ab1..2e1cb90b933a30e634ddd2f385ba485ed92c9dc4 100644 --- a/operator/ascendc/0_introduction/25_simple_add/add_custom.asc +++ b/operator/ascendc/0_introduction/25_simple_add/add_custom.asc @@ -127,7 +127,7 @@ std::vector kernel_add(std::vector &x, std::vector &y) aclrtSynchronizeStream(stream); aclrtMemcpy(zHost, totalByteSize, zDevice, totalByteSize, ACL_MEMCPY_DEVICE_TO_HOST); - std::vector z((float *)zHost, (float *)(zHost + totalLength)); + std::vector z((float *)zHost, (float *)(zHost + totalByteSize)); aclrtFree(xDevice); aclrtFree(yDevice); @@ -155,7 +155,7 @@ uint32_t VerifyResult(std::vector &output, std::vector &golden) }; printTensor(output, "Output"); printTensor(golden, "Golden"); - if (std::equal(output.begin(), output.end(), golden.begin())) { + if (std::equal(golden.begin(), golden.end(), output.begin())) { std::cout << "[Success] Case accuracy is verification passed." << std::endl; return 0; } else {