diff --git a/projects/hip-tests/catch/unit/texture/hipTextureObj3DCheckModes.cc b/projects/hip-tests/catch/unit/texture/hipTextureObj3DCheckModes.cc index 5746d5ae53..2d50317b58 100644 --- a/projects/hip-tests/catch/unit/texture/hipTextureObj3DCheckModes.cc +++ b/projects/hip-tests/catch/unit/texture/hipTextureObj3DCheckModes.cc @@ -120,8 +120,11 @@ static void runTest(const int width, const int height, const int depth, const fl dim3 dimGrid((width + dimBlock.x - 1) / dimBlock.x, (height + dimBlock.y - 1) / dimBlock.y, (depth + dimBlock.z - 1) / dimBlock.z); - hipLaunchKernelGGL(tex3DKernel, dimGrid, dimBlock, 0, 0, dData, textureObject, - width, height, depth, offsetX, offsetY, offsetZ); + // Resets any prior last error to hipSuccess, so that the hipGetLastError after the + // kernel launch will not return the earlier errors + res = hipGetLastError(); + hipLaunchKernelGGL(tex3DKernel, dimGrid, dimBlock, 0, 0, dData, + textureObject, width, height, depth, offsetX, offsetY, offsetZ); HIP_CHECK(hipGetLastError()); HIP_CHECK(hipDeviceSynchronize());