Stack Overflow Asked by kingwales on November 12, 2021
after I memory copy the value from GPU to CPU, how do I set the value to 0 with the same length? For example, cpubuff here.
cudaMemcpyAsync(
(void*) cpubuff_,
(const void *) src_,
(size_t) buflen_,
(cudaMemcpyKind) cudaMemcpyDeviceToHost,
(cudaStream_t) *stream)
If you want to zero out a buffer on the host, then you can call memset.
memset(cpubuff_, 0, buflen_);
Assuming you don't need the async functionality.
Answered by javascripting.dev on November 12, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP