Parallel Computing Project

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.

Branches

The project is split on multiple branch, each adding further optimizations:

To compile

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

To run the binary:

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