Skip to content

Commit

Permalink
Update Float16OpsBenchmark.java
Browse files Browse the repository at this point in the history
  • Loading branch information
jatin-bhateja authored Sep 26, 2024
1 parent e235248 commit 1bfdd3c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public Float16 cosineSimilarityDoubleRoundingFP16() {
Float16 vector1Square = Float16.valueOf(0.0f);
Float16 vector2Square = Float16.valueOf(0.0f);
for (int i = 0; i < vectorDim; i++) {
// Explicit add + multiply operations ensure double rounding.
// Explicit add and multiply operation ensures double rounding.
macRes = Float16.add(Float16.multiply(vector1[i], vector2[i]), macRes);
vector1Square = Float16.fma(vector1[i], vector1[i], vector1Square);
vector2Square = Float16.fma(vector2[i], vector2[i], vector2Square);
Expand Down

0 comments on commit 1bfdd3c

Please sign in to comment.