Fix XNNPACK build errors with -Werror toolchains#18386
Fix XNNPACK build errors with -Werror toolchains#18386amov-meta wants to merge 1 commit intopytorch:mainfrom
Conversation
Summary: Fix two build errors that occur when compiling the XNNPACK backend with strict `-Werror` toolchains (e.g. the ARVR toolchain on macOS ARM64). **1. Undefined `XNN_ARCH_HEXAGON` macro in `xnnpack.h`** The public header uses `#if XNN_ARCH_HEXAGON` without first including `common.h`, which normally defines it. On non-Hexagon platforms the macro is undefined — this silently evaluates to 0 by default, but triggers an error with `-Wundef -Werror`. Added a `#ifndef` guard to default the macro to 0 when not already defined. **2. Missing `override` on `XnnpackBackend` destructor** The destructor overrides a virtual base class destructor but was not marked `override`, triggering `-Winconsistent-missing-destructor-override`. Differential Revision: D97373597
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18386
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 76 PendingAs of commit 2fe12ca with merge base 07b7c7e ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@amov-meta has exported this pull request. If you are a Meta employee, you can view the originating Diff in D97373597. |
This PR needs a
|
|
see updated pr here |
Summary:
Fix two build errors that occur when compiling the XNNPACK backend with
strict
-Werrortoolchains (e.g. the ARVR toolchain on macOS ARM64).1. Undefined
XNN_ARCH_HEXAGONmacro inxnnpack.hThe public header uses
#if XNN_ARCH_HEXAGONwithout first includingcommon.h, which normally defines it. On non-Hexagon platforms themacro is undefined — this silently evaluates to 0 by default, but
triggers an error with
-Wundef -Werror.Added a
#ifndefguard to default the macro to 0 when not alreadydefined.
2. Missing
overrideonXnnpackBackenddestructorThe destructor overrides a virtual base class destructor but was not
marked
override, triggering-Winconsistent-missing-destructor-override.Differential Revision: D97373597