thrust::device_free
Defined in thrust/device_free.h
-
inline void thrust::device_free(thrust::device_ptr<void> ptr)
device_free
deallocates memory allocated by the functiondevice_malloc
.The following code snippet demonstrates how to use
device_free
to deallocate memory allocated bydevice_malloc
.#include <thrust/device_malloc.h> #include <thrust/device_free.h> ... // allocate some integers with device_malloc const int N = 100; thrust::device_ptr<int> int_array = thrust::device_malloc<int>(N); // manipulate integers ... // deallocate with device_free thrust::device_free(int_array);
See also
See also
device_malloc
- Parameters
ptr – A
device_ptr
pointing to memory to be deallocated.