Both allocate memory on the host and I can copy contents to device_vector
and back using iterators. Why was host_vector
necessary to include in the API? Does it have something to do with pinned memory?
No, it doesn't implement pinned memory.
I suspect it exists to implement a few overrides, such as assignment from a device_vector
.
Also, unlike, the std::vector
implementation in MSVC, Thrust's host_vector
doesn't check iterator validity which leads to much faster performance on debug builds (by default).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With