-
Notifications
You must be signed in to change notification settings - Fork 120
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
Make vectors trivially relocatable. #337
Open
sukeya
wants to merge
14
commits into
AcademySoftwareFoundation:main
Choose a base branch
from
sukeya:make_vecs_trivially_relocatable
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+358
−5
Open
Changes from 10 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
69b4559
Make vectors trivially relocatable.
sukeya 56f83c3
Keep both ways of having default ctor or not.
sukeya abc7c5e
Fix using default ctor whatever value the flag is.
sukeya 04950f4
Revert "Fix using default ctor whatever value the flag is."
sukeya 9db4019
Fix using a build flag to use a macro.
sukeya c49dc99
[wip] add a test for ImathVec when using default.
sukeya 5d4ed11
Remove Imath::Config from ImathTestVecUseDefaultConstructor.
sukeya 63478fc
Revert "Remove Imath::Config from ImathTestVecUseDefaultConstructor."
sukeya 536b430
Remove Imath::Config from ImathTestVecUseDefaultConstructor.
sukeya 961ac87
Fix assertion errors and clean up.
sukeya 03f055f
Update src/Imath/ImathVec.h
sukeya 64674d1
Updata src/Imath/ImathVec.h
sukeya 7ad5437
Update src/Imath/ImathVec.h
sukeya 386faf1
Merge remote-tracking branch 'origin/main' into make_vecs_trivially_r…
sukeya 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
Oops, something went wrong.
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.
Author of P1144 here. :) I think it's great you're adopting the terminology — and orthogonally great that you're
=default
'ing all the things — but, looking at this PR, I think the focus on the word "relocatable" is actually a distraction. You should just sayIMATH_VEC_RULE_OF_ZERO
or something like that. After your changes, it is true that aVec2<T>
will be trivially relocatable ifT
is trivially relocatable; but it will also be trivially copyable ifT
is trivially copyable; trivially copy-assignable ifT
is trivially copy-assignable; and so on. There's nothing relocation-specific about this PR as far as I can tell. (Am I missing something?)Followup: Why is this gated on a macro at all? The
=default
changes look like a strict improvement to me. If the non-defaulted implementations were in a .cpp file, so they were only compiled once, then there might be a reason to keep them; but nope, they'reinline constexpr
in the header! I think you should consider very hard whether there's any reason to ever set the macro to anything but1
. (...Is it that you need to have an opt-in way to avoid the ABI break that comes with Vec2 suddenly being passed in registers?)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.
FYI @sukeya @cary-ilm, there is right now this week a PR to add fully-P1144-compliant
__is_trivially_relocatable(T)
to Clang (fixing a long-standing false-positive bug on Windows and also making it respect user-defined special members includingoperator=
so as to avoid false positives on all platforms). If you're interested (professionally, financially, or just plain interested) in P1144 trivial relocatability, I'd really appreciate it if you'd take a look at llvm/llvm-project#84621 and weigh in with your thoughts. (Full disclosure: my impression is that the false-positives being fixed don't actually matter to @sukeya's use-case ofthrust::async::copy
. But I'd still really appreciate your taking a look, if you have interest in moving P1144 forward at all. It [and I mean that PR, specifically!] needs to see some customer demand in order to progress.)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.
Thank you for your advice! I commited your patches.
I'm busy now, but I'll see that PR when I have a time.
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.
Thank you for your advice! I committed your patches.
I'm busy now, but I'll see that PR when I have a time.
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.
@sukeya Thank you! I'd really appreciate it if you leave a 👍 reaction now, so you'll receive notifications that remind you to add a fuller comment when you have the time.