@@ -272,11 +272,11 @@ std::shared_ptr<MemoryManager> CPUDevice::default_memory_manager() {
272272
273273namespace {
274274
275- class DeviceMemoryManagerRegistryImpl {
275+ class DeviceMapperRegistryImpl {
276276 public:
277- DeviceMemoryManagerRegistryImpl () {}
277+ DeviceMapperRegistryImpl () {}
278278
279- Status RegisterDevice (DeviceAllocationType device_type, MemoryMapper memory_mapper) {
279+ Status RegisterDevice (DeviceAllocationType device_type, DeviceMapper memory_mapper) {
280280 std::lock_guard<std::mutex> lock (lock_);
281281 auto [_, inserted] = registry_.try_emplace (device_type, std::move (memory_mapper));
282282 if (!inserted) {
@@ -286,7 +286,7 @@ class DeviceMemoryManagerRegistryImpl {
286286 return Status::OK ();
287287 }
288288
289- Result<MemoryMapper> GetMemoryManager (DeviceAllocationType device_type) {
289+ Result<DeviceMapper> GetMapper (DeviceAllocationType device_type) {
290290 std::lock_guard<std::mutex> lock (lock_);
291291 auto it = registry_.find (device_type);
292292 if (it == registry_.end ()) {
@@ -298,38 +298,38 @@ class DeviceMemoryManagerRegistryImpl {
298298
299299 private:
300300 std::mutex lock_;
301- std::unordered_map<DeviceAllocationType, MemoryMapper > registry_;
301+ std::unordered_map<DeviceAllocationType, DeviceMapper > registry_;
302302};
303303
304- Result<std::shared_ptr<MemoryManager>> DefaultCPUMemoryMapper (int64_t device_id) {
304+ Result<std::shared_ptr<MemoryManager>> DefaultCPUDeviceMapper (int64_t device_id) {
305305 return default_cpu_memory_manager ();
306306}
307307
308- static std::unique_ptr<DeviceMemoryManagerRegistryImpl > CreateDeviceRegistry () {
309- auto registry = std::make_unique<DeviceMemoryManagerRegistryImpl >();
308+ static std::unique_ptr<DeviceMapperRegistryImpl > CreateDeviceRegistry () {
309+ auto registry = std::make_unique<DeviceMapperRegistryImpl >();
310310
311311 // Always register the CPU device
312- DCHECK_OK (registry->RegisterDevice (DeviceAllocationType::kCPU , DefaultCPUMemoryMapper ));
312+ DCHECK_OK (registry->RegisterDevice (DeviceAllocationType::kCPU , DefaultCPUDeviceMapper ));
313313
314314 return registry;
315315}
316316
317- DeviceMemoryManagerRegistryImpl * GetDeviceRegistry () {
317+ DeviceMapperRegistryImpl * GetDeviceRegistry () {
318318 static auto g_registry = CreateDeviceRegistry ();
319319 return g_registry.get ();
320320}
321321
322322} // namespace
323323
324- Status RegisterDeviceMemoryManager (DeviceAllocationType device_type,
325- MemoryMapper memory_mapper ) {
324+ Status RegisterDeviceMapper (DeviceAllocationType device_type,
325+ DeviceMapper mapper ) {
326326 auto registry = GetDeviceRegistry ();
327- return registry->RegisterDevice (device_type, std::move (memory_mapper ));
327+ return registry->RegisterDevice (device_type, std::move (mapper ));
328328}
329329
330- Result<MemoryMapper> GetDeviceMemoryManager (DeviceAllocationType device_type) {
330+ Result<DeviceMapper> GetDeviceMapper (DeviceAllocationType device_type) {
331331 auto registry = GetDeviceRegistry ();
332- return registry->GetMemoryManager (device_type);
332+ return registry->GetMapper (device_type);
333333}
334334
335335} // namespace arrow
0 commit comments