src-d / kmcuda

Large scale K-means and K-nn implementation on NVIDIA GPU / CUDA
Other
806 stars 145 forks source link

Free memory in K-means #35

Closed rvegamartinez closed 6 years ago

rvegamartinez commented 6 years ago

I have a doubt: when you allocate memory with CUMALLOC, do you free this memory before finishing the algorithm? I can not find cudaFree or something similar. I'm afraid if I use this algorithm (kmeans_cuda) in a code, it could overload the memory of the GPU

Thank you.

vmarkovtsev commented 6 years ago

No worries, smart pointers and RAII are used everywhere and the memory is guaranteed to be deallocated. See https://github.com/src-d/kmcuda/blob/master/src/wrappers.h#L19

rvegamartinez commented 6 years ago

I haven't seen it! Thank you very much