Skip to content

Commit 7d0a377

Browse files
authored
Fix SVE dynamic dispatch ODR violation (xtensor-stack#1311)
* Add missing inline * Rename xsimd_inline > xsimd_macros * Avoid ODR violation in SVE dynamic dispatch * Fmt * Remove unused include
1 parent 05b9d84 commit 7d0a377

12 files changed

Lines changed: 1092 additions & 1078 deletions

File tree

benchmark/main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99
* The full license is in the file LICENSE, distributed with this software. *
1010
****************************************************************************/
1111

12-
#include "xsimd_benchmark.hpp"
12+
#include <iostream>
1313
#include <map>
14+
#include <string>
15+
16+
#include "xsimd_benchmark.hpp"
1417

1518
void benchmark_operation()
1619
{

benchmark/xsimd_benchmark.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "xsimd/arch/xsimd_scalar.hpp"
1616
#include "xsimd/xsimd.hpp"
1717
#include <chrono>
18-
#include <iostream>
1918
#include <string>
2019
#include <vector>
2120

include/xsimd/arch/common/xsimd_common_swizzle.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <cstdint>
1717
#include <type_traits>
1818

19-
#include "../../config/xsimd_inline.hpp"
19+
#include "../../config/xsimd_macros.hpp"
2020

2121
namespace xsimd
2222
{

include/xsimd/arch/utils/shifts.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#ifndef XSIMD_UTILS_SHIFTS_HPP
1414
#define XSIMD_UTILS_SHIFTS_HPP
1515

16-
#include "../../config/xsimd_inline.hpp"
16+
#include "../../config/xsimd_macros.hpp"
1717
#include "../../types/xsimd_batch.hpp"
1818
#include "../../types/xsimd_batch_constant.hpp"
1919
#include "../../types/xsimd_traits.hpp"

include/xsimd/arch/xsimd_rvv.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -369,12 +369,12 @@ namespace xsimd
369369
using as_float_relaxed_t = typename as_float_relaxed<sizeof(T)>::type;
370370

371371
template <class T, class U>
372-
rvv_reg_t<T, U::width> rvvreinterpret(U const& arg) noexcept
372+
XSIMD_INLINE rvv_reg_t<T, U::width> rvvreinterpret(U const& arg) noexcept
373373
{
374374
return rvv_reg_t<T, U::width>(arg, types::detail::XSIMD_RVV_BITCAST);
375375
}
376376
template <class T, class A, class U>
377-
rvv_reg_t<T, A::width> rvvreinterpret(batch<U, A> const& arg) noexcept
377+
XSIMD_INLINE rvv_reg_t<T, A::width> rvvreinterpret(batch<U, A> const& arg) noexcept
378378
{
379379
typename batch<U, A>::register_type r = arg;
380380
return rvvreinterpret<T>(r);
@@ -519,23 +519,23 @@ namespace xsimd
519519
XSIMD_RVV_OVERLOAD(rvvget_hi_, (__riscv_vget_ XSIMD_RVV_TSM), _DROP_1ST_CUSTOM_ARGS_NOVL, vec(T, wide_vec), args..., 1)
520520

521521
template <class T, size_t W, std::enable_if_t<W >= types::detail::rvv_width_m1, int> = 0>
522-
rvv_reg_t<T, W> rvvget_lo(rvv_reg_t<T, W * 2> const& vv) noexcept
522+
XSIMD_INLINE rvv_reg_t<T, W> rvvget_lo(rvv_reg_t<T, W * 2> const& vv) noexcept
523523
{
524524
typename rvv_reg_t<T, W>::register_type tmp = rvvget_lo_(T {}, vv);
525525
return tmp;
526526
}
527527
template <class T, size_t W, std::enable_if_t<W >= types::detail::rvv_width_m1, int> = 0>
528-
rvv_reg_t<T, W> rvvget_hi(rvv_reg_t<T, W * 2> const& vv) noexcept
528+
XSIMD_INLINE rvv_reg_t<T, W> rvvget_hi(rvv_reg_t<T, W * 2> const& vv) noexcept
529529
{
530530
typename rvv_reg_t<T, W>::register_type tmp = rvvget_hi_(T {}, vv);
531531
return tmp;
532532
}
533-
template <class T, size_t W, std::enable_if_t<W<types::detail::rvv_width_m1, int> = 0> rvv_reg_t<T, W> rvvget_lo(rvv_reg_t<T, W * 2> const& vv) noexcept
533+
template <class T, size_t W, std::enable_if_t<W<types::detail::rvv_width_m1, int> = 0> XSIMD_INLINE rvv_reg_t<T, W> rvvget_lo(rvv_reg_t<T, W * 2> const& vv) noexcept
534534
{
535535
typename rvv_reg_t<T, W>::register_type tmp = vv;
536536
return tmp;
537537
}
538-
template <class T, size_t W, std::enable_if_t<W<types::detail::rvv_width_m1, int> = 0> rvv_reg_t<T, W> rvvget_hi(rvv_reg_t<T, W * 2> const& vv) noexcept
538+
template <class T, size_t W, std::enable_if_t<W<types::detail::rvv_width_m1, int> = 0> XSIMD_INLINE rvv_reg_t<T, W> rvvget_hi(rvv_reg_t<T, W * 2> const& vv) noexcept
539539
{
540540
return __riscv_vslidedown(vv, vv.vl / 2, vv.vl);
541541
}

include/xsimd/arch/xsimd_scalar.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <limits>
2121
#include <type_traits>
2222

23-
#include "xsimd/config/xsimd_inline.hpp"
23+
#include "xsimd/config/xsimd_macros.hpp"
2424

2525
#ifdef XSIMD_ENABLE_XTL_COMPLEX
2626
#include "xtl/xcomplex.hpp"

0 commit comments

Comments
 (0)