-
Notifications
You must be signed in to change notification settings - Fork 684
Make kernels/portable/cpu compatible with C++11/14/17/20 #128
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
This pull request was exported from Phabricator. Differential Revision: D48668113 |
5 similar comments
This pull request was exported from Phabricator. Differential Revision: D48668113 |
This pull request was exported from Phabricator. Differential Revision: D48668113 |
This pull request was exported from Phabricator. Differential Revision: D48668113 |
This pull request was exported from Phabricator. Differential Revision: D48668113 |
This pull request was exported from Phabricator. Differential Revision: D48668113 |
Summary: Tweak the core runtime code to build cleanly with C++11 as well as with more recent versions. This only covers non-test targets under //executorch/runtime, enough to build `:size_test`. While doing this I removed a bunch of `constexpr` from methods on `ArrayRef` and `string_view`, because C++11 was more strict about what's allowed in them. While they're useful on general-purpose implementations of those types, we never do static comparison of array or string instances, so it doesn't help us. Not worth the complexity of adding `#ifdef`s to change the behavior depending on the C++ version. A lot of the template changes deal with the lack of `<base>_t` templates in C++11. Most of them are of the form ``` template<class T> using BASE_t = typename BASE<T>::type; ``` so the fix was to inline that pattern: add `typename` to the front and `::type` to the end. Differential Revision: https://internalfb.com/D48665438 fbshipit-source-id: c39180091153e1283ffd0dda729812e2080dcd48
Summary: Pull Request resolved: #128 Tweak the portable kernels to build cleanly with C++11 as well as with more recent versions. This only covers non-test, non-aten targets under `//executorch/kernels/portable/cpu/...`. A lot of the template changes deal with the lack of <base>_t templates in C++11. Most of them are of the form ``` template<class T> using BASE_t = typename BASE<T>::type; ``` so the fix was to inline that pattern: add `typename` to the front and `::type` to the end. Reviewed By: digantdesai, kirklandsign Differential Revision: D48668113 fbshipit-source-id: 056fe6706e55c3d52cc1cc67abf593f72c05a9b6
This pull request was exported from Phabricator. Differential Revision: D48668113 |
This pull request has been merged in 70a7973. |
* code beautification * debug info * debug * add missing args * typo * fix dtype check
Summary:
Tweak the portable kernels to build cleanly with C++11 as well as with more recent versions. This only covers non-test, non-aten targets under
//executorch/kernels/portable/cpu/...
.A lot of the template changes deal with the lack of _t templates in C++11. Most of them are of the form
so the fix was to inline that pattern: add
typename
to the front and::type
to the end.Differential Revision: D48668113