Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The initialization function doesn’t deallocate the memory before reallocating #12

Open
AnupNayakGitHub opened this issue Mar 20, 2018 · 0 comments

Comments

@AnupNayakGitHub
Copy link
Contributor

AnupNayakGitHub commented Mar 20, 2018

https://github.com/hornet-gt/hornet/blob/master/include/Core/DataLayout/DataLayout.i.cuh

One example shown below and there are additional similar issues. :

178 template<typename... TArgs> 
179 void AoS<TArgs...>::initialize(const void* (&array)[sizeof...(TArgs)], 
180                                int num_items) noexcept { 
181     _num_items = num_items; 
182     _h_ptr     = new AoSData<TArgs...>[num_items]; 
183     for (auto i = 0; i < num_items; i++) 
184         _h_ptr[i] = AoSData<TArgs...>(array, i); 
185     cuMalloc(_d_ptr_, num_items); //Issue: _d_ptr_ should have been freed before allocating 
186     cuMemcpyToDevice(_h_ptr, num_items, _d_ptr); 
187 }  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant