Several OpenMP improvements

Several optimizations based on profiling of 20M grid model. These fixes will improve the largest performance issues, but there are still more operations that can be refactored.

* OpenMP: Use in fault geometry generator
* OpenMP: Use when computing statistics for result values
* OpenMP: Use multithreading on fault detection
* Add RiaOpenMPTools
* VizFwk: Use openMP for texture generation
This commit is contained in:
Magne Sjaastad
2022-12-19 13:49:03 +01:00
committed by GitHub
parent 254c74be13
commit a423ecf95f
12 changed files with 244 additions and 110 deletions

View File

@@ -232,10 +232,11 @@ void Utils::toTextureImageRegion(const QImage& qImage, const cvf::Vec2ui& srcPos
// Check if QImage has format QImage::Format_ARGB32, and use a more optimized path
if (qImage.format() == QImage::Format_ARGB32)
{
for (cvf::uint y = 0; y < sizeY; ++y)
#pragma omp for
for (int y = 0; y < static_cast<int>(sizeY); ++y)
{
const cvf::uint scanLineIdx = srcPosY + sizeY - y - 1;
const QRgb* qWholeScanLine = reinterpret_cast<const QRgb*>(qImage.scanLine(scanLineIdx));
const QRgb* qWholeScanLine = reinterpret_cast<const QRgb*>(qImage.constScanLine(scanLineIdx));
const QRgb* qPixels = &qWholeScanLine[srcPosX];
const cvf::uint dstStartIdx = 4*(y*sizeX);
@@ -254,7 +255,8 @@ void Utils::toTextureImageRegion(const QImage& qImage, const cvf::Vec2ui& srcPos
else
{
cvf::Color4ub cvfRgbVal;
for (cvf::uint y = 0; y < sizeY; ++y)
#pragma omp for
for (int y = 0; y < static_cast<int>(sizeY); ++y)
{
const cvf::uint qImageYPos = srcPosY + sizeY - y - 1;
for (cvf::uint x = 0; x < sizeX; ++x)