@@ -183,19 +183,37 @@ public unsafe void SIMDUtf8ValidationRealData()
183183 {
184184 if ( allLinesUtf8 != null )
185185 {
186- RunUtf8ValidationBenchmark ( allLinesUtf8 , SimdUnicode . UTF8 . GetPointerToFirstInvalidByte ) ;
186+ // RunUtf8ValidationBenchmark(allLinesUtf8, SimdUnicode.UTF8.GetPointerToFirstInvalidByte);
187187 }
188188 }
189189
190190 [ Benchmark ]
191+ // [BenchmarkCategory("scalar")]
192+ // public unsafe void Utf8ValidationRealDataScalar()
193+ // {
194+ // if (allLinesUtf8 != null)
195+ // {
196+ // RunUtf8ValidationBenchmark(allLinesUtf8, SimdUnicode.UTF8.GetPointerToFirstInvalidByteScalar);
197+ // }
198+ // }
199+
191200 [ BenchmarkCategory ( "scalar" ) ]
192201 public unsafe void Utf8ValidationRealDataScalar ( )
193202 {
194203 if ( allLinesUtf8 != null )
195204 {
196- RunUtf8ValidationBenchmark ( allLinesUtf8 , SimdUnicode . UTF8 . GetPointerToFirstInvalidByteScalar ) ;
205+ // Assuming allLinesUtf8 is a byte* and its length is provided by another variable, for example, allLinesUtf8Length
206+ RunUtf8ValidationBenchmark ( allLinesUtf8 , ( byte * pInputBuffer , int inputLength ) =>
207+ {
208+ int dummyUtf16CodeUnitCountAdjustment , dummyScalarCountAdjustment ;
209+ // Call the method with additional out parameters within the lambda.
210+ // You must handle these additional out parameters inside the lambda, as they cannot be passed back through the delegate.
211+ return SimdUnicode . UTF8 . GetPointerToFirstInvalidByteScalar ( pInputBuffer , inputLength , out dummyUtf16CodeUnitCountAdjustment , out dummyScalarCountAdjustment ) ;
212+ } ) ;
197213 }
198214 }
215+
216+
199217 [ Benchmark ]
200218 [ BenchmarkCategory ( "arm64" ) ]
201219 public unsafe void SIMDUtf8ValidationRealDataArm64 ( )
@@ -205,15 +223,15 @@ public unsafe void SIMDUtf8ValidationRealDataArm64()
205223 RunUtf8ValidationBenchmark ( allLinesUtf8 , SimdUnicode . UTF8 . GetPointerToFirstInvalidByteArm64 ) ;
206224 }
207225 }
208- [ Benchmark ]
209- [ BenchmarkCategory ( "avx" ) ]
210- public unsafe void SIMDUtf8ValidationRealDataAvx2 ( )
211- {
212- if ( allLinesUtf8 != null )
213- {
214- RunUtf8ValidationBenchmark ( allLinesUtf8 , SimdUnicode . UTF8 . GetPointerToFirstInvalidByteAvx2 ) ;
215- }
216- }
226+ // [Benchmark]
227+ // [BenchmarkCategory("avx")]
228+ // public unsafe void SIMDUtf8ValidationRealDataAvx2()
229+ // {
230+ // if (allLinesUtf8 != null)
231+ // {
232+ // RunUtf8ValidationBenchmark(allLinesUtf8, SimdUnicode.UTF8.GetPointerToFirstInvalidByteAvx2);
233+ // }
234+ // }
217235 [ Benchmark ]
218236 [ BenchmarkCategory ( "sse" ) ]
219237 public unsafe void SIMDUtf8ValidationRealDataSse ( )
0 commit comments