apply dense operation on sub range

apply dense operation on sub range

Hi,

I just started looking into ArBB. Is it at all possible to apply operations on a sub-range of a dense container (without resorting to doing the iteration manually?).
I guess, one could use _if() to apply different stencils to different sub ranges of a container but has to pay the penalty for the dynamic branch.
Basically I want to project out different (non-overlapping) sub-ranges of a (dense) container, apply (parallel) operations on each sub-range and re-combine the resulting ranges into a dense container. Conceptually, this shouldn't pose any problems, the operations are still completely independent.

Thx,
Alex

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Alex, have you had a chance to read some of our knowledge base articles? We have a variety of code examples in those articles that demonstrate the use of map() which is what you need to be using in the situation you described.

I did read the knowledge base articles but did not yet look at all the examples, thx for pointing me there.

Alex

So which is the example I should be looking at?
"map() with nested containers" does not really fit as my containers are not nested and I want to do stencils?

Thx,

Alex

If you go to the KB article entitled Array Building Blocks Code Samplesyou will see awide variety of code sample descriptions, most notably the examples of 1D, 2D, and 3D convolution, which is doing exactly what you are seeking. Samples are grouped into directories corresponding to application areas (categories) such as /samples/imaging, /samples/seismic and so on. Have you run those samples?

Seems like you are looking for the method arbb::section (see documentation) that provides a small dense array out of a larger dense array (i.e. sub-matrix). Then you can do whatever you want with the returned dense array.

Leave a Comment

Please sign in to add a comment. Not a member? Join today