P2929R2 — Proposal to add simd_invoke to std::simd (9 items) LEWG
Daniel Towner, Ruslan Arutyunyan
This paper proposes adding a `simd::chunked_invoke` function to the C++ standard library's `std::simd` facility. The function accepts a callable and one or more `basic_vec` or `basic_mask` arguments, decomposes each argument into native-register-sized chunks using `simd::chunk`, invokes the callable on corresponding chunks (optionally passing the chunk index), and reassembles the results via `simd::cat`. This simplifies the boilerplate required to apply target-specific SIMD intrinsics to `basic_vec` values that span multiple hardware registers.

References — Anthropic Citations API

[1] chars 0–469
"# P2929R2Proposal to add simd_invoke to std::simd ## Draft Proposal, 2026-01-26 This version: http://wg21.link/D2929R2.html Authors: Daniel Towner (Intel) Ruslan Arutyunyan..."
[2]
"auto {lowA, highA} = chunk>(a); auto {lowB, highB} = chunk>(b);"
[3]
"Although std:simd has been carefully crafted to include APIs which access all of the common or desirable features of SIMD instruction sets"
[4]
"Let's look how the example from § 3 Background looks like with chunked_invoked applied"
[5] chars 11552–12065
"auto do_native = [](basic_vec lhs, basic_vec rhs) { if constexpr (basic_vec::size <= 4) return vec
[5] chars 11552–12065
"auto do_native = [](basic_vec lhs, basic_vec rhs) { if constexpr (basic_vec::size <= 4) return vec
[6]
"Let's look how the example from § 3 Background looks like with chunked_invoked applied"
[7] chars 21468–21571
"Returns: If the Callable function has a void return, return nothing, otherwise return cat(Result). "
Summary: P2929R2 proposes a function chunked_invoke (renamed from simd_invoke in prior revisions) that splits a std::simd object into native-sized chunks, invokes a user-provided callable on each chunk, and concatenates the results. The paper provides wording for inclusion in the simd header.
Pipeline: Discovery (Anthropic Opus + Citations API) → Verification Gate (OpenRouter Opus) → Report Writer (OpenRouter Opus)
Provenance: All references are machine-verified character positions from the Anthropic Citations API — deterministic, exact substrings, not model-generated quotes.