-
Notifications
You must be signed in to change notification settings - Fork 11.5k
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
[C++17] Support __GCC_[CON|DE]STRUCTIVE_SIZE #89446
Changes from 3 commits
9d39496
658a329
6b6da8f
3f91182
6b6cec1
0d085f1
b16c85c
bfe8a28
2987440
b10fdf3
9ddcfa7
791cdf9
772ec85
7797498
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1792,6 +1792,11 @@ class TargetInfo : public TransferrableTargetInfo, | |
/// Whether to support HIP image/texture API's. | ||
virtual bool hasHIPImageSupport() const { return true; } | ||
|
||
/// The minimum offset between two objects to avoid false sharing. | ||
virtual unsigned hardwareDestructiveInterferenceSize() const { return 64; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I vaguely wonder if we should make this a single "hardwareInterferenceSizes" function, returning a std::pair<unsigned, unsigned>, because otherwise, when we start add per-CPU tuning to the values, it's very likely to result in duplicating the same series of conditionals in each of the two functions. Also, with a single function, we are less likely to accidentally end up with an override that returns values such that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good idea, thanks! Done. |
||
// The maximum size of contiguous memory to promote true sharing. | ||
virtual unsigned hardwareConstructiveInterferenceSize() const { return 64; } | ||
|
||
protected: | ||
/// Copy type and layout related info. | ||
void copyAuxTarget(const TargetInfo *Aux); | ||
|
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.
Might add a comment here that this is not considered part of the ABI, and is okay to change, for clarity of future target maintainers.
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.
Good call! Done.