CEAN - first tests

CEAN - first tests


I'm starting to try array extensions and I've got some doubt. Let's suppose that there is some function tomake some calculations over arrays elements:

a[:] = myfunc( b[:], ...);

so that it is possible to process each element in parallel.

Is there any way to know what element is being processed in a call to the function (inside the function itself)?

Thanks and best regards

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

Um... wouldn't processing elements in parallel (as opposed to processing arrays in parallel) be less efficient?

Most likely... I suppose that the trick is to adjust the number of elementsin a call to keep the cache warm enough. But since I'm starting to test, I think its better to build the code in a 'One element' basis ant then passing different ranges and make some measurement. But I've found that for my trial I need to know what element I'm processing no matter the slicing because my test depends on data that is not in an array.

Best regards

Hi Manuel,

What Igor says makes sense too, and avoids extra memory usage and overhead ofread/writeetc.
It's better to use array sections to ensure effective SIMD vector parallelism. More later when I chat with you this week...


Ok, from our conversation I feel that maybe I'm not making the right approach. Anyway, it is not easy to depend on the VStudio documentation and I must confess that this is the first time I try to use CEAN. I feel more comfortable with the good old'pointer method'.

Let us see if I can explain what I'm trying to do:

- Suppose I have analgorithm working (examples shown in chapter 11 of IPP bookfrom Stewart Taylor are good, a pity I got the book after finding a solution myself).

-First, I mustbuild a simple iteration with all the calculations over the data .

- Second, I eliminate inner loops using IPP small matrices functions wherever possible.

- Third, I break the outer main loop intwo loops, the outer one splits the data in chunks thatfit in the cache and the inner one apply calculations over every chunk. In second step, I try to do thecalculations'in place' where possible. Thishelps to keep the cache warm,

- Four, I send chunksto each core using TBB.

Of course, I know I'm quickly passing over race conditionsandall that questions. When it comes to CEAN and the compiler, I understandthe idea but I just don't see right now how to start.

Best Regards

Hi Manuel,
I'll set up a conference call to talk more on CEAN with you. In the meantime I've attached the CEAN model doc for more reference that contain some sample test code that shows CEAN usage and how it can be applied. More later when we chat on this - appreciate much.


Downloadapplication/vnd.openxmlformats-officedocument.wordprocessingml.document CEAN_Model.docx28.85 KB

Leave a Comment

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