Skip to content

Conversation

@jgibson2
Copy link
Contributor

Summary

Fixes some missing includes int the CoreML delegate that are necessary for C++23 projects.

Copilot AI review requested due to automatic review settings December 11, 2025 20:18
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 11, 2025
@pytorch-bot
Copy link

pytorch-bot bot commented Dec 11, 2025

🔗 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 Failure

As of commit ea7315a with merge base 12d17ef (image):

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.

@jgibson2
Copy link
Contributor Author

@pytorchbot label "release notes: none"

@pytorch-bot pytorch-bot bot added the release notes: none Do not include this in the release notes label Dec 11, 2025
Copy link
Contributor

Copilot AI left a 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>
Copy link

Copilot AI Dec 11, 2025

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.

Suggested change
#import <algorithm>
#include <algorithm>

Copilot uses AI. Check for mistakes.
#import "objc_safe_cast.h"

#import <fcntl.h>
#import <memory>
Copy link

Copilot AI Dec 11, 2025

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.

Suggested change
#import <memory>
#include <memory>

Copilot uses AI. Check for mistakes.
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

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?

Copilot AI review requested due to automatic review settings December 11, 2025 20:20
Copy link
Contributor

Copilot AI left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants