Skip to content

Conversation

dbort
Copy link
Contributor

@dbort dbort commented Aug 25, 2023

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 #ifdefs 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.

Reviewed By: larryliu0820

Differential Revision: D48665438

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

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

@facebook-github-bot
Copy link
Contributor

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

7 similar comments
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

Summary:
Pull Request resolved: #127

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.

Reviewed By: larryliu0820

Differential Revision: D48665438

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

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 3662478.

Gasoonjia pushed a commit that referenced this pull request Jul 30, 2024
* add torchat.py and --tiktoken option

* add default device to torchat

* dtype handling for export_et

* handle dtype args
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