- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm doing my first steps in the OpenMP world.
I have an image I want to apply a filter on.
Since the image is large I wanted to break it into non overlapping parts and apply the filter on each independently in parallel.
Namely, I'm creating 4 images I want to have different threads.
I'm using Intel IPP for the handling of the images and the function to apply on each sub image.
I described the code here:
http://stackoverflow.com/questions/29319226/parallel-image-processing-in-openmp-splitting-image
The problem is I tried both sections and parallel for and got only 20% improvement.
What am I doing wrong?
How can I tell each "Worker" that though data is taken from the same array, it is safe to read (Data won't change) and write (Each worker has exclusive approach to its part of the result image).
Thank You.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may want to partition your image differently than in quadrants. The reason being is your processor is capable of processing the data using SSE/AVX/AVX2/... On a 4-way partition, using quadrants results in the vectored operations running half the distance before having to loop. If your data is organized such that it runs row by row, then divide the number of rows by the number of workers.
#pragma omp parallel for
for(int iRow = 0; iRow < height; ++iRow) { // or += height / chunk
iPos = iRow * width;
...
Also, look at your pKernel to assure that it is vector friendly.
Jim Dempsey
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page