SWDEV-279486 - Fix hipMemcpyPeer/hipMemcpy APIs

Addresses the scenarios when the size passed is more than
the allocated size and when the deviceid is invalid
Change-Id: I6c9b62639096f655ffb61976905b1ce8c5f51ee7

Change-Id: I8a0d660924a8e2300c517aba6f9088626b8f6ef5
This commit is contained in:
Satyanvesh Dittakavi
2021-04-06 06:37:14 -07:00
parent 865ecc64af
commit 68161ff0dd
3 changed files with 19 additions and 1 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ hipError_t single_process(int32_t offset) {
ipc_offset_handle, 0));
// Copy Values from Device to Host and Check for correctness
HIPCHECK_RETURN_ONFAIL(hipMemcpy(ipc_out_hptr, ipc_out_dptr, (NUM * sizeof(int)), hipMemcpyDeviceToHost));
HIPCHECK_RETURN_ONFAIL(hipMemcpy(ipc_out_hptr, ipc_out_dptr, ((NUM-offset) * sizeof(int)), hipMemcpyDeviceToHost));
for (size_t idx = offset; idx < NUM; ++idx) {
if (ipc_out_hptr[idx-offset] != ipc_dptr[idx]) {
std::cout<<"Failing @ idx: "<<idx<<std::endl;