| 1197 | namespace { |
| 1198 | |
| 1199 | Status 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 | |
| 1213 | Status CheckBuffersOnDevice(const RecordBatch& batch, const Device& device) { |
| 1214 | for (const auto& column : batch.columns()) { |
no test coverage detected