This is my repository for the TUNI Parallel Computing Course project. The purpose of this program is to do edge detection using the canny edge detection algorithm.
The project is split on multiple branch, each adding further optimizations:
- master original, no modifications
- generic_optimizations some optimizations, no threads
- openmp parallelization with OpenMP
- opencl usage of specialized hardware with OpenCL
- opencl-with-optimizations OpenCL usage with further optimizations
- final-windows-video-support final version with main method modified to be able to run video mode on Windows
no optimizations:
gcc -o canny util.c canny.c -lm
most optimizations, no vectorization
gcc -o canny util.c canny.c -lm -O2
Also vectorize and show what loops get vectorized
gcc -o canny util.c canny.c -lm -O2 -ftree-vectorize -mavx2 -fopt-info-vec
Also allow math relaxations
gcc -o canny util.c canny.c -lm -O2 -ftree-vectorize -mavx2 -fopt-info-vec -ffast-math
Also support OpenMP
gcc -o canny util.c canny.c -lm -O2 -ftree-vectorize -mavx2 -fopt-info-vec -ffast-math -fopenmp
Also support OpenCL:
gcc -o canny util.c opencl util.c canny.c -lm -O2 -ftree-vectorize -mavx2 -fopt-info-vec -ffast-math -fopenmp -lOpenCL
Runs the application once with the x.pgm image (output written to x output.pgm). PGM images can be viewed with many common image viewers. For example:
./canny && eog x output.pgm
To run benchmarking with the large hameenkatu.pgm image
./canny -B <NUM_OF_ITERATIONS>
To run benchmarking with the small x.pgm image
./canny -b <NUM_OF_ITERATIONS>
You can also run the video people.mp4. You need ffmpeg installed for this
./canny -v