-
Notifications
You must be signed in to change notification settings - Fork 231
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
Make memory allocation macros windows-compatible #4071
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/4071
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 5c67c77 with merge base 929fc80 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This pull request was exported from Phabricator. Differential Revision: D58850316 |
This pull request was exported from Phabricator. Differential Revision: D58850316 |
Summary: Pull Request resolved: pytorch#4071 Make windows-compatible versions of memory allocation macros `ET_TRY_ALLOCATE_OR`, `ET_TRY_ALLOCATE_INSTANCE_OR`, and `ET_TRY_ALLOCATE_LIST_OR` by using lambda functions. Previously the preprocessing did not work because the windows compiler does not support expression statements. Keep the original implementations to maintain compatibility with other call-sites, which will eventually be refactored. Then refactor the `memory_allocator_test.cpp` to migrate away from using `ET_TRY_ALLOCATE_OR`, `ET_TRY_ALLOCATE_INSTANCE_OR`, and `ET_TRY_ALLOCATE_LIST_OR`. Differential Revision: D58850316
622b6e1
to
158ac4e
Compare
This pull request was exported from Phabricator. Differential Revision: D58850316 |
Summary: Pull Request resolved: pytorch#4071 Make windows-compatible versions of memory allocation macros `ET_TRY_ALLOCATE_OR`, `ET_TRY_ALLOCATE_INSTANCE_OR`, and `ET_TRY_ALLOCATE_LIST_OR` by using lambda functions. Previously the preprocessing did not work because the windows compiler does not support expression statements. Keep the original implementations to maintain compatibility with other call-sites, which will eventually be refactored. Then refactor the `memory_allocator_test.cpp` to migrate away from using `ET_TRY_ALLOCATE_OR`, `ET_TRY_ALLOCATE_INSTANCE_OR`, and `ET_TRY_ALLOCATE_LIST_OR`. Differential Revision: D58850316
158ac4e
to
946f59d
Compare
This pull request was exported from Phabricator. Differential Revision: D58850316 |
Summary: Pull Request resolved: pytorch#4071 Make windows-compatible versions of memory allocation macros `ET_TRY_ALLOCATE_OR`, `ET_TRY_ALLOCATE_INSTANCE_OR`, and `ET_TRY_ALLOCATE_LIST_OR` by using lambda functions. Previously the preprocessing did not work because the windows compiler does not support expression statements. Keep the original implementations to maintain compatibility with other call-sites, which will eventually be refactored. Then refactor the `memory_allocator_test.cpp` to migrate away from using `ET_TRY_ALLOCATE_OR`, `ET_TRY_ALLOCATE_INSTANCE_OR`, and `ET_TRY_ALLOCATE_LIST_OR`. Differential Revision: D58850316
946f59d
to
06be9bb
Compare
This pull request was exported from Phabricator. Differential Revision: D58850316 |
Summary: Pull Request resolved: pytorch#4071 Make windows-compatible versions of memory allocation macros `ET_TRY_ALLOCATE_OR`, `ET_TRY_ALLOCATE_INSTANCE_OR`, and `ET_TRY_ALLOCATE_LIST_OR` by using lambda functions. Previously the preprocessing did not work because the windows compiler does not support expression statements. Keep the original implementations to maintain compatibility with other call-sites, which will eventually be refactored. Then refactor the `memory_allocator_test.cpp` to migrate away from using `ET_TRY_ALLOCATE_OR`, `ET_TRY_ALLOCATE_INSTANCE_OR`, and `ET_TRY_ALLOCATE_LIST_OR`. Differential Revision: D58850316
06be9bb
to
d79b9e1
Compare
This pull request was exported from Phabricator. Differential Revision: D58850316 |
Summary: Pull Request resolved: pytorch#4071 Make windows-compatible versions of memory allocation macros `ET_TRY_ALLOCATE_OR`, `ET_TRY_ALLOCATE_INSTANCE_OR`, and `ET_TRY_ALLOCATE_LIST_OR` by using lambda functions. Previously the preprocessing did not work because the windows compiler does not support expression statements. Keep the original implementations to maintain compatibility with other call-sites, which will eventually be refactored. Then refactor the `memory_allocator_test.cpp` to migrate away from using `ET_TRY_ALLOCATE_OR`, `ET_TRY_ALLOCATE_INSTANCE_OR`, and `ET_TRY_ALLOCATE_LIST_OR`. Differential Revision: D58850316
d79b9e1
to
8051028
Compare
This pull request was exported from Phabricator. Differential Revision: D58850316 |
8051028
to
5ace5d5
Compare
Summary: Pull Request resolved: pytorch#4071 Make windows-compatible versions of memory allocation macros `ET_TRY_ALLOCATE_OR`, `ET_TRY_ALLOCATE_INSTANCE_OR`, and `ET_TRY_ALLOCATE_LIST_OR` by using lambda functions. Previously the preprocessing did not work because the windows compiler does not support expression statements. Keep the original implementations to maintain compatibility with other call-sites, which will eventually be refactored. Then refactor the `memory_allocator_test.cpp` to migrate away from using `ET_TRY_ALLOCATE_OR`, `ET_TRY_ALLOCATE_INSTANCE_OR`, and `ET_TRY_ALLOCATE_LIST_OR`. Differential Revision: D58850316
This pull request was exported from Phabricator. Differential Revision: D58850316 |
Summary: Pull Request resolved: pytorch#4071 Make windows-compatible versions of memory allocation macros `ET_TRY_ALLOCATE_OR`, `ET_TRY_ALLOCATE_INSTANCE_OR`, and `ET_TRY_ALLOCATE_LIST_OR` by using lambda functions. Previously the preprocessing did not work because the windows compiler does not support expression statements. Keep the original implementations to maintain compatibility with other call-sites, which will eventually be refactored. Then refactor the `memory_allocator_test.cpp` to migrate away from using `ET_TRY_ALLOCATE_OR`, `ET_TRY_ALLOCATE_INSTANCE_OR`, and `ET_TRY_ALLOCATE_LIST_OR`. Differential Revision: D58850316
5ace5d5
to
398e940
Compare
398e940
to
e52163d
Compare
Summary: Pull Request resolved: pytorch#4071 Make windows-compatible versions of memory allocation macros `ET_TRY_ALLOCATE_OR`, `ET_TRY_ALLOCATE_INSTANCE_OR`, and `ET_TRY_ALLOCATE_LIST_OR` by using lambda functions. Previously the preprocessing did not work because the windows compiler does not support expression statements. Keep the original implementations to maintain compatibility with other call-sites, which will eventually be refactored. Then refactor the `memory_allocator_test.cpp` to migrate away from using `ET_TRY_ALLOCATE_OR`, `ET_TRY_ALLOCATE_INSTANCE_OR`, and `ET_TRY_ALLOCATE_LIST_OR`. Reviewed By: dbort Differential Revision: D58850316
This pull request was exported from Phabricator. Differential Revision: D58850316 |
Summary: Pull Request resolved: pytorch#4071 Make windows-compatible versions of memory allocation macros `ET_TRY_ALLOCATE_OR`, `ET_TRY_ALLOCATE_INSTANCE_OR`, and `ET_TRY_ALLOCATE_LIST_OR` by using lambda functions. Previously the preprocessing did not work because the windows compiler does not support expression statements. Keep the original implementations to maintain compatibility with other call-sites, which will eventually be refactored. Then refactor the `memory_allocator_test.cpp` to migrate away from using `ET_TRY_ALLOCATE_OR`, `ET_TRY_ALLOCATE_INSTANCE_OR`, and `ET_TRY_ALLOCATE_LIST_OR`. Reviewed By: dbort Differential Revision: D58850316
e52163d
to
5c67c77
Compare
This pull request was exported from Phabricator. Differential Revision: D58850316 |
This pull request has been merged in 748a4f8. |
Summary:
Make
ET_TRY_ALLOCATE_OR
,ET_TRY_ALLOCATE_INSTANCE_OR
, andET_TRY_ALLOCATE_LIST_OR
raise static assertion errors at compile time when compiled with statement expression-incompatible compilers (namely MSVC, among others).The recommended alternative is to eschew the above macros in favor of directly allocating the memory, as hinted by the assertion comments.
The
memory_allocator_test.cpp
now only tests the macros if compiled using GCC 3.0+/Clang (statement expression-compatible). This is for backwards compatibility temporarily. Eventually the goal is remove all call-sites ofET_TRY_ALLOCATE_OR
,ET_TRY_ALLOCATE_INSTANCE_OR
, andET_TRY_ALLOCATE_LIST_OR
yet.Differential Revision: D58850316