From 13d72999d0c742f77b7b3357364510152cd6517d Mon Sep 17 00:00:00 2001 From: zhaoguochun1995 Date: Tue, 9 Apr 2024 10:14:56 +0000 Subject: [PATCH] minor change --- .../runtime/core/allocator/DIPUAsyncResourcePool.h | 6 +----- .../runtime/core/allocator/DIPUBFCachingAllocator.cpp | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) 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: