Commit 2d2872c
committed
[ET][Windows] Fix ExecuTorch Windows host build portability defects
Pull Request resolved: #20948
Building ExecuTorch (Vulkan backend plus core runtime) for a Windows x86_64 host with the arvr clang toolchain surfaced three genuine portability defects that fail under its strict `-Werror` set and generated-header wiring. These are correct fixes independent of any warning-suppression workaround.
In `runtime/core/portable_type/c10/c10/targets.bzl`, the arvr-mode `select` that supplies the generated `ATen/Config.h` routed every non-Android OS to `ovrsource_aten_Config.h`, an OVR-native-only `oxx_static_library` that produces no output on the Windows host. The result was `fatal error: 'ATen/Config.h' file not found` in every CPU kernel that includes ATen vec headers. This adds an `ovr_config//os:windows` branch pointing at the working `generated_aten_config_header`, mirroring the existing Android fallback.
In `backends/vulkan/runtime/api/containers/Tensor.h`, `size()` and `dim()` returned `const int64_t` by value; the meaningless top-level `const` on a scalar return trips `-Werror,-Wignored-qualifiers`. This header is included throughout the Vulkan backend, so it blocked `vulkan_graph_runtime`. The `const` qualifier is dropped.
In `extension/data_loader/mman.h` and `mman_windows.cpp`, `#define NOMINMAX` was unconditional while the toolchain already predefines it, tripping `-Werror,-Wmacro-redefined` when compiling `mmap_data_loader` (pulled in by `Module`). Both sites are now guarded with `#ifndef NOMINMAX`.
ghstack-source-id: 402995448
@exported-using-ghexport
Differential Revision: [D112012051](https://our.internmc.facebook.com/intern/diff/D112012051/)1 parent e16c048 commit 2d2872c
4 files changed
Lines changed: 13 additions & 4 deletions
File tree
- backends/vulkan/runtime/api/containers
- extension/data_loader
- runtime/core/portable_type/c10/c10
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
549 | 549 | | |
550 | 550 | | |
551 | 551 | | |
552 | | - | |
| 552 | + | |
553 | 553 | | |
554 | 554 | | |
555 | 555 | | |
556 | | - | |
| 556 | + | |
557 | 557 | | |
558 | 558 | | |
559 | 559 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
| 84 | + | |
| 85 | + | |
86 | 86 | | |
| 87 | + | |
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| |||
0 commit comments