-
Notifications
You must be signed in to change notification settings - Fork 758
Fix missing includes for C++23 #16208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/16208
Note: Links to docs will display an error until the docs builds have been completed. ❌ 3 New Failures, 1 Unrelated FailureAs of commit ea7315a with merge base 12d17ef ( NEW FAILURES - The following jobs have failed:
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot label "release notes: none" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds missing C++ standard library includes that are required for C++23 compatibility in the CoreML delegate. In C++23, certain standard library headers no longer transitively include other headers that were previously included automatically, requiring explicit includes.
- Adds
#include <memory>for smart pointer support - Adds
#include <atomic>for atomic operations - Adds
#include <algorithm>for standard algorithms
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| backends/apple/coreml/runtime/kvstore/statement.hpp | Adds explicit <memory> include for smart pointer types |
| backends/apple/coreml/runtime/kvstore/key_value_store.hpp | Adds explicit <atomic> include for atomic types |
| backends/apple/coreml/runtime/delegate/multiarray.mm | Adds explicit <algorithm> include for standard algorithms |
| backends/apple/coreml/runtime/delegate/ETCoreMLAsset.mm | Adds explicit <memory> include for smart pointer types |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #import "objc_array_util.h" | ||
|
|
||
| #import <Accelerate/Accelerate.h> | ||
| #import <algorithm> |
Copilot
AI
Dec 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C++ standard library headers should use #include instead of #import. While this may work in practice, #import is an Objective-C directive and #include is the correct directive for C++ standard headers. Change to #include <algorithm> for correctness.
| #import <algorithm> | |
| #include <algorithm> |
| #import "objc_safe_cast.h" | ||
|
|
||
| #import <fcntl.h> | ||
| #import <memory> |
Copilot
AI
Dec 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C++ standard library headers should use #include instead of #import. The #import directive is specific to Objective-C, while #include is the standard C++ directive. Change to #include <memory> for correctness.
| #import <memory> | |
| #include <memory> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like a reasonable review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I change all of these? A lot of the others are C++ libs that are #imported as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shoumikhin @metascroy what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any updates on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding @metascroy for reviewing
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Fixes some missing includes int the CoreML delegate that are necessary for C++23 projects.