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

Function CheckBuffersOnDevice

cpp/src/arrow/flight/test_definitions.cc:1199–1211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1197namespace {
1198
1199Status CheckBuffersOnDevice(const Array& array, const Device& device) {
1200 if (array.num_fields() != 0) {
1201 return Status::NotImplemented("Nested arrays");
1202 }
1203 for (const auto& buffer : array.data()->buffers) {
1204 if (!buffer) continue;
1205 if (!buffer->device()->Equals(device)) {
1206 return Status::Invalid("Expected buffer on device: ", device.ToString(),
1207 ". Was allocated on device: ", buffer->device()->ToString());
1208 }
1209 }
1210 return Status::OK();
1211}
1212
1213Status CheckBuffersOnDevice(const RecordBatch& batch, const Device& device) {
1214 for (const auto& column : batch.columns()) {

Callers 4

DoExchangeMethod · 0.85
TestDoGetMethod · 0.85
TestDoPutMethod · 0.85
TestDoExchangeMethod · 0.85

Calls 9

columnsMethod · 0.80
NotImplementedFunction · 0.50
InvalidFunction · 0.50
OKFunction · 0.50
num_fieldsMethod · 0.45
dataMethod · 0.45
EqualsMethod · 0.45
deviceMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected