/* * CUDA convolutional neural net */ #include #include #include "ee155_utils.hxx" #include "matrix.hxx" using namespace std; // Simple CNN algorithm. 1 core, no blocking. Used as a reference to check // the GPU work. // Inputs: array_in (the input), f (the filter) // Outputs: set this' data (which should already be allocated to the correct // size, slightly smaller than array_in. // Assume: 1 input channel, 1 output channel. void Matrix::CNN_dumb (const Matrix &array_in, const Matrix &f) { assert (this->N() == array_in.N() + 1 - f.N()); int N = this->N(); for (int ro=0; ro