Skip to content

Commit

Permalink
Avx512 Validation (#45)
Browse files Browse the repository at this point in the history
* NoErrorIncompleteThenASCIIAvx512 without validate count passing

* addition

* all tests pass save BadHeaderBitsAvx512 and Validaecount

* All tests wo validatecount passing

* all tests working + benchmarks

* cleanup

* Update src/UTF8.cs

---------

Co-authored-by: Daniel Lemire <[email protected]>
  • Loading branch information
Nick-Nuon and lemire authored Jun 20, 2024
1 parent 2e85602 commit 92da59a
Show file tree
Hide file tree
Showing 3 changed files with 411 additions and 70 deletions.
16 changes: 16 additions & 0 deletions benchmark/Benchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,22 @@ public unsafe void SIMDUtf8ValidationRealDataArm64()

}

[Benchmark]
[BenchmarkCategory("avx512")]
public unsafe void SIMDUtf8ValidationRealDataAvx512()
{
if (allLinesUtf8 != null)
{
RunUtf8ValidationBenchmark(allLinesUtf8, (byte* pInputBuffer, int inputLength) =>
{
int dummyUtf16CodeUnitCountAdjustment, dummyScalarCountAdjustment;
// Call the method with additional out parameters within the lambda.
// You must handle these additional out parameters inside the lambda, as they cannot be passed back through the delegate.
return SimdUnicode.UTF8.GetPointerToFirstInvalidByteAvx512(pInputBuffer, inputLength, out dummyUtf16CodeUnitCountAdjustment, out dummyScalarCountAdjustment);
});
}
}

[Benchmark]
[BenchmarkCategory("avx")]
public unsafe void SIMDUtf8ValidationRealDataAvx2()
Expand Down
Loading

0 comments on commit 92da59a

Please sign in to comment.