Your task in this assignment is to implement and analyze efficient OMP program for fast application of 2D filters. 2D filters are frequently used in image and signal processing, and hence their efficient implementations are highly desired. Let us assume that our input image is represented by n x m array A, and let K be a kernel – a square matrix (for simplicity we will assume that K is always 3 x 3 matrix). In classic 2D filtering with kernel K, for each pixel A;j we compute convolution between K and submatrix of A centered around A¡j. If you recall our lectures, this falls under the category of stencil pattern. In this assignment, we will consider a slightly modified version of the problem. Let A;-1;i+1,j–1:j+1 be submatrix of A centered at (i, j). Then our filter will be defined as follows. First, Z = A;-1;i+1,j–1:j+1 × K, then we obtain the filtered value A', = Eab Zab. In other words, first we compute matrix product between submatrix of A centered at (i, j) and kernel K, then we sum up all elements of the resulting matrix Z. Note that we do not apply the filter to the first and last row/column of A, i.e., A, = Aij if i refers to the first/last row, or j refers to the first/last column. The assignment consists of two parts. In the first question (Q1), starting from the provided backbone (see below) you have to write a C++/OMP code implementing filter as explained above. In the second question (Q2), you have to analyze performance of your solution, generate a speedup plot showing scalability of your code, and then provide a brief discussion summarizing your findings (e.g., do you think your code is scalable, is it always scalable, if it is scalable in what sense, if it is not scalable what do you think is causing problems.).

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

I was given to write a parallel computing problem in which a sequential c++ code is to be written and should be made to work as a parallel program by adding simple parallel computing constructs like "pragma omp parallel". it should be run on a ccr which I have access to and check the speed up of the parallelly running problem. All the skeleton of the program is given and I should complete the specific function.

Your task in this assignment is to implement and analyze efficient OMP program for fast application of 2D filters. 2D
filters are frequently used in image and signal processing, and hence their efficient implementations are highly desired.
Let us assume that our input image is represented by n x m array A, and let K be a kernel – a square matrix (for
simplicity we will assume that K is always 3 x 3 matrix). In classic 2D filtering with kernel K, for each pixel A;j we
compute convolution between K and submatrix of A centered around Aij. If you recall our lectures, this falls under the
category of stencil pattern.
In this assignment, we will consider a slightly modified version of the problem. Let A;-1:i+1,j–1:j+1 be submatrix of A
centered at (i, j). Then our filter will be defined as follows. First, Z = A;-1;i+1,j–1:j+1 × K, then we obtain the filtered
value A, = Eab Zab- In other words, first we compute matrix product between submatrix of A centered at (i, j) and
kernel K, then we sum up all elements of the resulting matrix Z. Note that we do not apply the filter to the first and last
row/column of A, i.e., A'; = Aij if i refers to the first/last row, or j refers to the first/last column.
The assignment consists of two parts. In the first question (Q1), starting from the provided backbone (see below) you
have to write a C++/OMP code implementing filter as explained above. In the second question (Q2), you have to analyze
performance of your solution, generate a speedup plot showing scalability of your code, and then provide a brief
discussion summarizing your findings (e.g., do you think your code is scalable, is it always scalable, if it is scalable in
what sense, if it is not scalable what do you think is causing problems.).
Transcribed Image Text:Your task in this assignment is to implement and analyze efficient OMP program for fast application of 2D filters. 2D filters are frequently used in image and signal processing, and hence their efficient implementations are highly desired. Let us assume that our input image is represented by n x m array A, and let K be a kernel – a square matrix (for simplicity we will assume that K is always 3 x 3 matrix). In classic 2D filtering with kernel K, for each pixel A;j we compute convolution between K and submatrix of A centered around Aij. If you recall our lectures, this falls under the category of stencil pattern. In this assignment, we will consider a slightly modified version of the problem. Let A;-1:i+1,j–1:j+1 be submatrix of A centered at (i, j). Then our filter will be defined as follows. First, Z = A;-1;i+1,j–1:j+1 × K, then we obtain the filtered value A, = Eab Zab- In other words, first we compute matrix product between submatrix of A centered at (i, j) and kernel K, then we sum up all elements of the resulting matrix Z. Note that we do not apply the filter to the first and last row/column of A, i.e., A'; = Aij if i refers to the first/last row, or j refers to the first/last column. The assignment consists of two parts. In the first question (Q1), starting from the provided backbone (see below) you have to write a C++/OMP code implementing filter as explained above. In the second question (Q2), you have to analyze performance of your solution, generate a speedup plot showing scalability of your code, and then provide a brief discussion summarizing your findings (e.g., do you think your code is scalable, is it always scalable, if it is scalable in what sense, if it is not scalable what do you think is causing problems.).
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education