-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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 test fails to find testxgboost, if a build directory is created #4301
Conversation
on which cmake is run. this appends the build directory to the test binary - make the assignments of HostDeviceVector exception safe - rm storing a dummy GPUDistribution instance for CPU based code
#3720 reference to bad_alloc |
Codecov Report
@@ Coverage Diff @@
## master #4301 +/- ##
==========================================
+ Coverage 67.82% 67.82% +<.01%
==========================================
Files 132 132
Lines 12202 12203 +1
==========================================
+ Hits 8276 8277 +1
Misses 3926 3926
Continue to review full report at Codecov.
|
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.
@sriramch Your assignment operator is not exception safe since new
can throw. https://stackoverflow.com/questions/3279543/what-is-the-copy-and-swap-idiom might help a little. But I would leave it to another PR. ;-)
@trivialfis what this patch is attempting to do is that when a target hostvectorimpl (other) is assigned to a source (*this), any intermediary exception that may occur during this assignment does not alter the initial state of the source. it is not trying to make the assignment operator not throw any exceptions at all. this entails simply doing the copy work on the side and when that operation is deemed successful, simply swaps the guts of it with the source. if the side work fails ofr some reason (say due to new throwing as you state), source object (*this) isn't impacted in any way |
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.
@sriramch Ah, I see. Thanks for the explanation. Looks good to me.
on which cmake is run. this appends the build directory to the test binary