-
Notifications
You must be signed in to change notification settings - Fork 167
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
[BUG]: Suboptimal swap performance on universal vectors #2948
Comments
While I agree that we should fix the performance issue, I have troubles with how we swap vectors. The established practice in C++ on how to swap any two objects is: using std::swap;
swap(a, b); You make Only calling |
There are two ways to address this.
I strongly prefer 2. |
Is this a duplicate?
Type of Bug
Performance
Component
Thrust
Describe the bug
Swap of universal vectors is unnecessary slow and occupies more memory than it should.
Device and host vectors have swap overloads in
thrust::
namespace.These overloads call efficient
.swap
member function:cccl/thrust/thrust/device_vector.h
Lines 539 to 543 in 80031e2
Universal and universal host pinned vectors are missing such an overload and the
vector_base
they alias to hasswap
overload inthrust::details
, so it’s unreachable.How to Reproduce
Expected behavior
Reproduction link
No response
Operating System
No response
nvidia-smi output
No response
NVCC version
No response
The text was updated successfully, but these errors were encountered: