Include initial value of reduction variable in reduction #1226
-
Hi all, I have a situation where I need to do a reduction in multiple phases, so the result of the current reduction needs to be combined with the result of the previous reduction. Under section 4.9.2.1. reduction interface, the standard states that
Unless I am misinterpreting this sentence, I believe that I can achieve the above by simply defining a reduction again with the same output location. However, when I run the code example below with AdaptiveCpp the original value seems to be overwritten and I only get 512. When I compile the code snippet below with Thanks!
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Your are correct with everything you say. Our reduction implementation is not yet complete. You could work around the issue by having e.g. work item 0 fetch the result of the previous reduction, and add it to the current reduction. |
Beta Was this translation helpful? Give feedback.
Your are correct with everything you say. Our reduction implementation is not yet complete. You could work around the issue by having e.g. work item 0 fetch the result of the previous reduction, and add it to the current reduction.