Skip to content

Commit

Permalink
fix build and a rename
Browse files Browse the repository at this point in the history
  • Loading branch information
tjake committed Sep 27, 2023
1 parent 051e099 commit 4af5204
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected CachingDecoder(CompressedVectors cv, float[] query, VectorSimilarityFu
}

protected float decodedSimilarity(byte[] encoded) {
return VectorUtil.zipAndSum(partialSums, ProductQuantization.CLUSTERS, encoded);
return VectorUtil.assembleAndSum(partialSums, ProductQuantization.CLUSTERS, encoded);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public static void addInPlace(float[] v1, float[] v2) {
public static float[] sub(float[] lhs, float[] rhs) {
return impl.sub(lhs, rhs);
}
public static float zipAndSum(float[] data, int dataBase, byte[] dataOffsets) {
public static float assembleAndSum(float[] data, int dataBase, byte[] dataOffsets) {
return impl.assembleAndSum(data, dataBase, dataOffsets);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


import io.github.jbellis.jvector.vector.DefaultVectorizationProvider;
import io.github.jbellis.jvector.vector.PanamaVectorizationProvider;
import io.github.jbellis.jvector.vector.VectorUtil;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.infra.Blackhole;

Expand All @@ -30,7 +30,6 @@
@Fork(warmups = 1, value = 1, jvmArgsAppend = {"--add-modules=jdk.incubator.vector"})
public class SimilarityBench {

private static final PanamaVectorizationProvider simd = new PanamaVectorizationProvider();
private static final DefaultVectorizationProvider java = new DefaultVectorizationProvider();

static int SIZE = 1536;
Expand Down Expand Up @@ -67,7 +66,7 @@ public static class Parameters {
@Threads(8)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public void zipAndSumSimd(Blackhole bh, Parameters p) {
bh.consume(simd.getVectorUtilSupport().assembleAndSum(q1, 0, indexes));
bh.consume(VectorUtil.assembleAndSum(q1, 0, indexes));
}

@Benchmark
Expand Down

0 comments on commit 4af5204

Please sign in to comment.