zeroshade commented on code in PR #37040: URL: https://github.com/apache/arrow/pull/37040#discussion_r1287408674
########## cpp/src/arrow/device.h: ########## @@ -105,6 +107,63 @@ class ARROW_EXPORT Device : public std::enable_shared_from_this<Device>, bool is_cpu_; }; +/// \brief EXPERIMENTAL: An object that provides event/stream sync primitives +/// +/// +class ARROW_EXPORT DeviceSync { + public: + explicit DeviceSync(void* sync_event) : sync_event_{sync_event}, owns_event_{false} {} + virtual ~DeviceSync() = default; + + /// @brief Block until sync event is completed. + /// + /// Should be a no-op for CPU devices. + 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 + virtual Status stream_wait(void* stream) = 0; Review Comment: `wait` specifies that it blocks until the internal event is completed. `stream_wait` places a wait into the stream queue and will not block the CPU. -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org