-
Notifications
You must be signed in to change notification settings - Fork 242
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
[tests] remove direct std::random_device usage. #2397
Merged
Merged
Changes from 7 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
0a7edb0
remove direct std::random_device usage
CAHEK7 2c3a713
Merge branch 'develop' into C7/remove_random_device
CAHEK7 af41787
Merge branch 'develop' into C7/remove_random_device
junliume 25fa66d
Merge remote-tracking branch 'origin/develop' into C7/remove_random_d…
CAHEK7 4e2a841
Merge remote-tracking branch 'origin/develop' into C7/remove_random_d…
CAHEK7 65157c5
Merge branch 'develop' into C7/remove_random_device
CAHEK7 6792e81
Merge branch 'develop' into C7/remove_random_device
CAHEK7 2ff5f08
fix fp16 precision lost due to fp32 conversion
CAHEK7 75ee932
Merge branch 'develop' into C7/remove_random_device
CAHEK7 3a95ba3
make distribution less biased to 0
CAHEK7 d26a84c
increase batchnorm test threshold since it's very sensitive to input …
CAHEK7 0297884
Merge branch 'develop' into C7/remove_random_device
CAHEK7 92deecf
Merge branch 'develop' into C7/remove_random_device
CAHEK7 fbc3f21
Merge branch 'develop' into C7/remove_random_device
CAHEK7 ced0795
Fix includes to comply CG SF.12
CAHEK7 b1c6ef6
Merge branch 'develop' into C7/remove_random_device
CAHEK7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
minor: perhaps we should name (and move) our "random.hpp" to "miopen/random.hpp" or if that's not feasible then "miopen_random.hpp" to avoid confusion with
<random>
from STL.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.
@amberhassaan
The library does not use random.hpp (while tests and driver use different versions of this file). Therefore, this is not possible and not needed.
But I do not see any confusion. For example, double quotes imply that the included file is not from the standard library.
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.
You're right
"random.hpp"
should convey that it's local. However, we are not consistent in our repository and we often use<>
for local MIOpen includes.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.
The quoted form should only be used for headers that are relative to the including file, and everything else should use the angle brackets. In general, MIOpen follows this rule. This is also the guideline from C++ Core Guidelines SF.12.
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.
Didn't know that we were following that core guidelines. Some projects exclusively use
<>
for system includes and""
for project includes.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.
@CAHEK7 Please resolve #2397 (comment)
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.
@CAHEK7 "../random.hpp" here is expected to comply the rule.
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.
@atamazov @pfultz2 done.
But what about the others includes? Mixing different paradigms of including headers may be confusing.
Shall everything be fixed uniformly across the project, because it's a very common case where we include files from the project using quotes and implying relative includes.
Almost all the files in
gtests
directory and some of the files in thetest
directory should be fixed.