Home / Docs / Diagnostics

U2039: A map, zip_map or update in a function with simd required whose lambda cannot be vectorized for a listed target

Release v0.4.0

Not reported by 0.4.0: reserved for the simd required clause, which this release does not read.

Why Una rejects it

A function of a systems package of edition 0.5 (preview) may require that its loops use the processor's vector instructions, with the clause simd required target neon, avx2 after its ensures clauses: the simd required clause of ADR 0120 rule 58. Every map, zip_map and update with an inline lambda in its body, on a dense value of a float, complex or fixed-width element type, must then be vectorizable for each listed target.

A lambda is vectorizable when:

It calls no function, performs no effect and cannot fail. U2039 names the construct, the target and the reason when one is not.

Vectorization never changes a result: the lambda means the scalar loop it equals, and its checks and obligations stay (ADR 0120 rule 55, ADR 0109 rule 5).

The clause lands with its slice of ADR 0120. Until then the release reads no simd required clause, so no program reports U2039, and this text has no example of its own.

How to fix it