diff --git a/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUAsyncResourcePool.h b/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUAsyncResourcePool.h index df97885428..fe8fca6f94 100644 --- a/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUAsyncResourcePool.h +++ b/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUAsyncResourcePool.h @@ -29,11 +29,7 @@ class AsyncResourcePoolImpl : public AsyncResourcePool { public: void add(const T& t, std::deque& events) override { std::lock_guard lk(mutex_); - if (events.size() > 0) { - list_.emplace_back(t, std::move(events)); - } else { - list_.emplace_front(t, std::move(events)); - } + list_.emplace_back(t, std::move(events)); } T get() override { diff --git a/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUBFCachingAllocator.cpp b/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUBFCachingAllocator.cpp index efe6a06ac0..500849d2a0 100644 --- a/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUBFCachingAllocator.cpp +++ b/dipu/torch_dipu/csrc_dipu/runtime/core/allocator/DIPUBFCachingAllocator.cpp @@ -15,8 +15,8 @@ namespace dipu { // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) -const size_t kMaxExtendSize = - get_env_or_default("DIPU_MAX_EXTEND_SIZE", 1024 << 20U); +const size_t kMaxExtendSize = get_env_or_default("DIPU_MAX_EXTEND_SIZE", 1024) + << 20U; class BFCachingAllocatorImpl { public: