Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoguochun1995 committed Jul 23, 2024
1 parent 275c9ee commit a248c16
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class BFCachingAllocatorImpl {
return kMinBlockSize;
}
int clz = __builtin_clzll(nbytes - 1);
return (1 << (sizeof(int64_t) - clz));
return (1LU << (sizeof(int64_t) - clz));
}

int newChunk(void* ptr, size_t size, size_t stream) {
Expand Down Expand Up @@ -601,8 +601,8 @@ class BFCachingAllocator : public CacheAllocator {
deleteBFContext, device());
DIPU_DEBUG_ALLOCATOR(
4, "BFCachingAllocator: malloc "
<< nbytes << ",requires " << origin_size << " nbytes, ptr:" << ptr
<< ",device:" << device()
<< nbytes << ",requires " << origin_size
<< " nbytes, ptr:" << ptr << ",device:" << device()
<< ",async_mempool.size:" << async_mem_pool()->size());
c10::reportMemoryUsageToProfiler(
ptr, static_cast<int64_t>(nbytes), memory_allocated(),
Expand Down

0 comments on commit a248c16

Please sign in to comment.