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

Method ToDeviceData

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

Source from the content-addressed store, hash-verified

4961 }
4962
4963 static Result<std::shared_ptr<ArrayData>> ToDeviceData(
4964 const std::shared_ptr<MemoryManager>& mm, const ArrayData& data) {
4965 arrow::BufferVector buffers;
4966 for (const auto& buf : data.buffers) {
4967 if (buf) {
4968 ARROW_ASSIGN_OR_RAISE(auto dest, mm->CopyBuffer(buf, mm));
4969 buffers.push_back(dest);
4970 } else {
4971 buffers.push_back(nullptr);
4972 }
4973 }
4974
4975 arrow::ArrayDataVector children;
4976 for (const auto& child : data.child_data) {
4977 ARROW_ASSIGN_OR_RAISE(auto dest, ToDeviceData(mm, *child));
4978 children.push_back(dest);
4979 }
4980
4981 return ArrayData::Make(data.type, data.length, buffers, children, data.null_count,
4982 data.offset);
4983 }
4984
4985 static Result<std::shared_ptr<Array>> ToDevice(const std::shared_ptr<MemoryManager>& mm,
4986 const ArrayData& data) {

Callers

nothing calls this directly

Calls 2

push_backMethod · 0.80
MakeFunction · 0.50

Tested by

no test coverage detected