Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array img opt neighborhoods-Leon's branch #395

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

lnyng
Copy link
Contributor

@lnyng lnyng commented Apr 29, 2016

This is a branch built on top of @Squareys and @ctrueden 's work. See #191

The first 4 commits modify the existing interfaces of MapNeighborhood, so that the following commits could work. Basically it makes the Shape parameter generic, and add an optional OOBF to both default and center-aware implementations.

Some modifications are rebased into the middle commits, so that the OpEnvironment always compile.

My last four commits change the structure of @Squareys 's implementation a little bit, so that those NativeType versions are actually MapNeighborhood ops, instead just MapOps. I also made some small fixes. See the commit message for more information.

This branch is not ready for merging, because the history is messy (although all the tests are passing now). @Squareys @ctrueden Please have a look and clean up the history as you want.

Leon Yang added 4 commits April 29, 2016 17:32
This allows implementations to work on only some specific shapes.
Since MapNeighborhood inherently works with OOBF, an optional parameter
is added, and is only used when it is not null.
Now that this op has much higher priority than DefaultMapNeighborhood,
more implementations of MapNeighborhood could fit between the two.
@dietzc
Copy link
Member

dietzc commented May 1, 2016

@Squareys can you have a look please?

One remark which I also discussed with @Squareys back then: We have to make sure that we don't introduce any new behaviour. I mean: we only want to merge this branch if the behaviour of MapNeighborhood is exactly the same as before, just faster. We don't want to introduce a new OutOfBoundsStrategy like ignore if out of bounds. I short: the optimization should work with any OOBStrategy.

@Squareys
Copy link
Contributor

@dietzc

We have to make sure that we don't introduce any new behaviour. I mean: we only want to merge this branch if the behaviour of MapNeighborhood is exactly the same as before, just faster.

The MapNeighborhoodNativeTypeExtended is a fast implementation for NativeType ArrayImg and is compatible with the oobFactory parameter, but will only use it when it needs to (the border neighborhoods.) This implementation can make use of super optimized Neighborhood implementations which do not require OOB (one follows).

The MapNeighborhoodNativeType is an implementation without out of bounds factories on NativeType ArrayImg. It assumes there is no out of bounds needed (therefore, the region iterated over is sufficiently smaller than the image itself.) This implementation is used by the other implementation to speed up the center interval which does not require out of bounds checks.

In short: This complies with existing behaviour.

I hope this clears some confusion.

@LeonYang5114 The changes look great, thank you for taking care of this! There are a few formatting commits mixed with actual changes in the WIP commits, but I guess that will be taken care of once the history is rewritten.

Squareys added 2 commits May 17, 2016 13:20
Signed-off-by: squareys <squareys@googlemail.com>
Signed-off-by: squareys <squareys@googlemail.com>
@lnyng lnyng force-pushed the array-img-opt-neighborhoods-LEON branch from 01196ad to 2b03ab2 Compare May 17, 2016 18:30
@lnyng
Copy link
Contributor Author

lnyng commented May 17, 2016

Since I am not very familiar with the original commits, I made two big rebases to rewrite the history, one for implementation and one for test. @Squareys if you have time, feel free to split the commit and add more detailed commit message. If you think it is OK, then this branch is ready for merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants