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

Function ExportDeviceImpl

cpp/src/arrow/c/dlpack.cc:176–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174
175template <typename T>
176Result<DLDevice> ExportDeviceImpl(const std::shared_ptr<T>& a) {
177 // ArrayData reports the device of its buffers and children
178 if (a->data()->device_type() == DeviceAllocationType::kCPU) {
179 return {{.device_type = DLDeviceType::kDLCPU, .device_id = 0}};
180 } else {
181 return Status::NotImplemented(
182 "DLPack support is implemented only for buffers on CPU device.");
183 }
184}
185
186} // namespace
187

Callers 1

ExportDeviceFunction · 0.85

Calls 3

NotImplementedFunction · 0.50
device_typeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected