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

Method RegisterDevice

cpp/src/arrow/device.cc:304–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302 DeviceMapperRegistryImpl() {}
303
304 Status RegisterDevice(DeviceAllocationType device_type, DeviceMapper memory_mapper) {
305 std::lock_guard<std::mutex> lock(lock_);
306 auto [_, inserted] = registry_.try_emplace(device_type, std::move(memory_mapper));
307 if (!inserted) {
308 return Status::KeyError("Device type ", static_cast<int>(device_type),
309 " is already registered");
310 }
311 return Status::OK();
312 }
313
314 Result<DeviceMapper> GetMapper(DeviceAllocationType device_type) {
315 std::lock_guard<std::mutex> lock(lock_);

Callers 2

CreateDeviceRegistryFunction · 0.80
RegisterDeviceMapperFunction · 0.80

Calls 2

KeyErrorFunction · 0.85
OKFunction · 0.70

Tested by

no test coverage detected