Skip to content

Commit 049e9ee

Browse files
committed
fix: add compile-time get overloads for RVV to resolve ambiguity
RVV only had runtime get(batch, size_t, requires_arch<rvv>) which became ambiguous with the new compile-time get(batch, index<I>, requires_arch<common>) because index<I> (std::integral_constant) implicitly converts to size_t. Add index<I> overloads that delegate to the runtime versions, matching the pattern used by SSE/AVX/NEON.
1 parent c6dd311 commit 049e9ee

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

include/xsimd/arch/xsimd_rvv.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,6 +1370,19 @@ namespace xsimd
13701370
return std::complex<T> { detail::rvvmv_lane0(tmpr), detail::rvvmv_lane0(tmpi) };
13711371
}
13721372

1373+
// get (compile-time index)
1374+
template <class A, size_t I, class T, detail::rvv_enable_all_t<T> = 0>
1375+
XSIMD_INLINE T get(batch<T, A> const& arg, index<I>, requires_arch<rvv>) noexcept
1376+
{
1377+
return get(arg, I, rvv {});
1378+
}
1379+
1380+
template <class A, size_t I, class T, detail::rvv_enable_all_t<T> = 0>
1381+
XSIMD_INLINE std::complex<T> get(batch<std::complex<T>, A> const& arg, index<I>, requires_arch<rvv>) noexcept
1382+
{
1383+
return get(arg, I, rvv {});
1384+
}
1385+
13731386
// all
13741387
template <class A, class T, detail::rvv_enable_all_t<T> = 0>
13751388
XSIMD_INLINE bool all(batch_bool<T, A> const& arg, requires_arch<rvv>) noexcept

0 commit comments

Comments
 (0)