Skip to content

Commit e29c7e5

Browse files
committedAug 8, 2018
[opencl] Benchmark test case
1 parent c4eebc7 commit e29c7e5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎tests/src/core/testqgsopenclutils.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@ class TestQgsOpenClUtils: public QObject
4545
void testMakeRunProgram();
4646
void testProgramSource();
4747
void testContext();
48-
49-
private:
50-
5148
// For performance testing
5249
void testHillshade();
5350

51+
private:
52+
5453
void _testMakeRunProgram();
5554
void _testMakeHillshade( const QString title, const int loops );
5655

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

0 commit comments

Comments
 (0)
Please sign in to comment.