Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,11 @@ namespace TensileLite

void report()
{
if(m_errors && m_printReport)
if(m_errors)
{
std::cout << "Found " << m_errors << " incorrect values in " << m_values
<< " total values compared." << std::endl;
if(m_printReport)
std::cout << "Found " << m_errors << " incorrect values in " << m_values
<< " total values compared." << std::endl;
m_failed = true;
}
m_errors = 0;
Expand Down Expand Up @@ -188,10 +189,11 @@ namespace TensileLite

void report()
{
if(m_errors && m_printReport)
if(m_errors)
{
std::cout << "Found " << m_errors << " incorrect values in " << m_values
<< " total values compared." << std::endl;
if(m_printReport)
std::cout << "Found " << m_errors << " incorrect values in " << m_values
<< " total values compared." << std::endl;
m_failed = true;
}
}
Expand Down
21 changes: 21 additions & 0 deletions projects/hipblaslt/tensilelite/tests/ResultComparison_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,24 @@ TYPED_TEST(ResultComparisonTest, PrintMaxZero_SameOutput)
EXPECT_EQ(oldOutput, newOutput);
EXPECT_EQ(oldOutput, "");
}

// Test: mismatches present but printMax=0 — both comparators should still fail.
TYPED_TEST(ResultComparisonTest, PrintMaxZero_MismatchStillFails)
{
using T = typename TestFixture::TypeParam;
auto ref = makeVec<T>({1, 2, 3});
auto res = makeVec<T>({1, 9, 3});

PointwiseComparison<T> slow(false, 0, false, -1.0);
FastPointwiseComparison<T> fast(false, -1.0);
for(size_t i = 0; i < ref.size(); i++)
{
slow(ref[i], res[i], i, i);
fast(ref[i], res[i], i, i);
}
slow.report();
fast.report();

EXPECT_TRUE(slow.error());
EXPECT_TRUE(fast.error());
}
Loading