This is a simple convolution implementation both for CPU_only and GPU_only (using CUDA).
In this project I implimented the convolution algorithm both for a 1d vector and a 2d vector. Both implimentations are templated so you can pass any typename you need.
Firstly, iclude the Convolution.h file.
#include "Convolution.h"
Then you can use the static methods myConvolve passing the correct inputs
To use the one dimentional convolution function just call the myConvolve function with 2 vectors of doubles.
std::vector<T> input, filter, conv;
conv = nvolution::myConvolve(input, filter);
To use the 2 dimentional convolution function just call the myConvolve function with 2 2d vectors of doubles.
std::vector<std::vector<T>> input, filter, conv;
conv = nvolution::myConvolve(input, filter);