Catch2 Test Fixes (#2961)

* test fixes

* address PR comment

* PR comment fixing Nvidia pass

* add additional kernel launch checks

* pr comments


[ROCm/hip-tests commit: da453211ed]
This commit is contained in:
Paulius Velesko
2022-10-01 01:07:25 +03:00
committed by GitHub
parent c9c04d65da
commit 65a428aaff
94 changed files with 177 additions and 34 deletions
@@ -66,6 +66,7 @@ TEST_CASE("Unit_hipBindTexture2D_Pitch") {
hipLaunchKernelGGL(texture2dCopyKernel, dim3(4, 4, 1), dim3(32, 32, 1),
0, 0, devPtrB);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
HIP_CHECK(hipMemcpy2D(B, SIZE_W*sizeof(TYPE_t), devPtrB,
SIZE_W*sizeof(TYPE_t), SIZE_W*sizeof(TYPE_t),
@@ -63,6 +63,7 @@ TEST_CASE("Unit_hipBindTexture_tex1DfetchVerification") {
dim3 dimGrid(N / dimBlock.x, 1, 1);
hipLaunchKernelGGL(kernel, dim3(dimGrid), dim3(dimBlock), 0, 0, devBuf);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
HIP_CHECK(hipMemcpy(output, devBuf, N * sizeof(float),
hipMemcpyDeviceToHost));
@@ -118,6 +118,7 @@ static void textureTest(texture<T, hipTextureType1D,
hipLaunchKernelGGL(normalizedValTextureTest<T>, dim3(1, 1, 1),
dim3(SIZE, 1, 1), 0, 0, SIZE, dOutputData);
HIP_CHECK(hipGetLastError());
float *hOutputData = new float[SIZE];
REQUIRE(hOutputData != nullptr);
@@ -86,9 +86,11 @@ TEST_CASE("Unit_hipSimpleTexture2DLayered_Check") {
dim3 dimBlock(8, 8, 1);
dim3 dimGrid(width / dimBlock.x, height / dimBlock.y, 1);
for (unsigned int layer = 0; layer < num_layers; layer++)
for (unsigned int layer = 0; layer < num_layers; layer++) {
hipLaunchKernelGGL(simpleKernelLayeredArray, dimGrid, dimBlock, 0, 0,
dData, width, height, layer);
HIP_CHECK(hipGetLastError());
}
HIP_CHECK(hipDeviceSynchronize());
// Allocate mem for the result on host side
@@ -92,6 +92,7 @@ static void runSimpleTexture3D_Check(int width, int height, int depth,
hipLaunchKernelGGL(simpleKernel3DArray, dim3(1, 1, 1), dim3(1, 1, 1),
0, 0, dData, width, height, depth);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
// Allocate mem for the result on host side
@@ -79,6 +79,7 @@ static void runTest(hipTextureAddressMode addressMode,
hipLaunchKernelGGL(tex1dKernel, dim3(dimGrid), dim3(dimBlock), 0, 0,
texBufOut, texObj);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
HIP_CHECK(hipMemcpy(output, texBufOut, N * sizeof(float),
@@ -85,6 +85,7 @@ TEMPLATE_TEST_CASE("Unit_hipTexObjPitch_texture2D", "", float, int,
hipLaunchKernelGGL(texture2dCopyKernel, dim3(1, 1, 1), dim3(1, 1, 1), 0, 0,
texObj, devPtrB);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpy2D(B, SIZE_W*sizeof(TestType), devPtrB,
SIZE_W*sizeof(TestType), SIZE_W*sizeof(TestType),
@@ -97,6 +97,7 @@ static void runMipMapTest(unsigned int width, unsigned int height, unsigned int
hipLaunchKernelGGL(tex2DKernel, dim3(dimGrid), dim3(dimBlock), 0, 0, dData, textureObject, width,
(2 * mipmap_level));
HIP_CHECK(hipGetLastError());
hipDeviceSynchronize();
float* hOutputData = reinterpret_cast<float*>(malloc(size));
@@ -73,6 +73,7 @@ static void runTest(const int width, const float offsetX) {
hipLaunchKernelGGL(tex1DKernel<normalizedCoords>, dimGrid, dimBlock, 0, 0, dData,
textureObject, width, offsetX);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
@@ -113,9 +113,11 @@ static void runTest(const int width, const float offsetX = 0) {
if (resType == hipResourceTypeArray) {
hipLaunchKernelGGL(tex1DRGBAKernel<normalizedCoords>, dimGrid, dimBlock,
0, 0, dData, textureObject, width, offsetX);
HIP_CHECK(hipGetLastError());
} else {
hipLaunchKernelGGL(tex1DRGBAKernelFetch, dimGrid, dimBlock,
0, 0, dData, textureObject, offsetX);
HIP_CHECK(hipGetLastError());
}
HIP_CHECK(hipDeviceSynchronize());
@@ -69,6 +69,7 @@ TEST_CASE("Unit_hipCreateTextureObject_tex1DfetchVerification") {
hipLaunchKernelGGL(tex1dKernel, dim3(dimGrid), dim3(dimBlock), 0, 0,
texBufOut, texObj);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
HIP_CHECK(hipMemcpy(output, texBufOut, N * sizeof(float),
@@ -85,6 +85,7 @@ TEST_CASE("Unit_hipTextureObj2D_Check") {
hipLaunchKernelGGL(tex2DKernel, dim3(dimGrid), dim3(dimBlock),
0, 0, dData, textureObject, width);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
HIP_CHECK(hipMemcpy(hOutputData, dData, size, hipMemcpyDeviceToHost));
@@ -81,6 +81,7 @@ static void runTest(const int width, const int height, const float offsetX, cons
hipLaunchKernelGGL(tex2DKernel<normalizedCoords>, dimGrid, dimBlock, 0, 0, dData,
textureObject, width, height, offsetX, offsetY);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
@@ -86,6 +86,7 @@ static void runTest(const int width, const int height, const float offsetX, cons
hipLaunchKernelGGL(tex2DRGBAKernel<normalizedCoords>, dimGrid, dimBlock, 0, 0, dData,
textureObject, width, height, offsetX, offsetY);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
@@ -113,6 +113,7 @@ static void runTest(const int width, const int height, const int depth, const fl
hipLaunchKernelGGL(tex3DKernel<normalizedCoords>, dimGrid, dimBlock, 0, 0, dData,
textureObject, width, height, depth, offsetX, offsetY, offsetZ);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
@@ -178,6 +178,7 @@ bool runTest() {
hipLaunchKernelGGL(tex1dKernelFetch<T>, dimGrid, dimBlock, 0, 0, texBufOut,
texObj, N);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
HIP_CHECK(hipMemcpy(output, texBufOut, N * sizeof(T), hipMemcpyDeviceToHost));
@@ -69,6 +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);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
float* hOutputData = reinterpret_cast<float*>(malloc(size));