llnl / llnl/smith

nvcc issues with mfem::future::tuple

Open
#1,659 0 comments 0 reactions 1 assignee View on GitHub

@chapman39 is already working on this.

Since Sep 16, 2026.

cuda
Dominant language
C++
Stars
245
Forks
36
Avg merge
8d 23h
Merged PRs (30d)
4

Description

`make_dual(smith::tuple{p, v, L})`, forces CTAD (class template argument deduction) for tuple, which NVCC doesn't like.

```
[100%] Built target smith_functional
[100%] Building CUDA object src/smith/numerics/functional/tests/CMakeFiles/functional_basic_dg.dir/functional_basic_dg.cpp.o
Internal error: assertion failed at: "templates.c", line 16474 in copy_pack_expansion_descr_with_substitution
1 catastrophic error detected in the compilation of "/usr/WS2/meemee/smith/repo/src/smith/numerics/functional/tests/functional_basic_dg.cpp".
Compilation aborted.
nvcc error : 'cudafe++' died due to signal 6
nvcc error : 'cudafe++' core dumped
```

Fix: eliminate CTAD `make_dual(smith::make_tuple(p, v, L))`

Possible better fix recommended by codex:

```cxx
template
SMITH_HOST_DEVICE constexpr auto make_dual_impl(std::integer_sequence, const T&... args)
{
return smith::make_tuple(make_dual_helper(args)...);
}

template
SMITH_HOST_DEVICE constexpr auto make_dual(const T&... args)
{
return make_dual_impl(std::make_integer_sequence{}, args...);

// Then callers can write:
auto dual_args = make_dual(p, v, L);
```

I avoided going this route because it requires a lot of changes across the entire project. And eventually we're going to want to build with enzyme, in which case we'll have to set clang as cuda compiler anyway. So, for now I decided for force clang as the cuda compiler, which eliminates this issue. But at some point it might be good to allow users to build with NVCC as the cuda compiler.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.