zeroshade commented on code in PR #37040:
URL: https://github.com/apache/arrow/pull/37040#discussion_r1296362245
##########
cpp/src/arrow/device.h:
##########
@@ -98,6 +101,71 @@ class ARROW_EXPORT Device : public
std::enable_shared_from_this<Device>,
/// \brief Return the DeviceAllocationType of this device
virtual DeviceAllocationType device_type() const = 0;
+ /// \brief EXPERIMENTAL: An object that provides event/stream sync primitives
+ class ARROW_EXPORT SyncEvent {
+ public:
+ virtual ~SyncEvent() = default;
+
+ /// @brief Block until sync event is completed.
+ virtual Status wait() = 0;
+
+ /// @brief Make the provided stream wait on the sync event.
+ ///
+ /// Tells the provided stream that it should wait until the
+ /// synchronization event is completed without blocking the CPU.
+ /// @param stream Should be appropriate for the underlying device
Review Comment:
@pitrou Well it's already a `void*` currently, so I'm trying to determine
what a `Device::Stream` would actually be wrapping, unless we're going to just
do something like
```c++
using Stream = void*;
...
Status StreamWait(Stream stream) = 0;
```
Otherwise is it really useful for it to be anything more than
```c++
struct Stream {
void* stream_;
};
```
Or am i missing something? I'm not sure if introducing a `Device::Stream` to
wrap the stream is very useful in the long run, other than perhaps allowing a
user to derive from it to provide more idiomatic and typed APIs?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]