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

CUDA 12.1, 12.2, 12.3, 12.4 constexpr issues, FIXED in CUDA 12.5 #1766

Open
havogt opened this issue Aug 9, 2023 · 3 comments
Open

CUDA 12.1, 12.2, 12.3, 12.4 constexpr issues, FIXED in CUDA 12.5 #1766

havogt opened this issue Aug 9, 2023 · 3 comments

Comments

@havogt
Copy link
Contributor

havogt commented Aug 9, 2023

CUDA 12.1 and CUDA 12.2 seem to have (once again) problems with constexpr construction.

E.g. the following was fine in 12.0, but fails to compile now:

template <class T>
struct foo {
    T m;
    constexpr foo(T const &a) : m(a) {}
};
int main() {
    auto f = foo([]{});
}

where foo can be std::tuple.

@havogt havogt pinned this issue Aug 9, 2023
havogt added a commit that referenced this issue Aug 16, 2023
CUDA 12.1 and 12.2 have a problem with constexpr, e.g. in the context of CTAD, see #1766. The workaround is to do pre-C++17 `make_tuple`-construction or construct from a (possibly moved-from) lvalue.

CI: add GCC + CUDA 12.1/12.2 and NVHPC 23.7

Co-authored-by: Péter Kardos <[email protected]>
havogt added a commit that referenced this issue Aug 16, 2023
CUDA 12.1 and 12.2 have a problem with constexpr, e.g. in the context of CTAD, see #1766. The workaround is to do pre-C++17 `make_tuple`-construction or construct from a (possibly moved-from) lvalue.

CI: add GCC + CUDA 12.1/12.2 and NVHPC 23.7

Co-authored-by: Péter Kardos <[email protected]>
@havogt
Copy link
Contributor Author

havogt commented Jan 26, 2024

12.3 affected as well #1768

@havogt havogt changed the title CUDA 12.1, 12.2 constexpr issues CUDA 12.1, 12.2, 12.3 constexpr issues Jan 26, 2024
@havogt
Copy link
Contributor Author

havogt commented Mar 12, 2024

12.4 fixed the above example, but this small variation still fails

template <class T>
struct foo {
    T m;
    constexpr foo(T const &a) : m(a) {}
};

template <class T>
struct bar {
    T m;
    constexpr bar(T const &a) : m(a) {}
};

int main() {
    auto f = foo(bar([] {}));
}

@havogt havogt changed the title CUDA 12.1, 12.2, 12.3 constexpr issues CUDA 12.1, 12.2, 12.3, 12.4 constexpr issues Mar 12, 2024
@havogt
Copy link
Contributor Author

havogt commented May 30, 2024

The issues are fixed in CUDA 12.5.

Leaving this open for reference.

@havogt havogt changed the title CUDA 12.1, 12.2, 12.3, 12.4 constexpr issues CUDA 12.1, 12.2, 12.3, 12.4 constexpr issues, FIXED in CUDA 12.5 May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant