SWDEV-353807 - Fixes multiple catch issues (#2912)

- enforcing c++17 for all tests
- Warning as error: ignoring return value

Change-Id: I3d171540403f74222e631d1a8e393386461c9729


[ROCm/hip commit: 87c69c5759]
此提交包含在:
ROCm CI Service Account
2022-08-31 05:23:21 +05:30
提交者 GitHub
父節點 825bd9b2ce
當前提交 1c54135503
共有 24 個檔案被更改,包括 100 行新增99 行删除
+1 -1
查看文件
@@ -33,7 +33,7 @@ __global__ void warpvote(int* device_any, int* device_all, int pshift) {
TEST_CASE("Unit_AnyAll_CompileTest") {
int warpSize, pshift;
hipDeviceProp_t devProp;
hipGetDeviceProperties(&devProp, 0);
HIP_CHECK(hipGetDeviceProperties(&devProp, 0));
warpSize = devProp.warpSize;
int w = warpSize;
+12 -12
查看文件
@@ -411,7 +411,7 @@ static bool TestAllocInAllThread(int test_type,
break;
}
}
hipFree(outputVec_d);
HIP_CHECK(hipFree(outputVec_d));
free(outputVec_h);
return bPassed;
}
@@ -443,7 +443,7 @@ static bool TestMemoryAccessInAllThread(int test_type, int thread_idx) {
break;
}
}
hipFree(outputVec_d);
HIP_CHECK(hipFree(outputVec_d));
free(outputVec_h);
return bPassed;
}
@@ -502,7 +502,7 @@ static bool TestMemoryAcrossMulKernels(int test_type,
break;
}
}
hipFree(outputVec_d);
HIP_CHECK(hipFree(outputVec_d));
free(outputVec_h);
return bPassed;
}
@@ -562,7 +562,7 @@ static bool TestDevMemAllocMulKerMulThrd(int test_type) {
break;
}
}
hipFree(outputVec_d);
HIP_CHECK(hipFree(outputVec_d));
free(outputVec_h);
return bPassed;
}
@@ -592,7 +592,7 @@ static bool TestMemoryAccessInAllThread_CmplxStr(int test_type) {
break;
}
}
hipFree(result_d);
HIP_CHECK(hipFree(result_d));
free(result_h);
return bPassed;
}
@@ -648,7 +648,7 @@ static bool TestMemoryAccessInAllThread_Union(int test_type) {
}
if (bPassed == false) break;
}
hipFree(outputVec_d);
HIP_CHECK(hipFree(outputVec_d));
free(outputVec_h);
return bPassed;
}
@@ -706,7 +706,7 @@ static bool TestAlloc_Load_SingleKer_AllocFree(int test_type,
}
HIP_CHECK(hipModuleUnload(Module));
HIP_CHECK(hipStreamDestroy(stream));
hipFree(outputVec_d);
HIP_CHECK(hipFree(outputVec_d));
free(outputVec_h);
return bPassed;
}
@@ -808,8 +808,8 @@ static bool TestAlloc_Load_MultKernels(int test_type,
HIP_CHECK(hipModuleUnload(ModuleWrite));
HIP_CHECK(hipModuleUnload(ModuleFree));
HIP_CHECK(hipStreamDestroy(stream));
hipFree(dev_addr);
hipFree(outputVec_d);
HIP_CHECK(hipFree(dev_addr));
HIP_CHECK(hipFree(outputVec_d));
free(outputVec_h);
return bPassed;
}
@@ -895,7 +895,7 @@ static bool TestMemoryAcrossMulKernelsUsingGraph(int test_type) {
}
HIP_CHECK(hipStreamDestroy(streamForGraph));
HIP_CHECK(hipGraphExecDestroy(graphExec));
hipFree(outputVec_d);
HIP_CHECK(hipFree(outputVec_d));
free(outputVec_h);
return bPassed;
}
@@ -924,7 +924,7 @@ static bool TestAllocInDeviceFunc(int test_type) {
break;
}
}
hipFree(outputVec_d);
HIP_CHECK(hipFree(outputVec_d));
free(outputVec_h);
return bPassed;
}
@@ -1367,7 +1367,7 @@ TEST_CASE("Unit_deviceAllocation_VirtualFunction") {
}
}
REQUIRE(true == bPassed);
hipFree(outputVec_d);
HIP_CHECK(hipFree(outputVec_d));
free(outputVec_h);
}
+4 -4
查看文件
@@ -114,16 +114,16 @@ TEST_CASE("Unit_unsafeAtomicAdd") {
void* config_d[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, &args_d, HIP_LAUNCH_PARAM_BUFFER_SIZE,
&size_d, HIP_LAUNCH_PARAM_END};
hipModuleLaunchKernel(f_kernel, 10, 1, 1, 100, 1, 1, 0, nullptr, nullptr, config_f);
hipModuleLaunchKernel(d_kernel, 10, 1, 1, 100, 1, 1, 0, nullptr, nullptr, config_d);
HIP_CHECK(hipModuleLaunchKernel(f_kernel, 10, 1, 1, 100, 1, 1, 0, nullptr, nullptr, config_f));
HIP_CHECK(hipModuleLaunchKernel(d_kernel, 10, 1, 1, 100, 1, 1, 0, nullptr, nullptr, config_d));
float res_f = 0.0f;
double res_d = 0.0;
HIP_CHECK(hipMemcpy(&res_f, fX, sizeof(float), hipMemcpyDeviceToHost));
HIP_CHECK(hipMemcpy(&res_d, dX, sizeof(double), hipMemcpyDeviceToHost));
hipFree(dX);
hipFree(fX);
HIP_CHECK(hipFree(dX));
HIP_CHECK(hipFree(fX));
HIP_CHECK(hipModuleUnload(module));