SWDEV-353807 - Fixes multiple catch issues (#2912)
- enforcing c++17 for all tests - Warning as error: ignoring return value Change-Id: I3d171540403f74222e631d1a8e393386461c9729
This commit is contained in:
committed by
GitHub
parent
ba5a0b9af5
commit
d0aaed906d
@@ -495,10 +495,10 @@ TEST_CASE("Unit_hipStreamPerThread_CoopLaunchMDev") {
|
||||
|
||||
// Calculate the device occupancy to know how many blocks can be
|
||||
// run concurrently
|
||||
hipGetDeviceProperties(&deviceProp[i], 0);
|
||||
HIP_CHECK(hipGetDeviceProperties(&deviceProp[i], 0));
|
||||
if (!deviceProp[i].cooperativeMultiDeviceLaunch) {
|
||||
WARN("Device doesn't support cooperative launch!");
|
||||
SUCCEED("");
|
||||
return;
|
||||
}
|
||||
size_t SIZE = copySizeInDwords * sizeof(uint);
|
||||
|
||||
@@ -511,7 +511,7 @@ TEST_CASE("Unit_hipStreamPerThread_CoopLaunchMDev") {
|
||||
}
|
||||
HIPCHECK(hipMemcpy(dA[i], &init[i * copySizeInDwords] , SIZE,
|
||||
hipMemcpyHostToDevice));
|
||||
hipDeviceSynchronize();
|
||||
HIP_CHECK(hipDeviceSynchronize());
|
||||
}
|
||||
|
||||
dim3 dimBlock;
|
||||
@@ -560,7 +560,7 @@ TEST_CASE("Unit_hipStreamPerThread_CoopLaunchMDev") {
|
||||
}
|
||||
|
||||
system_clock::time_point start = system_clock::now();
|
||||
hipLaunchCooperativeKernelMultiDevice(launchParamsList, nGpu, 0);
|
||||
HIP_CHECK(hipLaunchCooperativeKernelMultiDevice(launchParamsList, nGpu, 0));
|
||||
for (int i = 0; i < nGpu; i++) {
|
||||
HIP_CHECK(hipSetDevice(i));
|
||||
HIP_CHECK(hipDeviceSynchronize());
|
||||
@@ -586,11 +586,11 @@ TEST_CASE("Unit_hipStreamPerThread_CoopLaunchMDev") {
|
||||
WARN("finished computation at " << std::ctime(&end_time));
|
||||
WARN("elapsed time: " << time << "s\n");
|
||||
|
||||
hipSetDevice(0);
|
||||
hipFree(dC);
|
||||
HIP_CHECK(hipSetDevice(0));
|
||||
HIP_CHECK(hipFree(dC));
|
||||
for (int i = 0; i < nGpu; i++) {
|
||||
hipFree(dA[i]);
|
||||
hipFree(dB[i]);
|
||||
HIP_CHECK(hipFree(dA[i]));
|
||||
HIP_CHECK(hipFree(dB[i]));
|
||||
}
|
||||
delete [] init;
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@ static void Copy_to_device() {
|
||||
for(unsigned int i = 0; i < ele_size; ++i) {
|
||||
A_h[i] = 123;
|
||||
}
|
||||
hipMemcpyAsync(A_d, A_h, ele_size * sizeof(int), hipMemcpyHostToDevice,
|
||||
hipStreamPerThread);
|
||||
HIP_CHECK(hipMemcpyAsync(A_d, A_h, ele_size * sizeof(int), hipMemcpyHostToDevice,
|
||||
hipStreamPerThread));
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hipStreamPerThread_DeviceReset_1") {
|
||||
@@ -80,9 +80,9 @@ TEST_CASE("Unit_hipStreamPerThread_DeviceReset_2") {
|
||||
status = hipMemcpyAsync(A_d, A_h, ele_size * sizeof(int), hipMemcpyHostToDevice,
|
||||
hipStreamPerThread);
|
||||
if (status != hipSuccess) return;
|
||||
hipStreamSynchronize(hipStreamPerThread);
|
||||
HIP_CHECK(hipStreamSynchronize(hipStreamPerThread));
|
||||
|
||||
hipDeviceReset();
|
||||
HIP_CHECK(hipDeviceReset());
|
||||
|
||||
// After reset all memory objects will be destroyed hence allocating them again
|
||||
// Intension is to use hipStreamPerThread successfully after reset hence not validating
|
||||
@@ -95,5 +95,5 @@ TEST_CASE("Unit_hipStreamPerThread_DeviceReset_2") {
|
||||
status = hipMemcpyAsync(A_d, A_h, ele_size * sizeof(int), hipMemcpyHostToDevice,
|
||||
hipStreamPerThread);
|
||||
if (status != hipSuccess) return;
|
||||
hipStreamSynchronize(hipStreamPerThread);
|
||||
HIP_CHECK(hipStreamSynchronize(hipStreamPerThread));
|
||||
}
|
||||
|
||||
@@ -26,14 +26,14 @@ static void Copy_to_device() {
|
||||
int* A_h = nullptr;
|
||||
int* A_d = nullptr;
|
||||
|
||||
hipHostMalloc(&A_h, ele_size*sizeof(int));
|
||||
hipMalloc(&A_d, ele_size * sizeof(int));
|
||||
HIP_CHECK(hipHostMalloc(&A_h, ele_size*sizeof(int)));
|
||||
HIP_CHECK(hipMalloc(&A_d, ele_size * sizeof(int)));
|
||||
|
||||
for (unsigned int i = 0; i < ele_size; ++i) {
|
||||
A_h[i] = 123;
|
||||
}
|
||||
hipMemcpyAsync(A_d, A_h, ele_size * sizeof(int), hipMemcpyHostToDevice,
|
||||
hipStreamPerThread);
|
||||
HIP_CHECK(hipMemcpyAsync(A_d, A_h, ele_size * sizeof(int), hipMemcpyHostToDevice,
|
||||
hipStreamPerThread));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user