Remove parameter perm_inv. perm_inv overcomplex the process for gener… #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.
We are generating the arena array to jump between different data segment/stride. Array perm tells which segment (stride) to choose and array mixer tells which element in each segment (stride) we are going to use. Below is simplified the example with nr_elts=6:
perm: 2 3 1 0 4 5.
The final goal is to build jumping in arena array: Segment 2-> segment 3 -> segment 1 -> segment 0 -> segment 4 -> segment 5.
With perm_inv, we will build the jumping data in arena with the following sequence:
segment 0 -> segment 4,
segment 1 -> segment 0,
segment 2 -> segment 3,
segment 3 -> segment 1,
segment 4 -> segment 5,
segment 5 -> segment 2.
Actually it is unnecessary to follow the construction order from 0 to 5. We can just loop through perm and build the jumping data directly:
segment 2 -> segment 3,
segment 3 -> segment 1,
segment 1 -> segment 0,
segment 0 -> segment 4,
segment 4 -> segment 5,
segment 5 -> segment 2.
Both solution will result in the same arena data content but with different sequence to fill the arena array.
Thus we can remove the perm_inv to simplify the code logic for generating the arena array, which also reduces the memory usage.
Results have been verified with puj2@.