apply dense operation on sub range

apply dense operation on sub range

imagem de Alexander Herz

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
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.
imagem de Noah Clemons (Intel)

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.

imagem de Alexander Herz

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

Alex

imagem de Alexander Herz

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

imagem de Noah Clemons (Intel)

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?

imagem de rodrigo.benenson

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.

Faça login para deixar um comentário.