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

Use async memcpy for copying to device #580

Open
neworderofjamie opened this issue Apr 14, 2023 · 0 comments
Open

Use async memcpy for copying to device #580

neworderofjamie opened this issue Apr 14, 2023 · 0 comments

Comments

@neworderofjamie
Copy link
Contributor

neworderofjamie commented Apr 14, 2023

cudaMemcpyAsync follows standard stream semantics so is guaranteed to complete before any subsequent kernel launches or synchronisation points (e.g. a synchronous memcpy to host). I need to think a little more about this to be sure but, I think this means it would be safe to switch to cudaMemcpyAsync for all pushXXXToDevice operations which should reduce synchronisation overhead when streaming data from host->device significantly.

Furthermore, allocateMem and freeMem could almost certainly be sped up by using cudaMallocAsync and cudaFreeAsync (with a barrier at the end of the functions for safety)

@neworderofjamie neworderofjamie modified the milestones: GeNN 5.0.0, GeNN 4.9.0 Apr 14, 2023
@neworderofjamie neworderofjamie modified the milestones: GeNN 4.9.0, GeNN 5.0.0 Oct 11, 2023
@neworderofjamie neworderofjamie modified the milestones: GeNN 5.0.0, GeNN 5.X Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant