Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenMP and SIMD Benchmarks

A collection of C++ experiments comparing serial execution, OpenMP thread-level parallelism, compiler-assisted SIMD, and hand-written SSE/AVX2 intrinsics.

Experiments

Executable Workload Implementations compared
variance_benchmark Population variance over a large float array serial, SSE, OpenMP, OpenMP + SIMD, manual SIMD
watermark_benchmark Alpha-blended image watermarking serial, AVX2, OpenMP, combined variants
edge_detection_benchmark grayscale, Gaussian blur, Sobel X/Y, gradient magnitude serial, SSE/AVX2, OpenMP, combined variants
neural_network_benchmark two dense matrix stages serial, AVX2/FMA, OpenMP

The programs print cycle counts, elapsed time, speedup, and correctness checks where implemented. Image experiments also write their generated images to the ignored results/ directory.

Recorded observations

The original report records machine-specific runs rather than portable guarantees:

  • In the variance experiment, a larger workload produced roughly 2x speedup with OpenMP and about 5.6x with the OpenMP + SIMD version.
  • In some watermark tests, the combined implementation approached 3x; the hand-written OpenMP + SIMD version could underperform the pragma-based version because of thread and implementation overhead.
  • In the edge-detection experiment, pure SIMD produced approximately 2.3x, OpenMP approximately 1.5x, and the manual combined implementation approximately 2.1-2.2x relative to the serial implementation.
  • The report emphasizes that memory bandwidth, data alignment, workload size, and thread-management overhead strongly affect the results.

Recorded edge-detection output

Requirements

  • CMake 3.16+
  • C++17 compiler with OpenMP
  • x86-64 processor with AVX2 and FMA
  • OpenCV 4 development libraries

Build

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release

Run binaries from the repository root so the image programs can find assets/:

./build/variance_benchmark
./build/watermark_benchmark
./build/edge_detection_benchmark
./build/neural_network_benchmark

The edge-detection executable optionally accepts an input path:

./build/edge_detection_benchmark path/to/image.jpg

Portfolio cleanup

  • Four numbered submission sources were given descriptive filenames.
  • Duplicate outputs were collapsed to one representative result image.
  • Executables, IDE settings, LaTeX sources, report-build files, and submission archives were excluded.
  • Input assets required by the image experiments were retained.

Limitations

  • Benchmarks are sensitive to compiler flags, CPU frequency, cache state, OpenMP runtime, and image size.
  • AVX2/FMA requirements make the programs non-portable to older x86 CPUs and non-x86 architectures.
  • The experiments allocate large fixed-size arrays; memory and stack behavior may vary by platform.
  • No automated numerical-regression suite is included in the original implementation.

docs/report-excerpt.pdf contains a Portfolio-safe results page from the original report; identifying cover content and unrelated report-build sources are excluded.

About

C++ image-processing benchmarks comparing sequential, OpenMP, and SIMD implementations for edge detection and watermarking.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages