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..13c902147a 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: @@ -436,8 +436,8 @@ class BFCachingAllocator : public CacheAllocator { while (!async_mem_pool()->empty()) { if (!async_mem_pool()->ready()) { auto now = std::chrono::steady_clock::now(); - auto elasped = now - start; - if (elasped < maxWaitTime) { + auto elapsed = now - start; + if (elapsed < maxWaitTime) { std::this_thread::yield(); continue; }