diff --git a/openmp/libomptarget/test/offloading/bug49334.cpp b/openmp/libomptarget/test/offloading/bug49334.cpp --- a/openmp/libomptarget/test/offloading/bug49334.cpp +++ b/openmp/libomptarget/test/offloading/bug49334.cpp @@ -50,8 +50,7 @@ } } - long Compare(const std::vector &matrix) const { - long fail = 0; + void Compare(const std::vector &matrix) const { for (int i = 0; i < nBlocksPerCol; i++) for (int j = 0; j < nBlocksPerRow; j++) { float *CurrBlock = GetBlock(i, j); @@ -61,13 +60,10 @@ int currj = j * rowsPerBlock + jj; float m_value = matrix[curri + currj * nCols]; float bm_value = CurrBlock[ii + jj * colsPerBlock]; - if (std::fabs(bm_value - m_value) > - std::numeric_limits::epsilon()) { - fail++; - } + assert(std::fabs(bm_value - m_value) < + std::numeric_limits::epsilon()); } } - return fail; } float *GetBlock(int i, int j) const { @@ -77,7 +73,7 @@ }; constexpr const int BS = 16; -constexpr const int N = 256; +constexpr const int N = 16; int BlockMatMul_TargetNowait(BlockMatrix &A, BlockMatrix &B, BlockMatrix &C) { #pragma omp parallel @@ -130,20 +126,19 @@ } auto BlockedA = BlockMatrix(BS, BS, N, N); - BlockedA.Initialize(a); - BlockedA.Compare(a); auto BlockedB = BlockMatrix(BS, BS, N, N); + auto BlockedC = BlockMatrix(BS, BS, N, N); + BlockedA.Initialize(a); BlockedB.Initialize(b); + BlockedC.Initialize(c); + BlockedA.Compare(a); BlockedB.Compare(b); + BlockedC.Compare(c); Matmul(a, b, c); - - auto BlockedC = BlockMatrix(BS, BS, N, N); BlockMatMul_TargetNowait(BlockedA, BlockedB, BlockedC); - if (BlockedC.Compare(c) > 0) { - return 1; - } + BlockedC.Compare(c); std::cout << "PASS\n";