marin-ma commented on code in PR #12499:
URL: https://github.com/apache/gluten/pull/12499#discussion_r3579076533
##########
cpp/velox/memory/GpuBufferColumnarBatch.cc:
##########
@@ -67,16 +67,20 @@ std::shared_ptr<GpuBufferColumnarBatch>
GpuBufferColumnarBatch::compose(
GLUTEN_CHECK(!batches.empty(), "No batches to compose");
// Compute the returned GpuBufferColumnarBatch buffers.
auto& type = batches[0]->getRowType();
- const auto bufferSize = batches[0]->buffers().size();
+ const auto numBuffers = batches[0]->buffers().size();
std::vector<size_t> bufferSizes;
- bufferSizes.resize(bufferSize);
+ bufferSizes.resize(numBuffers);
std::vector<BufferType> bufferTypes;
- bufferTypes.reserve(bufferSize);
+ bufferTypes.reserve(numBuffers);
for (const auto& colType : type->children()) {
bufferSizes[bufferTypes.size()] = arrow::bit_util::BytesForBits(numRows);
bufferTypes.push_back(BufferType::kNull);
Review Comment:
The size should be decided by cudf allocation rule here because the copy is
purely between arrow buffers. The cudf device buffers are allocated in
`getMaskBuffer` and the arrow buffers will be copied to the device buffers
there.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]