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]
Tá an tiomantas seo le fáil i:
tiomanta ag
GitHub
tuismitheoir
825bd9b2ce
tiomantas
1c54135503
@@ -316,7 +316,7 @@ TEST_CASE("Unit_hipGraph_BasicFunctional") {
|
||||
INFO("Elements : " << size << " ThreadsPerBlock : " << THREADS_PER_BLOCK);
|
||||
INFO("Graph Launch iterations = " << GRAPH_LAUNCH_ITERATIONS);
|
||||
|
||||
hipSetDevice(0);
|
||||
HIP_CHECK(hipSetDevice(0));
|
||||
inputVec_h = reinterpret_cast<float*>(malloc(sizeof(float) * size));
|
||||
REQUIRE(inputVec_h != nullptr);
|
||||
HIP_CHECK(hipMalloc(&inputVec_d, sizeof(float) * size));
|
||||
|
||||
@@ -161,12 +161,12 @@ TEST_CASE("Unit_hipGraphAddMemcpyNode_Negative") {
|
||||
myparams.dstArray = devArray2;
|
||||
ret = hipGraphAddMemcpyNode(&memcpyNode, graph, nullptr, 0, &myparams);
|
||||
REQUIRE(hipErrorInvalidValue == ret);
|
||||
hipFreeArray(devArray2);
|
||||
HIP_CHECK(hipFreeArray(devArray2));
|
||||
}
|
||||
|
||||
HIP_CHECK(hipGraphDestroy(graph));
|
||||
HIP_CHECK(hipStreamDestroy(streamForGraph));
|
||||
hipFreeArray(devArray1);
|
||||
HIP_CHECK(hipFreeArray(devArray1));
|
||||
free(hData);
|
||||
free(hOutputData);
|
||||
}
|
||||
@@ -268,8 +268,8 @@ static void validateMemcpyNode3DArray(bool peerAccess = false) {
|
||||
HIP_CHECK(hipGraphExecDestroy(graphExec));
|
||||
HIP_CHECK(hipGraphDestroy(graph));
|
||||
HIP_CHECK(hipStreamDestroy(streamForGraph));
|
||||
hipFreeArray(devArray1);
|
||||
hipFreeArray(devArray2);
|
||||
HIP_CHECK(hipFreeArray(devArray1));
|
||||
HIP_CHECK(hipFreeArray(devArray2));
|
||||
free(hData);
|
||||
free(hOutputData);
|
||||
}
|
||||
@@ -369,8 +369,8 @@ static void validateMemcpyNode2DArray(bool peerAccess = false) {
|
||||
HIP_CHECK(hipGraphExecDestroy(graphExec));
|
||||
HIP_CHECK(hipGraphDestroy(graph));
|
||||
HIP_CHECK(hipStreamDestroy(streamForGraph));
|
||||
hipFreeArray(devArray1);
|
||||
hipFreeArray(devArray2);
|
||||
HIP_CHECK(hipFreeArray(devArray1));
|
||||
HIP_CHECK(hipFreeArray(devArray2));
|
||||
}
|
||||
|
||||
static void validateMemcpyNode1DArray(bool peerAccess = false) {
|
||||
@@ -464,8 +464,8 @@ static void validateMemcpyNode1DArray(bool peerAccess = false) {
|
||||
HIP_CHECK(hipGraphExecDestroy(graphExec));
|
||||
HIP_CHECK(hipGraphDestroy(graph));
|
||||
HIP_CHECK(hipStreamDestroy(streamForGraph));
|
||||
hipFreeArray(devArray1);
|
||||
hipFreeArray(devArray2);
|
||||
HIP_CHECK(hipFreeArray(devArray1));
|
||||
HIP_CHECK(hipFreeArray(devArray2));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -144,8 +144,8 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Negative") {
|
||||
}
|
||||
HIP_CHECK(hipGraphExecDestroy(graphExec));
|
||||
HIP_CHECK(hipGraphDestroy(graph));
|
||||
hipFreeArray(devArray);
|
||||
hipFreeArray(devArray2);
|
||||
HIP_CHECK(hipFreeArray(devArray));
|
||||
HIP_CHECK(hipFreeArray(devArray2));
|
||||
free(hData);
|
||||
}
|
||||
|
||||
@@ -254,6 +254,6 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Functional") {
|
||||
HIP_CHECK(hipGraphExecDestroy(graphExec));
|
||||
HIP_CHECK(hipGraphDestroy(graph));
|
||||
HIP_CHECK(hipStreamDestroy(streamForGraph));
|
||||
hipFreeArray(devArray1);
|
||||
hipFreeArray(devArray2);
|
||||
HIP_CHECK(hipFreeArray(devArray1));
|
||||
HIP_CHECK(hipFreeArray(devArray2));
|
||||
}
|
||||
|
||||
@@ -347,7 +347,7 @@ TEST_CASE("Unit_hipGraphRemoveDependencies_ChangeComputeFunc") {
|
||||
kernelNodeParams.extra = nullptr;
|
||||
HIP_CHECK(hipGraphAddKernelNode(&kernel_square, graph, nullptr, 0,
|
||||
&kernelNodeParams));
|
||||
hipGraphRemoveDependencies(graph, &memcpyH2D_B, &kernel_vecAdd, 1);
|
||||
HIP_CHECK(hipGraphRemoveDependencies(graph, &memcpyH2D_B, &kernel_vecAdd, 1));
|
||||
// Add new dependencies
|
||||
HIP_CHECK(hipGraphAddDependencies(graph, &memcpyH2D_B, &kernel_square, 1));
|
||||
HIP_CHECK(hipGraphAddDependencies(graph, &kernel_square,
|
||||
|
||||
@@ -60,18 +60,18 @@ static void hipTestWithGraph() {
|
||||
hipGraph_t graph;
|
||||
hipGraphExec_t instance;
|
||||
|
||||
hipStreamBeginCapture(stream, hipStreamCaptureModeGlobal);
|
||||
HIP_CHECK(hipStreamBeginCapture(stream, hipStreamCaptureModeGlobal));
|
||||
for (int ikrnl = 0; ikrnl < NKERNEL; ikrnl++) {
|
||||
simpleKernel<<<dim3(N / 512, 1, 1), dim3(512, 1, 1),
|
||||
0, stream>>>(out_d, in_d);
|
||||
}
|
||||
hipStreamEndCapture(stream, &graph);
|
||||
hipGraphInstantiate(&instance, graph, nullptr, nullptr, 0);
|
||||
HIP_CHECK(hipStreamEndCapture(stream, &graph));
|
||||
HIP_CHECK(hipGraphInstantiate(&instance, graph, nullptr, nullptr, 0));
|
||||
|
||||
auto start1 = std::chrono::high_resolution_clock::now();
|
||||
for (int istep = 0; istep < NSTEP; istep++) {
|
||||
hipGraphLaunch(instance, stream);
|
||||
hipStreamSynchronize(stream);
|
||||
HIP_CHECK(hipGraphLaunch(instance, stream));
|
||||
HIP_CHECK(hipStreamSynchronize(stream));
|
||||
}
|
||||
auto stop = std::chrono::high_resolution_clock::now();
|
||||
auto withInit = std::chrono::duration<double, std::milli>(stop - start);
|
||||
|
||||
Tagairt in Eagrán Nua
Cuir bac ar úsáideoir