-
Notifications
You must be signed in to change notification settings - Fork 6k
[Cpp API Compatibility] Align event api #78553
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
Changes from 7 commits
2f67c07
2e43d1f
e6d3638
91428a6
dc7610a
7b70cb0
ce69b67
852d525
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -16,147 +16,266 @@ | |||||||
|
|
||||||||
| #include <c10/core/Device.h> | ||||||||
| #include <c10/core/DeviceType.h> | ||||||||
| #include <c10/cuda/CUDAStream.h> | ||||||||
| #include <queue> | ||||||||
| namespace c10 { | ||||||||
| #include <c10/core/Stream.h> | ||||||||
|
|
||||||||
| /** | ||||||||
| * A backend-generic movable, not copyable, not thread-safe event. | ||||||||
| * | ||||||||
| * The design of this event follows that of CUDA and HIP events. These events | ||||||||
| * are recorded and waited on by streams and can be rerecorded to, | ||||||||
| * each rerecording essentially creating a new version of the event. | ||||||||
| * For example, if (in CPU time), stream X is asked to record E, | ||||||||
| * stream Y waits on E, and stream X is asked to record E again, then Y will | ||||||||
| * wait for X to finish the first call to record and not the second, because | ||||||||
| * it's waiting on the first version of event E, not the second. | ||||||||
| * Querying an event only returns the status of its most recent version. | ||||||||
| * | ||||||||
| * Backend-generic events are implemented by this class and | ||||||||
| * impl::InlineEvent. In addition to these events there are also | ||||||||
| * some backend-specific events, like ATen's CUDAEvent. Each of these | ||||||||
| * classes has its own use. | ||||||||
| * | ||||||||
| * impl::InlineEvent<...> or a backend-specific event should be | ||||||||
| * preferred when the backend is known at compile time and known to | ||||||||
| * be compiled. Backend-specific events may have additional functionality. | ||||||||
| * | ||||||||
| * This Event should be used if a particular backend may not be available, | ||||||||
| * or the backend required is not known at compile time. | ||||||||
| * | ||||||||
| * These generic events are built on top of DeviceGuardImpls, analogous | ||||||||
| * to DeviceGuard and InlineDeviceGuard. The name "DeviceGuardImpls," | ||||||||
| * is no longer entirely accurate, as these classes implement the | ||||||||
| * backend-specific logic for a generic backend interface. | ||||||||
| * | ||||||||
| * See DeviceGuardImplInterface.h for a list of all supported flags. | ||||||||
| */ | ||||||||
| #include <utility> | ||||||||
|
|
||||||||
| #ifdef PADDLE_WITH_CUDA | ||||||||
| #include <c10/cuda/CUDAGuard.h> | ||||||||
| #include <c10/cuda/CUDAStream.h> | ||||||||
|
||||||||
| #include <c10/cuda/CUDAStream.h> | |
| #include <c10/cuda/CUDAStream.h> | |
| #include <mutex> |
Uh oh!
There was an error while loading. Please reload this page.