- 
                Notifications
    You must be signed in to change notification settings 
- Fork 285
Half conversion benchmarks #2950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Half conversion benchmarks #2950
Conversation
      
        
              This comment was marked as off-topic.
        
        
      
    
  This comment was marked as off-topic.
      
        
              This comment was marked as resolved.
        
        
      
    
  This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for your contribution @MineCake147E!
|  | ||
| using BenchmarkDotNet.Attributes; | ||
|  | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: empty lines
| using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Attributes; | 
| BitConverter.UInt16BitsToHalf(0x03ff), //Maximum subnormal number in Half | ||
| (Half)12345.0f /* same value used by other tests to compare the perf */, | ||
| BitConverter.UInt16BitsToHalf(0x7dff) //NaN | ||
| }; | ||
|  | ||
| public static IEnumerable<float> SingleValues => new float[] | ||
| { | ||
| 6.097555E-05f, | ||
| 12345.0f /* same value used by other tests to compare the perf */, | ||
| 65520.0f, //Minimum value that is infinity in Half | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: inconsistent comments
| BitConverter.UInt16BitsToHalf(0x03ff), //Maximum subnormal number in Half | |
| (Half)12345.0f /* same value used by other tests to compare the perf */, | |
| BitConverter.UInt16BitsToHalf(0x7dff) //NaN | |
| }; | |
| public static IEnumerable<float> SingleValues => new float[] | |
| { | |
| 6.097555E-05f, | |
| 12345.0f /* same value used by other tests to compare the perf */, | |
| 65520.0f, //Minimum value that is infinity in Half | |
| BitConverter.UInt16BitsToHalf(0x03ff), // Maximum subnormal number in Half | |
| (Half)12345.0f, // same value used by other tests to compare the perf | |
| BitConverter.UInt16BitsToHalf(0x7dff) // NaN | |
| }; | |
| public static IEnumerable<float> SingleValues => new float[] | |
| { | |
| 6.097555E-05f, | |
| 12345.0f, // same value used by other tests to compare the perf | |
| 65520.0f // Minimum value that is infinity in Half | 
| For some reason I can not apply the suggestions, since they are just style nits I am going to merge the PR right now so we start collecting numbers before merging dotnet/runtime#81632 | 
Comparing performance difference of dotnet/runtime#81632.