Skip to content

Support single y level processing using Vector API #3103

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

Merged
merged 1 commit into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public ShortVector get(VectorSpecies<Short> species) {

public ShortVector getOrZero(VectorSpecies<Short> species) {
if (this.data == null) {
return species.zero().reinterpretAsShorts();
return ShortVector.zero(species);
}
return ShortVector.fromCharArray(species, this.data, this.index);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ public VectorizedCharFilterBlock(final Extent extent) {

@Override
public synchronized void filter(final Filter filter) {
filter(filter, 0, 15);
}

@Override
public synchronized void filter(final Filter filter, final int startY, final int endY) {
if (!(filter instanceof VectorizedFilter vecFilter)) {
throw new IllegalStateException("Unexpected VectorizedCharFilterBlock " + filter);
}
Expand All @@ -24,9 +29,8 @@ public synchronized void filter(final Filter filter) {
VectorFacade getFassade = new VectorFacade(this.get);
getFassade.setLayer(this.layer);
getFassade.setData(this.getArr);
// assume setArr.length == getArr.length == 4096
VectorMask<Short> affectAll = species.maskAll(true);
for (int i = 0; i < 4096; i += species.length()) {
for (int i = startY << 8; i < ((endY + 1) << 8) - 1; i += species.length()) {
setFassade.setIndex(i);
getFassade.setIndex(i);
vecFilter.applyVector(getFassade, setFassade, affectAll);
Expand Down
Loading