Skip to content

Commit 930aa91

Browse files
authored
Pass mem_info into CPUAllocator constructor (microsoft#25212) (microsoft#25218)
### Description Added missing "mem_info" parameter into CPUAllocator constructor ### Motivation and Context Without the correct mem_info, CudaPinned allocator is mapped with wrong (default) "Cpu" memory_info.
1 parent cf7bf3a commit 930aa91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

onnxruntime/core/session/environment.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ Status Environment::CreateAndRegisterAllocator(const OrtMemoryInfo& mem_info, co
226226
l_arena_cfg};
227227
allocator_ptr = CreateAllocator(alloc_creation_info);
228228
} else {
229-
AllocatorCreationInfo alloc_creation_info{[](int) { return std::make_unique<CPUAllocator>(); },
229+
AllocatorCreationInfo alloc_creation_info{[mem_info](int) { return std::make_unique<CPUAllocator>(mem_info); },
230230
0, create_arena};
231231
allocator_ptr = CreateAllocator(alloc_creation_info);
232232
}

0 commit comments

Comments
 (0)