zeroshade commented on code in PR #36489:
URL: https://github.com/apache/arrow/pull/36489#discussion_r1254581644


##########
cpp/src/arrow/c/bridge.cc:
##########
@@ -1275,7 +1398,19 @@ class ImportedBuffer : public Buffer {
 
 struct ArrayImporter {
   explicit ArrayImporter(const std::shared_ptr<DataType>& type)
-      : type_(type), zero_size_buffer_(std::make_shared<Buffer>(kZeroSizeArea, 
0)) {}
+      : type_(type),
+        zero_size_buffer_(std::make_shared<Buffer>(kZeroSizeArea, 0)),
+        device_type_(DeviceType::CPU) {}
+
+  Status Import(struct ArrowDeviceArray* src, const DeviceMemoryMgr& mapper) {
+    ARROW_ASSIGN_OR_RAISE(memory_mgr_,
+                          mapper.get_manager(src->device_type, 
src->device_id));
+    device_type_ = static_cast<DeviceType>(src->device_type);
+    RETURN_NOT_OK(Import(&src->array));
+    import_->sync_event_ = src->sync_event;
+    memory_mgr_.reset();

Review Comment:
   Or rather, I'll set it to CPU here afterwards just for consistency in case 
it ends up eventually getting used for CPU arrays.



-- 
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]

Reply via email to