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
There are many functions that are likely end up as function call boundaries. Tag dispatch is not a zero-cost abstraction unless inlining takes place, and I think tag dispatch should be generally only used for simple forwarding functions. It is hardly likely that those little added overhead will cause any measurable slowdown of course, but I see no reason to insist on tag dispatches either, so why not.
It seems to be not so simple to turn the current instances of tag dispatches into forwarding, but you can also replace tag dispatches by template specializations anyway. Of course you can't partially specialize function templates, but you can simply move those functions inside a dummy class templates and specialize the template parameters for those dummy class templates instead.
The text was updated successfully, but these errors were encountered:
There are two major places that use it, one is always inlined and does a if constexpr over the tag to dispatch to the others. It could probably be switched to a template param and drop the function parameter but probably doesn't cost much at runtime. Probably should be remove that func param though.
The other, the exec tag uses a small linear hierarchy of to find the best overload where a simd exec tag is a runtime exec tag is a constexpr exec tag. This is/has been used to work around optimization possibilities in constexpr code and gracefully fallback when there is no alternative. When/if C++20 becomes the minimum a bunch of this is simplified though.
There are many functions that are likely end up as function call boundaries. Tag dispatch is not a zero-cost abstraction unless inlining takes place, and I think tag dispatch should be generally only used for simple forwarding functions. It is hardly likely that those little added overhead will cause any measurable slowdown of course, but I see no reason to insist on tag dispatches either, so why not.
It seems to be not so simple to turn the current instances of tag dispatches into forwarding, but you can also replace tag dispatches by template specializations anyway. Of course you can't partially specialize function templates, but you can simply move those functions inside a dummy class templates and specialize the template parameters for those dummy class templates instead.
The text was updated successfully, but these errors were encountered: