Skip to content

Commit

Permalink
Allow 80% of ideal in ThreadPerformanceTest
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusTomlinson committed Dec 23, 2023
1 parent 3dc49dc commit afebe00
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ TEST_CASE( "ThreadPerformanceTest" )

auto overhead = 100 - ( 100 * ( eff / refEff ) );
std::cout << "0x Buffer Efficiency: " << eff << "% (-" << overhead << "%)" << std::endl;
REQUIRE( eff >= refEff * 0.25 * 0.90 );
REQUIRE( eff >= refEff * 0.25 * 0.80 );

// Tick the circuit with 1 thread, and check that no more ticks occurred
if ( std::thread::hardware_concurrency() < 1 )
Expand All @@ -420,7 +420,7 @@ TEST_CASE( "ThreadPerformanceTest" )

overhead = 100 - ( 100 * ( eff / refEff ) );
std::cout << "1x Buffer Efficiency: " << eff << "% (-" << overhead << "%)" << std::endl;
REQUIRE( eff >= refEff * 0.25 * 0.90 );
REQUIRE( eff >= refEff * 0.25 * 0.80 );

// Tick the circuit with 2 threads, and check that more ticks occurred
if ( std::thread::hardware_concurrency() < 2 )
Expand All @@ -439,7 +439,7 @@ TEST_CASE( "ThreadPerformanceTest" )

overhead = 100 - ( 100 * ( eff / refEff ) );
std::cout << "2x Buffer Efficiency: " << eff << "% (-" << overhead << "%)" << std::endl;
REQUIRE( eff >= refEff * 0.5 * 0.90 );
REQUIRE( eff >= refEff * 0.5 * 0.80 );

// Tick the circuit with 3 threads, and check that more ticks occurred
if ( std::thread::hardware_concurrency() < 6 )
Expand All @@ -458,7 +458,7 @@ TEST_CASE( "ThreadPerformanceTest" )

overhead = 100 - ( 100 * ( eff / refEff ) );
std::cout << "3x Buffer Efficiency: " << eff << "% (-" << overhead << "%)" << std::endl;
REQUIRE( eff >= refEff * 0.75 * 0.90 );
REQUIRE( eff >= refEff * 0.75 * 0.80 );

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

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

TEST_CASE( "StopAutoTickRegressionTest" )
Expand Down

0 comments on commit afebe00

Please sign in to comment.