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

Document why combining pipeline<thread_scope_thread>/barrier<thread_scope_thread> with memcpy_async is legal #972

Open
gonzalobg opened this issue Mar 10, 2021 · 3 comments
Assignees
Labels
libcu++ For all items related to libcu++

Comments

@gonzalobg
Copy link
Collaborator

According to the thread scope documentation:

A thread scope specifies the kind of threads that can synchronize with each other using a primitive such as an atomic or a barrier.

Each thread (CPU or GPU) is related to itself by the thread thread scope, specified with thread_scope_thread.

This example, however, suggests that multiple threads of execution - the current thread and the threads performing the memcpy_async - can be synchronized using the synchronization primitives with thread_scope_thread.

A fix could be to change the documentation to:

The thread thread scope relates each thread (CPU or GPU) and its ??? threads to itself.

where ??? would be a name for the set of threads that includes the ones used by the memcpy_asyncs.

@griwes
Copy link
Collaborator

griwes commented Mar 10, 2021

I don't think our current docs imply that there's inter-thread synchronization, because I don't think we mention any side threads in memcpy_async docs; we only say that we issue an async operation on the current thread and that's it.

@ogiroux @c0riolis do you want to comment on this?

@ogiroux
Copy link
Contributor

ogiroux commented Mar 10, 2021

We need to say that the _async operations are performed as-if in another thread, but there is a special exception where this helper thread is related to the requestor thread via all scope relationship, including surprisingly the _thread scope.

@griwes
Copy link
Collaborator

griwes commented Feb 23, 2023

@gonzalobg does NVIDIA/libcudacxx#371 fix this?

@jarmak-nv jarmak-nv transferred this issue from NVIDIA/libcudacxx Nov 8, 2023
@github-project-automation github-project-automation bot moved this to Todo in CCCL Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libcu++ For all items related to libcu++
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

5 participants