Skip to content
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

CpuMath Enhancement: Fix naming of non-constant privates in perf tests for hardware intrinsics #829

Closed
briancylui opened this issue Sep 5, 2018 · 13 comments
Labels
up-for-grabs A good issue to fix if you are trying to contribute to the project

Comments

@briancylui
Copy link
Contributor

Style changes needed to solve part of #823

Details

  • In test\Microsoft.ML.CpuMath.PerformanceTests\PerformanceTests.cs, regarding the line private float[] src, dst, original, src1, src2;, all these non-constant privates should be prefixed with _ but it can be updated in the future PR.
@briancylui briancylui changed the title Fix naming of non-constant privates in perf tests for hardware intrinsics CpuMath Enhancement: Fix naming of non-constant privates in perf tests for hardware intrinsics Sep 6, 2018
@danmoseley danmoseley added the up-for-grabs A good issue to fix if you are trying to contribute to the project label Sep 6, 2018
@jwood803
Copy link
Contributor

jwood803 commented Sep 17, 2018

Hey, @briancylui! Just taking a look at this issue and it looks like those variables are protected. Do they still require the _ prefix?

protected float[] src, dst, original, src1, src2, result;

@briancylui
Copy link
Contributor Author

Hey, @jwood803! Thanks for your inquiry. You are right in that the _ prefix was suggested when these variables were private rather than protected. @safern, since you are more familiar with the C# naming convention and you made the suggestion earlier, may you please take a look at whether the _ prefix is still needed for those non-constant protected variables? Thanks!

@safern
Copy link
Member

safern commented Sep 17, 2018

Protected variables shouldn't have _ prefix. I just suggested it for the private fields.

For example I see:

in that file. Might be worth just scanning files that define private fields and make sure the align with the naming conventions.

@jwood803
Copy link
Contributor

Thanks, @safern! I'll clean that and any other private fields I see in the file. 😄

@safern
Copy link
Member

safern commented Sep 17, 2018

And if you could scan other files related to CpuMath that would be awesome 😄

Thanks for helping doing this!

@jwood803
Copy link
Contributor

I'll be glad to! 😄

Thanks for the help on this!

@jwood803
Copy link
Contributor

@safern, I think the one you pointed out was the only instance that needed updating. However, I did see some private const fields, but I'm unsure of what the naming convention is for them.

Should those be updated as well?

@safern
Copy link
Member

safern commented Sep 17, 2018

According to our corefx coding guidelines const fields should use PascalCasing.

Note entry No.12: https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/coding-style.md

@jwood803
Copy link
Contributor

Apologies, @safern, but just to confirm...this line protected const int IDXLEN = 1000003; would be updated to protected const int IdxLen = 1000003;, correct?

@safern
Copy link
Member

safern commented Sep 18, 2018

would be updated to protected const int IdxLen = 1000003;, correct?

Correct.

cc: @eerhardt just in case ML prefers all capital. I couldn't find a doc here, so I guess we're just following corefx's guidelines?

@eerhardt
Copy link
Member

Apologies, @safern, but just to confirm...this line protected const int IDXLEN = 1000003; would be updated to protected const int IdxLen = 1000003;, correct?

I would name it using full words, not abbreviations. Len => Length. I'm not sure what IDX stands for? Index?

@briancylui
Copy link
Contributor Author

@eerhardt: Yes, IDX stands for Index. Sorry for the abbreviation. Inside the functions in the same class, src stands for source, dst stands for destination, and idx stands for index, but probably the other variables' names like IDXLEN could be more explicit.

@safern safern closed this as completed Sep 21, 2018
@safern
Copy link
Member

safern commented Sep 21, 2018

Fixed in: #943 thanks @jwood803 😄

@ghost ghost locked as resolved and limited conversation to collaborators Mar 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
up-for-grabs A good issue to fix if you are trying to contribute to the project
Projects
None yet
Development

No branches or pull requests

5 participants