问题 For my project, I've written a naive C implementation of direct 3D convolution with periodic padding on the input. Unfortunately, since I'm new to C, the performance isn't so good... here's the code: int mod(int a, int b) { // calculate mod to get the correct index with periodic padding int r = a % b; return r < 0 ? r + b : r; } void convolve3D(const double *image, const double *kernel, const int imageDimX, const int imageDimY, const int imageDimZ, const int stencilDimX, const int stencilDimY