Skip to content

Commit

Permalink
Warn instead of fail in performance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusTomlinson committed Nov 20, 2024
1 parent d92d63b commit c47f20c
Showing 1 changed file with 28 additions and 10 deletions.
38 changes: 28 additions & 10 deletions tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,10 +457,13 @@ TEST_CASE( "BufferPerformanceTest" )

overhead = 100 - ( 100 * ( eff / refEff ) );
std::cout << "2x Buffer Efficiency: " << eff << "% (-" << overhead << "%)" << std::endl;
REQUIRE( eff >= refEff * 0.5 * 0.80 );
if ( eff < refEff * 0.5 * 0.80 )
{
WARN( std::to_string( eff ) + " < " + std::to_string( refEff * 0.5 * 0.80 ) );
}

// Tick the circuit with 3 threads, and check that more ticks occurred
if ( std::thread::hardware_concurrency() < 6 )
if ( std::thread::hardware_concurrency() < 3 )
{
return;
}
Expand All @@ -476,10 +479,13 @@ TEST_CASE( "BufferPerformanceTest" )

overhead = 100 - ( 100 * ( eff / refEff ) );
std::cout << "3x Buffer Efficiency: " << eff << "% (-" << overhead << "%)" << std::endl;
REQUIRE( eff >= refEff * 0.75 * 0.80 );
if ( eff < refEff * 0.75 * 0.80 )
{
WARN( std::to_string( eff ) + " < " + std::to_string( refEff * 0.75 * 0.80 ) );
}

// Tick the circuit with 4 threads, and check that more ticks occurred
if ( std::thread::hardware_concurrency() < 8 )
if ( std::thread::hardware_concurrency() < 4 )
{
return;
}
Expand All @@ -495,7 +501,10 @@ TEST_CASE( "BufferPerformanceTest" )

overhead = 100 - ( 100 * ( eff / refEff ) );
std::cout << "4x Buffer Efficiency: " << eff << "% (-" << overhead << "%)" << std::endl;
REQUIRE( eff >= refEff * 0.80 );
if ( eff < refEff * 0.80 )
{
WARN( std::to_string( eff ) + " < " + std::to_string( refEff * 0.80 ) );
}
}

TEST_CASE( "ThreadPerformanceTest" )
Expand Down Expand Up @@ -569,10 +578,13 @@ TEST_CASE( "ThreadPerformanceTest" )

overhead = 100 - ( 100 * ( eff / refEff ) );
std::cout << "2x Thread Efficiency: " << eff << "% (-" << overhead << "%)" << std::endl;
REQUIRE( eff >= refEff * 0.5 * 0.80 );
if ( eff < refEff * 0.5 * 0.80 )
{
WARN( std::to_string( eff ) + " < " + std::to_string( refEff * 0.5 * 0.80 ) );
}

// Tick the circuit with 3 threads, and check that more ticks occurred
if ( std::thread::hardware_concurrency() < 6 )
if ( std::thread::hardware_concurrency() < 3 )
{
return;
}
Expand All @@ -588,10 +600,13 @@ TEST_CASE( "ThreadPerformanceTest" )

overhead = 100 - ( 100 * ( eff / refEff ) );
std::cout << "3x Thread Efficiency: " << eff << "% (-" << overhead << "%)" << std::endl;
REQUIRE( eff >= refEff * 0.5 * 0.80 );
if ( eff < refEff * 0.5 * 0.80 )
{
WARN( std::to_string( eff ) + " < " + std::to_string( refEff * 0.5 * 0.80 ) );
}

// Tick the circuit with 4 threads, and check that more ticks occurred
if ( std::thread::hardware_concurrency() < 8 )
if ( std::thread::hardware_concurrency() < 4 )
{
return;
}
Expand All @@ -607,7 +622,10 @@ TEST_CASE( "ThreadPerformanceTest" )

overhead = 100 - ( 100 * ( eff / refEff ) );
std::cout << "4x Thread Efficiency: " << eff << "% (-" << overhead << "%)" << std::endl;
REQUIRE( eff >= refEff * 0.80 );
if ( eff < refEff * 0.80 )
{
WARN( std::to_string( eff ) + " < " + std::to_string( refEff * 0.80 ) );
}
}

TEST_CASE( "StopAutoTickRegressionTest" )
Expand Down

0 comments on commit c47f20c

Please sign in to comment.