-
Notifications
You must be signed in to change notification settings - Fork 685
[module] Change the deleter of Program in Module to make android happy #4924
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/4924
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit f92fc56 with merge base 3fb03dc ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: When building the Android demo app I got: ``` > bash build/build_android_llm_demo.sh /data/users/larryliu/android/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:4013:39: error: call to implicitly-deleted copy constructor of '(lambda at /data/users/larryliu/executorch/extension/module/module.cpp:126:9)' __cntrl_ = new _CntrlBlk(__p, __d, _AllocT()); ^~~ /data/users/larryliu/executorch/extension/module/module.cpp:124:16: note: in instantiation of function template specialization 'std::shared_ptr<executorch::runtime::Program>::shared_ptr<executorch::runtime::Program, (lambda at /data/users/larryliu/executorch/extension/module/module.cpp:126:9)>' requested here program_ = std::shared_ptr<Program>( ^ /data/users/larryliu/executorch/extension/module/module.cpp:126:10: note: copy constructor of '' is implicitly deleted because field '' has a deleted copy constructor [data_loader = std::move(data_loader_)](Program* pointer) { ^ /data/users/larryliu/android/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:2577:3: note: copy constructor is implicitly deleted because 'unique_ptr<executorch::runtime::DataLoader>' has a user-declared move constructor unique_ptr(unique_ptr&& __u) _NOEXCEPT ^ /data/users/larryliu/android/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:3575:39: note: passing argument to parameter '__d' here __shared_ptr_pointer(_Tp __p, _Dp __d, _Alloc __a) ``` To fix this I am changing the deleter of Program to be capturing `this` (Module) assuming the lifespan of `Module` is always longer than `Program`. Test Plan: Reviewers: Subscribers: Tasks: Tags:
5af44a6
to
f69f8c1
Compare
@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary:
When building the Android demo app I got:
To fix this I am changing the deleter of Program to be capturing
this
(Module) assuming the lifespan ofModule
is always longer thanProgram
.Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags: