[ 
https://issues.apache.org/jira/browse/ARROW-1394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16352041#comment-16352041
 ] 

ASF GitHub Bot commented on ARROW-1394:
---------------------------------------

robertnishihara commented on a change in pull request #1445: ARROW-1394: 
[Plasma] Add optional extension for allocating memory on GPUs
URL: https://github.com/apache/arrow/pull/1445#discussion_r165881711
 
 

 ##########
 File path: cpp/src/plasma/client.cc
 ##########
 @@ -210,13 +260,28 @@ Status PlasmaClient::Get(const ObjectID* object_ids, 
int64_t num_objects,
       ARROW_CHECK(object_entry->second->is_sealed)
           << "Plasma client called get on an unsealed object that it created";
       PlasmaObject* object = &object_entry->second->object;
-      uint8_t* data = lookup_mmapped_file(object->store_fd);
-      object_buffers[i].data =
-          std::make_shared<Buffer>(data + object->data_offset, 
object->data_size);
-      object_buffers[i].metadata = std::make_shared<Buffer>(
-          data + object->data_offset + object->data_size, 
object->metadata_size);
+      if (object->device_num == 0) {
+        uint8_t* data = lookup_mmapped_file(object->store_fd);
+        object_buffers[i].data =
+            std::make_shared<Buffer>(data + object->data_offset, 
object->data_size);
+        object_buffers[i].metadata = std::make_shared<Buffer>(
+            data + object->data_offset + object->data_size, 
object->metadata_size);
+      } else {
+#ifdef PLASMA_GPU
+        std::shared_ptr<CudaBuffer> gpu_handle =
+            gpu_object_map.find(object_ids[i])->second->ptr;
+        object_buffers[i].data =
+            std::make_shared<CudaBuffer>(gpu_handle, 0, object->data_size);
+        object_buffers[i].metadata = std::make_shared<CudaBuffer>(
+            gpu_handle, object->data_size, object->metadata_size);
+#else
+        ARROW_LOG(FATAL)
+            << "This should be unreachable as no objects can be created on a 
gpu.";
 
 Review comment:
   This error should be the same as in `Create`, that is `"Arrow GPU library is 
not enabled."`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [Plasma] Add optional extension for allocating memory on GPUs
> -------------------------------------------------------------
>
>                 Key: ARROW-1394
>                 URL: https://issues.apache.org/jira/browse/ARROW-1394
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: Plasma (C++)
>            Reporter: Wes McKinney
>            Priority: Major
>              Labels: pull-request-available
>
> It would be useful to be able to allocate memory to be shared between 
> processes via Plasma using the CUDA IPC API



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to