Prescribing work based on global state

Prescribing work based on global state

I have been reading through the documentation of Intel CnC and am trying to map Intel CnC into my sequential image stitching algorithm.

The algorithm consists of three steps and two item collections.

Steps: (1) Read image, (2) Compute the image's FFT, and (3) Compute a phase correlation image alignment method between two image's FFTs.

Item collections: (1) Image, (2) Pair of Images

One thing to note, for the item collections I plan to use C++ classes. In these classes they have pointers to the image data as well as the FFT data.



What is the best method to prescribe for image pairs for step 3? There is a dependency that two neighboring images' FFTs must be computed before computing step 3. I was thinking of adding a bookkeeping step to update a global state to indicate which image has its FFT computed and then prescribe new work when neighbors are ready. However I remember reading that I cannot update global state within steps.

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


the easiest solution is to let the control tag of step3 (compute phase correlation) provide the information to identify the 2 images it should correlate, e.g. it could be a std::pair or similar. The tags/keys for the item-collection step3 reads from could be similar/identical  to the ones you use for the other item-collection - no need to create an item-collection holding pairs of images. The step can then simply get the 2 FFT'ed images from the item collection (individually) - each step can get as many items from as many collections it wants.


Does this help?



Leave a Comment

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