Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GPGPU vs OpenMP Benchmark

A "Fair Fight" performance comparison between Single-Threaded CPU, Multi-Threaded CPU (OpenMP), and GPU (OpenGL Compute Shader).

The task is $1024 \times 1024$ Matrix Multiplication ($O(N^3)$).

The Contenders

  1. CPU Single: Standard C++ loop.
  2. CPU OpenMP: Uses #pragma omp parallel for to utilize all available cores (e.g., 16 threads).
  3. GPU: OpenGL 4.6 Compute Shader (Naive implementation).

Typical Results

  • CPU Single: ~1900 ms
  • CPU OpenMP: ~200 ms (Speedup: ~9x)
  • GPU: ~100 ms (Speedup vs OpenMP: ~2x)

Prerequisites

  • Scoop
  • Visual Studio (MSVC)
  • OpenGL 4.3+ capable GPU

Build Instructions

scoop install cmake vcpkg
vcpkg integrate install
vcpkg install glfw3 glad --triplet=x64-windows

cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE="$env:USERPROFILE/scoop/apps/vcpkg/current/scripts/buildsystems/vcpkg.cmake"
cmake --build build --config Release
.\build\Release\gpgpu_vs_omp.exe

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages