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


##########
cpp/src/arrow/gpu/cuda_context.cc:
##########
@@ -384,7 +384,7 @@ Result<std::shared_ptr<Buffer>> 
CudaMemoryManager::ViewBufferTo(
   if (to->is_cpu()) {
     // Device-on-CPU view
     ARROW_ASSIGN_OR_RAISE(auto address, GetHostAddress(buf->address()));
-    return std::make_shared<Buffer>(address, buf->size(), to, buf);
+    return std::make_shared<Buffer>(address, buf->size(), to, buf, 
DeviceType::CUDA_HOST);
   }

Review Comment:
   Missed the `GetHostAddress` function which calls into 
`cuPointerGetAttribute` under the hood with `CU_POINTER_ATTRIBUTE_HOST_POINTER` 
to get a host accessible pointer. This will normally error, but that's fine 
since it works as intended. Resolving this.



##########
cpp/src/arrow/gpu/cuda_context.cc:
##########
@@ -384,7 +384,7 @@ Result<std::shared_ptr<Buffer>> 
CudaMemoryManager::ViewBufferTo(
   if (to->is_cpu()) {
     // Device-on-CPU view
     ARROW_ASSIGN_OR_RAISE(auto address, GetHostAddress(buf->address()));
-    return std::make_shared<Buffer>(address, buf->size(), to, buf);
+    return std::make_shared<Buffer>(address, buf->size(), to, buf, 
DeviceType::CUDA_HOST);
   }

Review Comment:
   Missed the `GetHostAddress` function which calls into 
`cuPointerGetAttribute` under the hood with `CU_POINTER_ATTRIBUTE_HOST_POINTER` 
to get a host accessible pointer. This will normally error, but that's fine 
since it works as intended.
   
   Feel free to resolve this.



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