Skip to content

Hard to debug swizzle mask constant type #1135

@AntoinePrv

Description

@AntoinePrv

swizzle has pretty weak mask type constraint

swizzle(batch<T, A> const& x, batch_constant<Vt, A, Values...> mask) noexcept

But (at least some) kernels require it to be an unsigned integer type. On MSVC I ran into a compiler error when using signed integers in the mask.

XSIMD_INLINE batch<float, A> swizzle(batch<float, A> const& self, batch<uint32_t, A> mask, requires_arch<avx2>) noexcept

A possible solution could be to replace Vt with as_unsigned_integer_t<T>. In term of breakage, this moves the implicit conversion from xsimd to user code.

This may concern shuffle too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions