SWDEV-209747 - Staging Copy will not be supported in HIP, adjust test case accordingly.

Change-Id: Iad616ef3990d539cdb82bbd8a22ea2124f7abe50


[ROCm/hip commit: 04b58e6e50]
This commit is contained in:
kjayapra-amd
2020-06-22 19:26:54 -04:00
committed by Karthik Jayaprakash
parent a6c83e443c
commit b32c033585
5 changed files with 35 additions and 5 deletions
+8 -4
View File
@@ -39,6 +39,9 @@ int main() {
HIPCHECK(hipGetDeviceCount(&numDevices));
if (numDevices > 1) {
int canAccessPeer = 0;
hipDeviceCanAccessPeer(&canAccessPeer, 0, 1);
if (canAccessPeer) {
HIPCHECK(hipSetDevice(0));
unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N);
HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, N, false);
@@ -47,23 +50,21 @@ int main() {
HIPCHECK(hipMalloc(&Y_d, Nbytes));
HIPCHECK(hipMalloc(&Z_d, Nbytes));
HIPCHECK(hipSetDevice(0));
HIPCHECK(hipMemcpy(A_d, A_h, Nbytes, hipMemcpyHostToDevice));
HIPCHECK(hipMemcpy(B_d, B_h, Nbytes, hipMemcpyHostToDevice));
hipLaunchKernelGGL(HipTest::vectorADD, dim3(blocks), dim3(threadsPerBlock), 0, 0,
static_cast<const int*>(A_d), static_cast<const int*>(B_d), C_d, N);
static_cast<const int*>(A_d), static_cast<const int*>(B_d), C_d, N);
HIPCHECK(hipMemcpy(C_h, C_d, Nbytes, hipMemcpyDeviceToHost));
HIPCHECK(hipDeviceSynchronize());
HipTest::checkVectorADD(A_h, B_h, C_h, N);
HIPCHECK(hipSetDevice(1));
HIPCHECK(hipMemcpyDtoD((hipDeviceptr_t)X_d, (hipDeviceptr_t)A_d, Nbytes));
HIPCHECK(hipMemcpyDtoD((hipDeviceptr_t)Y_d, (hipDeviceptr_t)B_d, Nbytes));
hipLaunchKernelGGL(HipTest::vectorADD, dim3(blocks), dim3(threadsPerBlock), 0, 0,
static_cast<const int*>(X_d), static_cast<const int*>(Y_d), Z_d, N);
static_cast<const int*>(X_d), static_cast<const int*>(Y_d), Z_d, N);
HIPCHECK(hipMemcpyDtoH(C_h, (hipDeviceptr_t)Z_d, Nbytes));
HIPCHECK(hipDeviceSynchronize());
HipTest::checkVectorADD(A_h, B_h, C_h, N);
@@ -72,6 +73,9 @@ int main() {
HIPCHECK(hipFree(X_d));
HIPCHECK(hipFree(Y_d));
HIPCHECK(hipFree(Z_d));
} else {
std::cout<<"Machine does not seem to have P2P Capabilities, Empty Pass"<<std::endl;
}
}
passed();
+7
View File
@@ -40,6 +40,10 @@ int main() {
HIPCHECK(hipGetDeviceCount(&numDevices));
if (numDevices > 1) {
int canAccessPeer = 0;
hipDeviceCanAccessPeer(&canAccessPeer, 0, 1);
if (canAccessPeer) {
HIPCHECK(hipSetDevice(0));
unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N);
HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, N, false);
@@ -75,6 +79,9 @@ int main() {
HIPCHECK(hipFree(X_d));
HIPCHECK(hipFree(Y_d));
HIPCHECK(hipFree(Z_d));
} else {
std::cout<<"Machine does not seem to have P2P Capabilities, Empty Pass"<<std::endl;
}
}
passed();
+6
View File
@@ -39,6 +39,9 @@ int main() {
HIPCHECK(hipGetDeviceCount(&numDevices));
if (numDevices > 1) {
int canAccessPeer = 0;
hipDeviceCanAccessPeer(&canAccessPeer, 0, 1);
if (canAccessPeer) {
HIPCHECK(hipSetDevice(0));
unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N);
HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, N, false);
@@ -72,6 +75,9 @@ int main() {
HIPCHECK(hipFree(X_d));
HIPCHECK(hipFree(Y_d));
HIPCHECK(hipFree(Z_d));
} else {
std::cout<<"Machine does not seem to have P2P Capabilities, Empty Pass"<<std::endl;
}
}
passed();
}
+7
View File
@@ -42,6 +42,10 @@ int main() {
HIPCHECK(hipGetDeviceCount(&numDevices));
if (numDevices > 1) {
int canAccessPeer = 0;
hipDeviceCanAccessPeer(&canAccessPeer, 0, 1);
if (canAccessPeer) {
HIPCHECK(hipSetDevice(0));
unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N);
HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, N, false);
@@ -77,6 +81,9 @@ int main() {
HIPCHECK(hipFree(X_d));
HIPCHECK(hipFree(Y_d));
HIPCHECK(hipFree(Z_d));
} else {
std::cout<<"Machine does not seem to have P2P Capabilities, Empty Pass"<<std::endl;
}
}
passed();
+7 -1
View File
@@ -272,7 +272,6 @@ void HipMemcpyWithStreamtests::TestkindDtoD(void) {
size_t Nbytes = N * sizeof(int);
int numDevices = 0;
unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N);
HIPCHECK(hipGetDeviceCount(&numDevices));
// If you have single GPU machine the return
@@ -280,6 +279,13 @@ void HipMemcpyWithStreamtests::TestkindDtoD(void) {
return;
}
int canAccessPeer = 0;
hipDeviceCanAccessPeer(&canAccessPeer, 0, 1);
if (!canAccessPeer) {
std::cout<<"Machine does not seem to have P2P Capabilities"<<std::endl;
return;
}
int *A_d[numDevices], *B_d[numDevices], *C_d[numDevices];
int *A_h[numDevices], *B_h[numDevices], *C_h[numDevices];