Skip to content
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

type trait alias templates are needlessly forcing the instantiation of class templates #2768

Open
ericniebler opened this issue Nov 11, 2024 · 0 comments
Labels
bug Something isn't working right. libcu++ For all items related to libcu++

Comments

@ericniebler
Copy link
Collaborator

The cuda::std::decay_t type alias is currently defined as:

template <class _Tp>
using decay_t = typename decay<_Tp>::type;

This forces the instantiation of the cuda::std::decay class template, which is not necessary when the __decay compiler intrinsic is available.

#if defined(_CCCL_BUILTIN_DECAY)
template <class _Tp>
using decay_t = _CCCL_BUILTIN_DECAY(_Tp);
#else
template <class _Tp>
using decay_t = typename decay<_Tp>::type;

There are similar efficiency wins to be had for many of the other type trait alias templates.

@ericniebler ericniebler added bug Something isn't working right. libcu++ For all items related to libcu++ labels Nov 11, 2024
@github-project-automation github-project-automation bot moved this to Todo in CCCL Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right. libcu++ For all items related to libcu++
Projects
Status: Todo
Development

No branches or pull requests

1 participant