SWDEV-353807 - Fixes multiple catch issues (#2912)
- enforcing c++17 for all tests - Warning as error: ignoring return value Change-Id: I3d171540403f74222e631d1a8e393386461c9729
이 커밋은 다음에 포함됨:
@@ -66,13 +66,13 @@ TEST_CASE("Unit_hipBindTexture2D_Pitch") {
|
||||
|
||||
hipLaunchKernelGGL(texture2dCopyKernel, dim3(4, 4, 1), dim3(32, 32, 1),
|
||||
0, 0, devPtrB);
|
||||
hipDeviceSynchronize();
|
||||
HIP_CHECK(hipDeviceSynchronize());
|
||||
HIP_CHECK(hipMemcpy2D(B, SIZE_W*sizeof(TYPE_t), devPtrB,
|
||||
SIZE_W*sizeof(TYPE_t), SIZE_W*sizeof(TYPE_t),
|
||||
SIZE_H, hipMemcpyDeviceToHost));
|
||||
HipTest::checkArray(A, B, SIZE_H, SIZE_W);
|
||||
delete []A;
|
||||
delete []B;
|
||||
hipFree(devPtrA);
|
||||
hipFree(devPtrB);
|
||||
HIP_CHECK(hipFree(devPtrA));
|
||||
HIP_CHECK(hipFree(devPtrB));
|
||||
}
|
||||
|
||||
@@ -93,6 +93,6 @@ TEMPLATE_TEST_CASE("Unit_hipTexObjPitch_texture2D", "", float, int,
|
||||
HipTest::checkArray(A, B, SIZE_H, SIZE_W);
|
||||
delete []A;
|
||||
delete []B;
|
||||
hipFree(devPtrA);
|
||||
hipFree(devPtrB);
|
||||
HIP_CHECK(hipFree(devPtrA));
|
||||
HIP_CHECK(hipFree(devPtrB));
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ void runTest(const int width, const float offsetX) {
|
||||
hipChannelFormatDesc channelDesc = hipCreateChannelDesc(
|
||||
32, 0, 0, 0, hipChannelFormatKindFloat);
|
||||
hipArray *hipArray;
|
||||
hipMallocArray(&hipArray, &channelDesc, width);
|
||||
HIP_CHECK(hipMallocArray(&hipArray, &channelDesc, width));
|
||||
|
||||
HIP_CHECK(hipMemcpy2DToArray(hipArray, 0, 0, hData, width * sizeof(float), width * sizeof(float), 1, hipMemcpyHostToDevice));
|
||||
|
||||
@@ -66,7 +66,7 @@ void runTest(const int width, const float offsetX) {
|
||||
HIP_CHECK(hipCreateTextureObject(&textureObject, &resDesc, &texDesc, NULL));
|
||||
|
||||
float *dData = nullptr;
|
||||
hipMalloc((void**) &dData, size);
|
||||
HIP_CHECK(hipMalloc((void**) &dData, size));
|
||||
|
||||
dim3 dimBlock(16, 1, 1);
|
||||
dim3 dimGrid((width + dimBlock.x - 1)/ dimBlock.x, 1, 1);
|
||||
@@ -74,11 +74,11 @@ void runTest(const int width, const float offsetX) {
|
||||
hipLaunchKernelGGL(tex1DKernel<normalizedCoords>, dimGrid, dimBlock, 0, 0, dData,
|
||||
textureObject, width, offsetX);
|
||||
|
||||
hipDeviceSynchronize();
|
||||
HIP_CHECK(hipDeviceSynchronize());
|
||||
|
||||
float *hOutputData = (float*) malloc(size);
|
||||
memset(hOutputData, 0, size);
|
||||
hipMemcpy(hOutputData, dData, size, hipMemcpyDeviceToHost);
|
||||
HIP_CHECK(hipMemcpy(hOutputData, dData, size, hipMemcpyDeviceToHost));
|
||||
|
||||
bool result = true;
|
||||
for (int j = 0; j < width; j++) {
|
||||
@@ -91,9 +91,9 @@ void runTest(const int width, const float offsetX) {
|
||||
}
|
||||
}
|
||||
|
||||
hipDestroyTextureObject(textureObject);
|
||||
hipFree(dData);
|
||||
hipFreeArray(hipArray);
|
||||
HIP_CHECK(hipDestroyTextureObject(textureObject));
|
||||
HIP_CHECK(hipFree(dData));
|
||||
HIP_CHECK(hipFreeArray(hipArray));
|
||||
free(hData);
|
||||
free(hOutputData);
|
||||
REQUIRE(result);
|
||||
|
||||
@@ -51,7 +51,7 @@ void runTest(const int width, const int height, const float offsetX, const float
|
||||
hipChannelFormatDesc channelDesc = hipCreateChannelDesc(
|
||||
32, 0, 0, 0, hipChannelFormatKindFloat);
|
||||
hipArray *hipArray;
|
||||
hipMallocArray(&hipArray, &channelDesc, width, height);
|
||||
HIP_CHECK(hipMallocArray(&hipArray, &channelDesc, width, height));
|
||||
|
||||
HIP_CHECK(hipMemcpy2DToArray(hipArray, 0, 0, hData, width * sizeof(float), width * sizeof(float), height, hipMemcpyHostToDevice));
|
||||
|
||||
@@ -74,7 +74,7 @@ void runTest(const int width, const int height, const float offsetX, const float
|
||||
HIP_CHECK(hipCreateTextureObject(&textureObject, &resDesc, &texDesc, NULL));
|
||||
|
||||
float *dData = nullptr;
|
||||
hipMalloc((void**) &dData, size);
|
||||
HIP_CHECK(hipMalloc((void**) &dData, size));
|
||||
|
||||
dim3 dimBlock(16, 16, 1);
|
||||
dim3 dimGrid((width + dimBlock.x - 1) / dimBlock.x, (height + dimBlock.y -1)/ dimBlock.y, 1);
|
||||
@@ -82,11 +82,11 @@ void runTest(const int width, const int height, const float offsetX, const float
|
||||
hipLaunchKernelGGL(tex2DKernel<normalizedCoords>, dimGrid, dimBlock, 0, 0, dData,
|
||||
textureObject, width, height, offsetX, offsetY);
|
||||
|
||||
hipDeviceSynchronize();
|
||||
HIP_CHECK(hipDeviceSynchronize());
|
||||
|
||||
float *hOutputData = (float*) malloc(size);
|
||||
memset(hOutputData, 0, size);
|
||||
hipMemcpy(hOutputData, dData, size, hipMemcpyDeviceToHost);
|
||||
HIP_CHECK(hipMemcpy(hOutputData, dData, size, hipMemcpyDeviceToHost));
|
||||
|
||||
bool result = true;
|
||||
for (int i = 0; i < height; i++) {
|
||||
@@ -103,9 +103,9 @@ void runTest(const int width, const int height, const float offsetX, const float
|
||||
}
|
||||
}
|
||||
line1:
|
||||
hipDestroyTextureObject(textureObject);
|
||||
hipFree(dData);
|
||||
hipFreeArray(hipArray);
|
||||
HIP_CHECK(hipDestroyTextureObject(textureObject));
|
||||
HIP_CHECK(hipFree(dData));
|
||||
HIP_CHECK(hipFreeArray(hipArray));
|
||||
free(hData);
|
||||
free(hOutputData);
|
||||
REQUIRE(result);
|
||||
|
||||
@@ -93,7 +93,7 @@ void runTest(const int width, const int height, const int depth, const float off
|
||||
hipTextureObject_t textureObject = 0;
|
||||
hipError_t res = hipCreateTextureObject(&textureObject, &resDesc, &texDesc, NULL);
|
||||
if (res != hipSuccess) {
|
||||
hipFreeArray(arr);
|
||||
HIP_CHECK(hipFreeArray(arr));
|
||||
free(hData);
|
||||
if (res == hipErrorNotSupported && isGfx90a) {
|
||||
printf("gfx90a doesn't support 3D linear filter! Skipped!\n");
|
||||
@@ -105,8 +105,8 @@ void runTest(const int width, const int height, const int depth, const float off
|
||||
}
|
||||
|
||||
float *dData = nullptr;
|
||||
hipMalloc((void**) &dData, size);
|
||||
hipMemset(dData, 0, size);
|
||||
HIP_CHECK(hipMalloc((void**) &dData, size));
|
||||
HIP_CHECK(hipMemset(dData, 0, size));
|
||||
dim3 dimBlock(8, 8, 8); // 512 threads
|
||||
dim3 dimGrid((width + dimBlock.x - 1) / dimBlock.x, (height + dimBlock.y -1)/ dimBlock.y,
|
||||
(depth + dimBlock.z - 1) / dimBlock.z);
|
||||
@@ -114,11 +114,11 @@ void runTest(const int width, const int height, const int depth, const float off
|
||||
hipLaunchKernelGGL(tex3DKernel<normalizedCoords>, dimGrid, dimBlock, 0, 0, dData,
|
||||
textureObject, width, height, depth, offsetX, offsetY, offsetZ);
|
||||
|
||||
hipDeviceSynchronize();
|
||||
HIP_CHECK(hipDeviceSynchronize());
|
||||
|
||||
float *hOutputData = (float*) malloc(size);
|
||||
memset(hOutputData, 0, size);
|
||||
hipMemcpy(hOutputData, dData, size, hipMemcpyDeviceToHost);
|
||||
HIP_CHECK(hipMemcpy(hOutputData, dData, size, hipMemcpyDeviceToHost));
|
||||
|
||||
for (int i = 0; i < depth; i++) {
|
||||
for (int j = 0; j < height; j++) {
|
||||
@@ -137,10 +137,10 @@ void runTest(const int width, const int height, const int depth, const float off
|
||||
}
|
||||
}
|
||||
line1:
|
||||
hipDestroyTextureObject(textureObject);
|
||||
HIP_CHECK(hipDestroyTextureObject(textureObject));
|
||||
free(hOutputData);
|
||||
hipFree(dData);
|
||||
hipFreeArray(arr);
|
||||
HIP_CHECK(hipFree(dData));
|
||||
HIP_CHECK(hipFreeArray(arr));
|
||||
free(hData);
|
||||
REQUIRE(result);
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ TEST_CASE("Unit_hipTextureRef2D_Check") {
|
||||
dim3 dimGrid(width / dimBlock.x, height / dimBlock.y, 1);
|
||||
hipLaunchKernelGGL(tex2DKernel, dim3(dimGrid), dim3(dimBlock), 0, 0,
|
||||
dData, width);
|
||||
hipDeviceSynchronize();
|
||||
HIP_CHECK(hipDeviceSynchronize());
|
||||
|
||||
float* hOutputData = reinterpret_cast<float*>(malloc(size));
|
||||
REQUIRE(hOutputData != nullptr);
|
||||
|
||||
새 이슈에서 참조
사용자 차단