[caffe2] Remove inline keyword of function CUDACachingAllocator::format_size (#100734)

Summary: `CUDACachingAllocator::format_size` is used not only in CUDACachingAllocator.cpp but also in CUDAMallocAsyncAllocator.cpp. This caused a breakage when the compiler inlined the function and the linker couldn't find it when resolving symbols for CUDAMallocAsyncAllocator.cpp.

Differential Revision: D45612790

Pull Request resolved: https://github.com/pytorch/pytorch/pull/100734
Approved by: https://github.com/interwq, https://github.com/kit1980
This commit is contained in:
Han Zhu 2023-05-09 01:03:39 +00:00 committed by PyTorch MergeBot
parent 4447dfa673
commit 5ef50ef2d8

View File

@ -3525,7 +3525,7 @@ void setAllocatorSettings(const std::string& env) {
}
// Size pretty-printer
inline std::string format_size(uint64_t size) {
std::string format_size(uint64_t size) {
std::ostringstream os;
os.precision(2);
os << std::fixed;