Fix simple P2P test, had device ptrs swapped

[ROCm/hip commit: 4d394694ae]
此提交包含在:
Ben Sander
2016-04-08 09:22:24 -05:00
父節點 6fafe64cb0
當前提交 b98a6bd1cd
+5 -5
查看文件
@@ -52,12 +52,12 @@ int main(int argc, char *argv[])
HIPCHECK(hipDeviceEnablePeerAccess(peerDevice, 0));
size_t Nbytes = N*sizeof(float);
size_t Nbytes = N*sizeof(char);
float *A_d0, *A_d1;
float *A_h;
char *A_d0, *A_d1;
char *A_h;
A_h = (float*)malloc(Nbytes);
A_h = (char*)malloc(Nbytes);
HIPCHECK (hipSetDevice(peerDevice));
HIPCHECK (hipMalloc(&A_d1, Nbytes) );
@@ -70,7 +70,7 @@ int main(int argc, char *argv[])
HIPCHECK ( hipMemset(A_d0, memsetval, Nbytes) );
// Device0 push to device1, using P2P:
HIPCHECK ( hipMemcpy(A_d0, A_d1, Nbytes, hipMemcpyDefault));
HIPCHECK ( hipMemcpy(A_d1, A_d0, Nbytes, hipMemcpyDefault));
// Copy data back to host:
HIPCHECK ( hipMemcpy(A_h, A_d1, Nbytes, hipMemcpyDeviceToHost));