jorisvandenbossche commented on code in PR #40807:
URL: https://github.com/apache/arrow/pull/40807#discussion_r1543728000
##########
cpp/src/arrow/c/bridge.h:
##########
@@ -321,6 +321,31 @@ ARROW_EXPORT
Status ExportChunkedArray(std::shared_ptr<ChunkedArray> chunked_array,
struct ArrowArrayStream* out);
+/// \brief Export C++ RecordBatchReader using the C device stream interface
+///
+/// The resulting ArrowDeviceArrayStream struct keeps the record batch reader
+/// alive until its release callback is called by the consumer. The device
+/// type is determined by calling device_type() on the RecordBatchReader.
+///
+/// \param[in] reader RecordBatchReader object to export
+/// \param[out] out C struct to export the stream to
+ARROW_EXPORT
+Status ExportDeviceRecordBatchReader(std::shared_ptr<RecordBatchReader> reader,
Review Comment:
Potentially related to my other comment, but the existing
`ExportDeviceArray` has a `sync` keyword that the user of this API needs to
provide. Is there a reason those methods don't have that?
The returned `ArrowDeviceArrayStream` itself doesn't have a sync event
member, but the `ArrowDeviceArray`s that it will return still have that. The
user shouldn't pass the sync event to set in those arrays?
##########
cpp/src/arrow/record_batch.h:
##########
@@ -254,6 +255,16 @@ class ARROW_EXPORT RecordBatch {
/// \return Status
virtual Status ValidateFull() const;
+ /// \brief Return a top-level sync event object for this record batch
+ ///
+ /// If all of the data for this record batch is in host memory, then this
+ /// should return null (the default impl). If the data for this batch is
+ /// on a device, then if synchronization is needed before accessing the
+ /// data the returned sync event will allow for it.
Review Comment:
I don't fully understand this part. AFAIK a RecordBatch currently is
agnostic the device of its buffers. So for example you can have a RecordBatch
backed by buffers that live in CUDA memory, but then this method will always
hardcoded return NULL, which is not correct in that case?
--
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]