From 3aa512cd72dc521ae09f5b96b8545366ca779593 Mon Sep 17 00:00:00 2001 From: cyy Date: Thu, 7 Mar 2024 15:11:07 +0000 Subject: [PATCH] [Clang-tidy header][23/N] Enable clang-tidy coverage on aten/src/ATen/*.{cpp,h} (#121380) This PR finishes the works beginning with #https://github.com/pytorch/pytorch/pull/120763 by enabling clang-tidy on aten/src/ATen. Pull Request resolved: https://github.com/pytorch/pytorch/pull/121380 Approved by: https://github.com/Skylion007 --- .lintrunner.toml | 5 ++++- aten/src/ATen/MapAllocator.cpp | 2 +- aten/src/ATen/MapAllocator.h | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.lintrunner.toml b/.lintrunner.toml index 1420ac48b8ab..9736530f02bb 100644 --- a/.lintrunner.toml +++ b/.lintrunner.toml @@ -187,9 +187,12 @@ command = [ code = 'CLANGTIDY' include_patterns = [ 'aten/src/ATen/core/*.cpp', + # Enable coverage of headers in aten/src/ATen + # and excluding most sub-directories for now. + 'aten/src/ATen/*.h', + 'aten/src/ATen/*.cpp', 'c10/**/*.cpp', 'c10/**/*.h', - # Enable coverage of headers in torch/csrc and excluding sub-directories for now. 'torch/csrc/*.h', 'torch/csrc/*.cpp', 'torch/csrc/**/*.h', diff --git a/aten/src/ATen/MapAllocator.cpp b/aten/src/ATen/MapAllocator.cpp index 7b1ebd067f75..19c08634d2cf 100644 --- a/aten/src/ATen/MapAllocator.cpp +++ b/aten/src/ATen/MapAllocator.cpp @@ -607,7 +607,7 @@ void* RefcountedMapAllocator::data() const { } MapAllocator::~MapAllocator() { - close(); + MapAllocator::close(); c10::reportMemoryUsageToProfiler(base_ptr_, -size_, 0, 0, c10::Device(c10::DeviceType::CPU)); } diff --git a/aten/src/ATen/MapAllocator.h b/aten/src/ATen/MapAllocator.h index 3354ab84577f..f4a30edef623 100644 --- a/aten/src/ATen/MapAllocator.h +++ b/aten/src/ATen/MapAllocator.h @@ -128,7 +128,7 @@ class TORCH_API RefcountedMapAllocator : private RefcountedMapAllocatorArgCheck, void close() override; ~RefcountedMapAllocator() override { - close(); + RefcountedMapAllocator::close(); } protected: