You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you encode information about a call to vsetvl into its return type, then it's possible to use that in function specialisations, and avoid needing to re-state it in the function name where the proper type cannot otherwise be deduced, so overloads are cleaner:
This sort of thing helps reduce the pain of template code. Plain-old C is harder to help, but if you've typedef-ed a vector type then you can repeat that once for the VL type and once more for setvl(), and should then be able to avoid a lot of the alias creation that is currently necessary for all the intrinsic functions with types in their names.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
(reposted from #309)
If you encode information about a call to
vsetvl
into its return type, then it's possible to use that in function specialisations, and avoid needing to re-state it in the function name where the proper type cannot otherwise be deduced, so overloads are cleaner:And if you tabulate all of these under a template, you can deduce things from scalar arguments:
A godbolt link: https://godbolt.org/z/dfaxbzbE8
This sort of thing helps reduce the pain of template code. Plain-old C is harder to help, but if you've
typedef
-ed a vector type then you can repeat that once for the VL type and once more forsetvl()
, and should then be able to avoid a lot of the alias creation that is currently necessary for all the intrinsic functions with types in their names.Beta Was this translation helpful? Give feedback.
All reactions