notes-ing2/gpu/tp4/c/src/conv.h
2024-03-28 17:58:33 +01:00

19 lines
415 B
C++

#pragma once
#include <iostream>
#include <vector>
//
// 1D convolution
// - x: input array of size N
// - y: kernel of odd size M
//
// CPU
std::vector<int> conv1(const std::vector<int>& x, const std::vector<int>& y);
// GPU (naive)
std::vector<int> conv2(const std::vector<int>& x, const std::vector<int>& y);
// GPU (optimized)
std::vector<int> conv3(const std::vector<int>& x, const std::vector<int>& y);