Skip to content
Permalink
Browse files

[opencl] Benchmark test case

  • Loading branch information
elpaso committed Aug 8, 2018
1 parent c4eebc7 commit e29c7e55be4c95b694bbca0cb18d78041bbaf1e1
Showing with 5 additions and 4 deletions.
  1. +5 −4 tests/src/core/testqgsopenclutils.cpp
@@ -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 );

@@ -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 )

0 comments on commit e29c7e5

Please sign in to comment.
You can’t perform that action at this time.