What’s the best (efficiently) way to zero a device vector allocated previously with cudaMalloc?
Launch one thread to do it in the GPU?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Link to cudaMemset()
Initializes or sets device memory to a value. Fills the first count bytes of the memory area pointed to by devPtr with the constant byte value value.
Note that this function is asynchronous with respect to the host unless devPtr refers to pinned host memory.
Note:
Note that this function may also return error codes from previous, asynchronous launches.
See also memset synchronization details.