Tony-X commented on code in PR #16914:
URL: https://github.com/apache/lucene/pull/16914#discussion_r4383496205


##########
lucene/benchmark-jmh/src/java/org/apache/lucene/benchmark/jmh/VectorUtilBenchmark.java:
##########
@@ -381,6 +393,42 @@ public float floatDotProductVector() {
     return VectorUtil.dotProduct(floatsA, floatsB);
   }
 
+  /**
+   * BLOCK x BLOCK dot products through the blocked kernel; compare per-op 
with the pairwise one.
+   */
+  @Benchmark
+  public float[] floatDotProductsBlockedScalar() {
+    VectorUtil.dotProducts(blockA, 0, BLOCK, blockB, 0, BLOCK, size, size, 
blockOut);
+    return blockOut;
+  }
+
+  @Benchmark
+  @Fork(
+      value = 15,

Review Comment:
   just use the classes' default 



##########
lucene/core/src/java25/org/apache/lucene/internal/vectorization/PanamaVectorUtilSupport.java:
##########
@@ -259,6 +260,250 @@ public float squareDistance(float[] a, float[] b) {
     return res;
   }
 
+  @Override
+  public void dotProducts(
+      float[] a,
+      int aOffset,
+      int aCount,
+      float[] b,
+      int bOffset,
+      int bCount,
+      int dim,
+      int stride,
+      float[] out) {
+    if (dim == 0) {
+      // no slice to run: write the empty dot products rather than leaving out 
untouched
+      Arrays.fill(out, 0, aCount * bCount, 0f);
+      return;
+    }
+    // Three levels of blocking, as in a GEMM:

Review Comment:
   Add a link to GEMM's impl or idea



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to