MCPcopy Create free account
hub / github.com/apache/arrow / ToDeviceData

Method ToDeviceData

cpp/src/arrow/c/bridge_test.cc:4318–4338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4316 }
4317
4318 static Result<std::shared_ptr<ArrayData>> ToDeviceData(
4319 const std::shared_ptr<MemoryManager>& mm, const ArrayData& data) {
4320 arrow::BufferVector buffers;
4321 for (const auto& buf : data.buffers) {
4322 if (buf) {
4323 ARROW_ASSIGN_OR_RAISE(auto dest, mm->CopyBuffer(buf, mm));
4324 buffers.push_back(dest);
4325 } else {
4326 buffers.push_back(nullptr);
4327 }
4328 }
4329
4330 arrow::ArrayDataVector children;
4331 for (const auto& child : data.child_data) {
4332 ARROW_ASSIGN_OR_RAISE(auto dest, ToDeviceData(mm, *child));
4333 children.push_back(dest);
4334 }
4335
4336 return ArrayData::Make(data.type, data.length, buffers, children, data.null_count,
4337 data.offset);
4338 }
4339
4340 static Result<std::shared_ptr<Array>> ToDevice(const std::shared_ptr<MemoryManager>& mm,
4341 const ArrayData& data) {

Callers

nothing calls this directly

Calls 2

push_backMethod · 0.80
MakeFunction · 0.50

Tested by

no test coverage detected