There is a newer registration mechanism with backend dispatching, described here 6. Though I’m not sure if this is the current suggested approach; if you’re not creating a library with more than 2 backend implementations, cuda/cpu branch dispatch seems good enough to me.