Skip to content

Commit

Permalink
[opencl] Benchmark test case
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Aug 8, 2018
1 parent c4eebc7 commit e29c7e5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/src/core/testqgsopenclutils.cpp
Expand Up @@ -45,12 +45,11 @@ class TestQgsOpenClUtils: public QObject
void testMakeRunProgram();
void testProgramSource();
void testContext();

private:

// For performance testing
void testHillshade();

private:

void _testMakeRunProgram();
void _testMakeHillshade( const QString title, const int loops );

Expand Down Expand Up @@ -204,7 +203,9 @@ void TestQgsOpenClUtils::_testMakeHillshade( const QString title, const int loop
for ( int i = 0 ; i < loops; i++ )
{
QgsHillshadeRenderer renderer( mFloat32RasterLayer->dataProvider(), 1, 35.0, 5000.0 );
QgsRasterBlock *block = renderer.block( 0, mFloat32RasterLayer->extent(), 401, 401 );
// Note: CPU time grows linearly with raster dimensions while GPU time is roughly constant
// 900x900 px gives even times on my testing machine
QgsRasterBlock *block = renderer.block( 0, mFloat32RasterLayer->extent(), 900, 900 );
}
qDebug() << QStringLiteral( "%1 average for %2 loops: %3 ms" )
.arg( title )
Expand Down

0 comments on commit e29c7e5

Please sign in to comment.