Skip to content

Commit 27de9bc

Browse files
committed
[executorch] Suppress wdeprecated warnings on tensor_layout.h and named_data_map.h
Context: ET_EXPERIMENTAL is tagged with [[deprecated]]. This causes errors when ET_EXPERIMENTAL features are used in core ET and code is built with -Werror. See errors on D67127327. This diff applies Option1 to 'tensor_layout.h' and Option2 to 'named_data_map.h' Option 1: - gate with `#pragma GCC diagnostic ignored "-Wdeprecated-declarations"`, for users of tensor_layout.h and program.h Option 2: - use ET_DISABLE_EXPERIMENTAL_ANNOTATION=1, for users of tensor_layout.h and program.h ---- Users - tensor_layout.h: named_data_map.h - named_data_map.h: method.h, program.h Generally, I think we can apply either option1/option2 to `tensor_layout.h`. For `named_data_map.h`, I think we should apply option2, to make ET_EXPERIMENTAL a no-op, or remove the ET_EXPERIMENTAL annotation to the implementation class. Option 1 would disable deprecation warnings for the entire file. Differential Revision: [D69145438](https://our.internmc.facebook.com/intern/diff/D69145438/) [ghstack-poisoned]
1 parent ed41d21 commit 27de9bc

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

runtime/core/named_data_map.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
*/
88

99
#pragma once
10+
// Disable -Wdeprecated-declarations, as some builds use 'Werror'.
11+
#pragma GCC diagnostic push
12+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
1013

1114
#include <executorch/runtime/core/exec_aten/exec_aten.h>
1215
#include <executorch/runtime/core/freeable_buffer.h>
@@ -75,3 +78,5 @@ class ET_EXPERIMENTAL NamedDataMap {
7578

7679
} // namespace runtime
7780
} // namespace executorch
81+
82+
#pragma GCC diagnostic pop

runtime/executor/method.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
*/
88

99
#pragma once
10+
// Disable -Wdeprecated-declarations, as some builds use 'Werror'.
11+
#pragma GCC diagnostic push
12+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
1013

1114
#include <executorch/runtime/core/evalue.h>
1215
#include <executorch/runtime/core/event_tracer.h>
@@ -364,3 +367,5 @@ namespace executor {
364367
using ::executorch::runtime::Method;
365368
} // namespace executor
366369
} // namespace torch
370+
371+
#pragma GCC diagnostic pop

runtime/executor/program.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
*/
88

99
#pragma once
10+
// Disable -Wdeprecated-declarations, as some builds use 'Werror'.
11+
#pragma GCC diagnostic push
12+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
1013

1114
#include <cinttypes>
1215
#include <cstdint>
@@ -302,3 +305,5 @@ namespace executor {
302305
using ::executorch::runtime::Program;
303306
} // namespace executor
304307
} // namespace torch
308+
309+
#pragma GCC diagnostic pop

0 commit comments

Comments
 (0)