From d80eef7c6d2efcbf4b60d555512c7db9da2a6e58 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Mon, 3 Feb 2025 02:20:07 +0000 Subject: [PATCH] [inductor] Guard a member variable with a define. (#146278) It's unused otherwise, and when running MPS tests, I get a bunch of warnings of this kind: /Users/davidino/pytorch/pytorch/torch/include/torch/csrc/inductor/aoti_runtime/model_container.h:412:10: warning: private field 'blob_size_' is not used [-Wunused-private-field] 412 | size_t blob_size_; | ^ 1 warning generated. Pull Request resolved: https://github.com/pytorch/pytorch/pull/146278 Approved by: https://github.com/Skylion007, https://github.com/jansel --- torch/csrc/inductor/aoti_runtime/model_container.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/torch/csrc/inductor/aoti_runtime/model_container.h b/torch/csrc/inductor/aoti_runtime/model_container.h index 58d2aa2eebf..8420f4e837f 100644 --- a/torch/csrc/inductor/aoti_runtime/model_container.h +++ b/torch/csrc/inductor/aoti_runtime/model_container.h @@ -409,7 +409,9 @@ class AOTInductorModelContainer { RAIIDataPtr constant_blob_; RAIIDataPtr constant_blob_secondary_; +#if defined(USE_CUDA) || defined(USE_XPU) size_t blob_size_; +#endif std::vector constants_internal_offset_; // Determine which constants is being used for the model.