Skip to content

Simplify runtime FunctionRef #555

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

Closed
wants to merge 2 commits into from

Conversation

digantdesai
Copy link
Contributor

Summary: FunctionRef simplified - removing lambdas in constructor initializer list, to ensure runtime portability for embedded systems w/ C++11.

Differential Revision: D49798748

@netlify
Copy link

netlify bot commented Sep 30, 2023

Deploy Preview for resplendent-gnome-14e531 canceled.

Name Link
🔨 Latest commit ebfcf0f
🔍 Latest deploy log https://app.netlify.com/sites/resplendent-gnome-14e531/deploys/651b6aca6567600008210a83

@facebook-github-bot facebook-github-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 Sep 30, 2023
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49798748

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49798748

digantdesai and others added 2 commits October 2, 2023 18:12
Summary:
Now there are two FunctionRef classes,
(A) torch::executor::pytree::FunctionRef in executorch/extension/pytree/function_ref.h
(B) torch::executor::FunctionRef in executor/runtime/core/function_ref.h

Rationale:
- version (B) compared to (A) will have features going fwd, and we are planning to eventually delete it completely

Differential Revision: https://internalfb.com/D49780124

fbshipit-source-id: 143a984140d4a95980e63e11bd16561f9ae9d46f
Summary:
Pull Request resolved: pytorch/executorch#555

FunctionRef simplified - removing lambdas in constructor initializer list, to ensure runtime portability for embedded systems w/ C++11.

Reviewed By: dbort

Differential Revision: D49798748

fbshipit-source-id: 03f1669adaf0150de06b8c89229ba63be674ab91
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49798748

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 7642538.

tarun292 pushed a commit that referenced this pull request Oct 5, 2023
Summary:
Pull Request resolved: #555

FunctionRef simplified - removing lambdas in constructor initializer list, to ensure runtime portability for embedded systems w/ C++11.

Reviewed By: dbort

Differential Revision: D49798748

fbshipit-source-id: 4c9e46603ebbddeb71fc78f43de6b3e149285738
swolchok added a commit that referenced this pull request Apr 25, 2025
…ore (#10441)

I just re-synced it with LLVM, and it seems harmless. We previously
simplified FunctionRef because of an ARM baremetal toolchain issue
around placement of a lambda (#555), but the current implementation has
no lambda.

Motivation: I want to be able to use it in the next PR in
thread_parallel_interface.h (the "threadpool active" mode) and
threadpool in order to save a ton of size that std::function is
currently wasting by virtue of supporting ownership and copying.
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. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants