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:
Universal and universal host pinned vectors are missing such an overload and the vector_base they alias to has swap overload in thrust::details, so it’s unreachable.
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:https://github.com/NVIDIA/cccl/blob/80031e29baa11e1674b7d30770badeca0fbdb5dc/thrust/thrust/device_vector.h#L539-L543
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