Parallelize CustomWaveform and stbi_write_png using OpenMP #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements OpenMP parallelization for
CustomWaveformrendering andstb_image_writePNG encoding, as suggested indocs/openmp.md.Changes:
vendor/SOIL2/src/SOIL2/stb_image_write.h: Parallelized the main row loop instbi_write_png_to_memusing#pragma omp parallel for. Movedline_bufferallocation inside the parallel region to ensure thread safety. Added failure handling via atomic flag.vendor/SOIL2/CMakeLists.txt: Added logic to linkOpenMP::OpenMP_Cand definePRJM_ENABLE_OPENMPfor theSOIL2target ifENABLE_OPENMPis ON.src/libprojectM/MilkdropPreset/CustomWaveform.cpp:Draw, added a check for!m_perPointContext.perPointCodeHandle. If no per-point code is present, a parallel loop generates vertices using local logic (bypassing the sharedPerPointContext).SmoothWave, parallelized the loop by removing stateful dependency variables (iBelow,iAbove2) and calculating them directly from the loop index.These changes are guarded by
PRJM_ENABLE_OPENMP.PR created automatically by Jules for task 3007410145637072838 started by @ford442