Fix shadow local variables (#152429)

Summary: Fixing shadow local variables error: P1798875650

Test Plan: CI

Differential Revision: D73853605

Pull Request resolved: https://github.com/pytorch/pytorch/pull/152429
Approved by: https://github.com/Skylion007, https://github.com/eqy
This commit is contained in:
Dan Johnson
2025-04-29 18:50:18 +00:00
committed by PyTorch MergeBot
parent a3123dd3ab
commit 8e2e06b7ea

View File

@ -1268,11 +1268,10 @@ class DeviceCachingAllocator {
for (MempoolId_t mempool_id : use_on_oom_pools) {
auto filter = [](cudaStream_t) { return true; };
beginAllocateToPool(mempool_id, filter);
auto& pool = get_pool(size, stream);
const size_t alloc_size = get_allocation_size(size);
auto& mempool = get_pool(size, stream);
AllocParams mempool_params(
device, size, stream, &pool, alloc_size, stats);
mempool_params.stat_types = get_stat_types_for_pool(pool);
device, size, stream, &mempool, alloc_size, stats);
mempool_params.stat_types = get_stat_types_for_pool(mempool);
block_found = get_free_block(mempool_params);
endAllocateToPool(mempool_id);
releasePool(mempool_id);