<div dir="auto"><div dir="auto" style="">One diff currently up uses inline free functions to implement target specific stuff. That's not obviously a good idea so my reasoning is below. Please let me know what you think.</div><div dir="auto" style=""><br></div><div dir="auto" style="">No overhead means implementations need to be in headers or the nvptx cmake needs to apply cross translation unit optimisation. I'm wary of doing the latter without access to heavy test coverage.<br></div><div dir="auto" style=""><br></div><div dir="auto" style="">In general, I like static member functions with CRTP for interfaces. No overhead, can wire in compile time constraints. Quite a lot of boilerplate. Probably appropriate for things like shuffle. Doesn't handle partial implementations especially well, e.g. if only part of it is used by a particular target.</div><div dir="auto" style=""><br></div><div dir="auto" style="">For compatibility shims around popcount or atomicMax we probably want overloaded free functions or templates though.</div><div dir="auto" style=""><br></div><div dir="auto" style="">So I don't yet know what the right interface will be. It should be safe, obvious how to implement, flexible enough to adapt to new targets. Allow shared implementations. Classically difficult problem. </div><div dir="auto" style=""><br></div><div dir="auto" style="">As an interim, I'd like to use free functions. They're not very safe. The interface is implicit. I wrote the amdgcn version of target_impl by copy then changing the bodies. Bad times. But they'll be very easy to move behind whatever set of interfaces look like the right choice when the fog clears. Definitely not my preferred final design.</div><div dir="auto" style=""><br></div><div dir="auto" style="">Cheers!</div><div dir="auto" style=""><br></div><div dir="auto" style="">Jon</div><div dir="auto" style="font-family:sans-serif;font-size:12.8px"><br></div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div>