Add support for multi-dimensional parallel_for #15
+182
−29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have implemented support for multi-dimensional (up to 3 dimensions) parallel_for. I have added an optional multidimensional index type for programmers to use in parallel_for invocations (plain integer values can be still used for 1D parallel_for). Grid and block in execution policy are dim3 values, now. However, in this first implementation blocks and grids are flattened to 1D. The rest of the dimensions in the iteration space are iterated within each thread. More intelligent policies can be implemented later. Check the modified example in parallel_for.
Please, let me know if you find this feature interesting or if I need to change anything to have it integrated.