Skip to content

Commit a248c16

Browse files
minor change
1 parent 275c9ee commit a248c16

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUBFCachingAllocator.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class BFCachingAllocatorImpl {
154154
return kMinBlockSize;
155155
}
156156
int clz = __builtin_clzll(nbytes - 1);
157-
return (1 << (sizeof(int64_t) - clz));
157+
return (1LU << (sizeof(int64_t) - clz));
158158
}
159159

160160
int newChunk(void* ptr, size_t size, size_t stream) {
@@ -601,8 +601,8 @@ class BFCachingAllocator : public CacheAllocator {
601601
deleteBFContext, device());
602602
DIPU_DEBUG_ALLOCATOR(
603603
4, "BFCachingAllocator: malloc "
604-
<< nbytes << ",requires " << origin_size << " nbytes, ptr:" << ptr
605-
<< ",device:" << device()
604+
<< nbytes << ",requires " << origin_size
605+
<< " nbytes, ptr:" << ptr << ",device:" << device()
606606
<< ",async_mempool.size:" << async_mem_pool()->size());
607607
c10::reportMemoryUsageToProfiler(
608608
ptr, static_cast<int64_t>(nbytes), memory_allocated(),

0 commit comments

Comments
 (0)