-
Notifications
You must be signed in to change notification settings - Fork 608
[ET-VK][BE][ez] vTensor cleanup 3/N - Introduce conversion operators for vec
types
#5423
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
…for `vec` types ## Context Introduce implicit conversion functions to `vec` types. This allows the following pattern: ```cpp utils::ivec3 v1{4, 5, 2}; utils::uvec3 v2 = v1; ``` Whereas before, we would have to do ```cpp utils::ivec3 v1{4, 5, 2}; utils::uvec3 v2( safe_downcast<uint32_t>(v1[0], safe_downcast<uint32_t>(v1[1], safe_downcast<uint32_t>(v1[2]); ``` The connection with `vTensor` class cleanup is that this will allow for consolidation of `vTensor` class methods, specifically circumventing the need to provide two functions to retrieve the logical limits of the `Tensor`, one to retrieve it as a `ivec3` and another to retrieve it as a `uvec3`. Differential Revision: [D62878650](https://our.internmc.facebook.com/intern/diff/D62878650/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/5423
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 5c5f01a with merge base d2a38cc ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This pull request was exported from Phabricator. Differential Revision: D62878650 |
…for `vec` types ## Context Introduce implicit conversion functions to `vec` types. This allows the following pattern: ```cpp utils::ivec3 v1{4, 5, 2}; utils::uvec3 v2 = v1; ``` Whereas before, we would have to do ```cpp utils::ivec3 v1{4, 5, 2}; utils::uvec3 v2( safe_downcast<uint32_t>(v1[0], safe_downcast<uint32_t>(v1[1], safe_downcast<uint32_t>(v1[2]); ``` The connection with `vTensor` class cleanup is that this will allow for consolidation of `vTensor` class methods, specifically circumventing the need to provide two functions to retrieve the logical limits of the `Tensor`, one to retrieve it as a `ivec3` and another to retrieve it as a `uvec3`. Differential Revision: [D62878650](https://our.internmc.facebook.com/intern/diff/D62878650/) ghstack-source-id: 243061030 Pull Request resolved: #5423
… operators for `vec` types" ## Context Introduce implicit conversion functions to `vec` types. This allows the following pattern: ```cpp utils::ivec3 v1{4, 5, 2}; utils::uvec3 v2 = v1; ``` Whereas before, we would have to do ```cpp utils::ivec3 v1{4, 5, 2}; utils::uvec3 v2( safe_downcast<uint32_t>(v1[0], safe_downcast<uint32_t>(v1[1], safe_downcast<uint32_t>(v1[2]); ``` The connection with `vTensor` class cleanup is that this will allow for consolidation of `vTensor` class methods, specifically circumventing the need to provide two functions to retrieve the logical limits of the `Tensor`, one to retrieve it as a `ivec3` and another to retrieve it as a `uvec3`. Differential Revision: [D62878650](https://our.internmc.facebook.com/intern/diff/D62878650/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D62878650 |
… operators for `vec` types" ## Context Introduce implicit conversion functions to `vec` types. This allows the following pattern: ```cpp utils::ivec3 v1{4, 5, 2}; utils::uvec3 v2 = v1; ``` Whereas before, we would have to do ```cpp utils::ivec3 v1{4, 5, 2}; utils::uvec3 v2( safe_downcast<uint32_t>(v1[0], safe_downcast<uint32_t>(v1[1], safe_downcast<uint32_t>(v1[2]); ``` The connection with `vTensor` class cleanup is that this will allow for consolidation of `vTensor` class methods, specifically circumventing the need to provide two functions to retrieve the logical limits of the `Tensor`, one to retrieve it as a `ivec3` and another to retrieve it as a `uvec3`. Differential Revision: [D62878650](https://our.internmc.facebook.com/intern/diff/D62878650/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D62878650 |
… operators for `vec` types" ## Context Introduce implicit conversion functions to `vec` types. This allows the following pattern: ```cpp utils::ivec3 v1{4, 5, 2}; utils::uvec3 v2 = v1; ``` Whereas before, we would have to do ```cpp utils::ivec3 v1{4, 5, 2}; utils::uvec3 v2( safe_downcast<uint32_t>(v1[0], safe_downcast<uint32_t>(v1[1], safe_downcast<uint32_t>(v1[2]); ``` The connection with `vTensor` class cleanup is that this will allow for consolidation of `vTensor` class methods, specifically circumventing the need to provide two functions to retrieve the logical limits of the `Tensor`, one to retrieve it as a `ivec3` and another to retrieve it as a `uvec3`. Differential Revision: [D62878650](https://our.internmc.facebook.com/intern/diff/D62878650/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D62878650 |
This pull request has been merged in 958afe1. |
Stack from ghstack (oldest at bottom):
vec
types #5423Context
Introduce implicit conversion functions to
vec
types. This allows the following pattern:Whereas before, we would have to do
The connection with
vTensor
class cleanup is that this will allow for consolidation ofvTensor
class methods, specifically circumventing the need to provide two functions to retrieve the logical limits of theTensor
, one to retrieve it as aivec3
and another to retrieve it as auvec3
.Differential Revision: D62878650