New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARROW-15424: [C++][GLib] Fix CUDA bindings #12237
Conversation
ARROW-15373 changed MemoryManager::AllocateBuffer to return unique_ptr; the GLib bindings needed updating for this, however. Also, tweaked the C++ since some compilers don't implicitly convert unique_ptr to shared_ptr on return.
@github-actions crossbow submit test-ubuntu-default-docs |
Revision: 4ce284d Submitted crossbow builds: ursacomputing/crossbow @ actions-1475
|
c_glib/arrow-cuda-glib/cuda.cpp
Outdated
auto arrow_buffer = arrow_context->Allocate(size); | ||
if (garrow::check(error, arrow_buffer, "[cuda][buffer][new]")) { | ||
return garrow_cuda_buffer_new_raw(&(*arrow_buffer)); | ||
std::shared_ptr<arrow::cuda::CudaBuffer> cuda_buffer = | ||
arrow_buffer.MoveValueUnsafe(); | ||
return garrow_cuda_buffer_new_raw(&cuda_buffer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use arrow_
prefix for C++ objects?
auto arrow_buffer_result = arrow_context->Allocate(size);
if (garrow::check(error, arrow_buffer_result, "[cuda][buffer][new]")) {
std::shared_ptr<arrow::cuda::CudaBuffer> arrow_buffer = *arrow_buffer_result;
return garrow_cuda_buffer_new_raw(&arrow_cuda_buffer);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok, I've updated it. (There still needs to be a std::move to convert from unique_ptr to shared_ptr, though.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@github-actions crossbow submit test-ubuntu-default-docs |
Revision: 02b0409 Submitted crossbow builds: ursacomputing/crossbow @ actions-1482
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Benchmark runs are scheduled for baseline = c76215f and contender = 8b3e067. 8b3e067 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
ARROW-15373 changed MemoryManager::AllocateBuffer to return unique_ptr; the GLib bindings needed updating for this, however. Also, tweaked the C++ since some compilers don't implicitly convert unique_ptr to shared_ptr on return. Closes apache#12237 from lidavidm/arrow-15424 Authored-by: David Li <li.davidm96@gmail.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
ARROW-15373 changed MemoryManager::AllocateBuffer to return
unique_ptr; the GLib bindings needed updating for this, however.
Also, tweaked the C++ since some compilers don't implicitly
convert unique_ptr to shared_ptr on return.