DocsNavigationUser login |
2D ConvolutionA 2D convolution is simply the application of a mask to a 2D image, conceptually the same as a "blur" operation in computer graphics. The prototype of a Sequoia task which implements a 2D convolution is as follows.
The output image, C, is computed from the input image, A, and the convolution mask, H, according to the following expression.
A 2D convolution problem, producing an output image of size M*N, can be decomposed into a set of parallel 2D convolution subproblems, each computing a non-overlapping region of the output image of size S*T. This is the decomposition that is used to implement this algorithm in Sequoia. Note that in this formulation of 2D convolution, a size (M+U-1)*(N+V-1) input image is used to compute the size M*N output image, and similarly, a size (S+U-1)*(T+V-1) input subimage is used to compute each size S*T output subimage. In this formulation, the input subimages overlap with each other, even though the output subimages don't. Sequoia Source Code The abstract Sequoia implementation of a 2D convolution is as follows.
In the above implementation, the tunable values that describe the subarray sizes, S and T, don't need to evenly divide the output image size parameters, M and N respectively, as both the array block expressions and the mappar iteration bounds properly handle this case. XML Mapping File for the Cell Target Note: The XML mapping file interface will soon be replaced with a new interface which is much less verbose and which is more convenient. The XML mapping example provided here will be replaced with an example that uses the new mapping interface when it is ready. The XML mapping directives for targeting this program to Cell are as follows.
|