Fix simple P2P test, had device ptrs swapped

Dieser Commit ist enthalten in:
Ben Sander
2016-04-08 09:22:24 -05:00
Ursprung 034bf3d31c
Commit fcd1d37ff7
+5 -5
Datei anzeigen
@@ -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));