iprithv commented on code in PR #16203:
URL: https://github.com/apache/lucene/pull/16203#discussion_r3387216054


##########
lucene/core/src/java25/org/apache/lucene/internal/vectorization/MemorySegmentBulkVectorOps.java:
##########
@@ -147,13 +204,313 @@ private void dotProductBulkImpl(
     }
   }
 
+  // -- uint8 dot product
+
+  static final class Uint8DotProduct {
+
+    private Uint8DotProduct() {}
+
+    void dotProductBulk(
+        MemorySegment seg,
+        int[] scores,
+        byte[] q,
+        long d1,
+        long d2,
+        long d3,
+        long d4,
+        int elementCount) {
+      dotProductBulkImpl(seg, scores, q, null, d1, d2, d3, d4, elementCount);
+    }
+
+    void dotProductBulk(
+        MemorySegment seg,
+        int[] scores,
+        MemorySegment qSeg,
+        long d1,
+        long d2,
+        long d3,
+        long d4,
+        int elementCount) {
+      dotProductBulkImpl(seg, scores, null, qSeg, d1, d2, d3, d4, 
elementCount);
+    }
+
+    private void dotProductBulkImpl(
+        MemorySegment seg,
+        int[] scores,
+        byte[] qArray,
+        MemorySegment qSeg,
+        long d1,
+        long d2,
+        long d3,
+        long d4,
+        int elementCount) {
+      int i = 0;
+      IntVector acc1 = IntVector.zero(INT_SPECIES);
+      IntVector acc2 = IntVector.zero(INT_SPECIES);
+      IntVector acc3 = IntVector.zero(INT_SPECIES);
+      IntVector acc4 = IntVector.zero(INT_SPECIES);

Review Comment:
   ah, now I understand what you mean.. for integer math the bulk 4 at a time 
doesn't really buy us anything since there's no FP dependency chain to break, 
and the qv load would stay in cache anyway across separate calls..right?
   I'll can try to remove the uint8 bulk methods and have the caller just call 
the single pair dot product 4 times instead..?



-- 
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