FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Allows to include xsimd without defining XTENSOR_USE_XSIMD · xtensor-stack/xtensor@01c23d9 · GitHub

Repository navigation

Commit 01c23d9

Browse files
committed
Allows to include xsimd without defining XTENSOR_USE_XSIMD
1 parent 9af2790 commit 01c23d9

16 files changed

Lines changed: 106 additions & 55 deletions

‎include/xtensor/xassign.hpp‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ namespace xt
286286
// scope of these data members (since they are odr-used).
287287
static constexpr bool contiguous_layout() { return E1::contiguous_layout && E2::contiguous_layout; }
288288
static constexpr bool convertible_types() { return std::is_convertible<typename E2::value_type, typename E1::value_type>::value; }
289-
static constexpr bool lhs_simd_size() { return xsimd::simd_traits<typename E1::value_type>::size > 1; }
290-
static constexpr bool rhs_simd_size() { return xsimd::simd_traits<typename E2::value_type>::size > 1; }
289+
static constexpr bool lhs_simd_size() { return xt_simd::simd_traits<typename E1::value_type>::size > 1; }
290+
static constexpr bool rhs_simd_size() { return xt_simd::simd_traits<typename E2::value_type>::size > 1; }
291291
static constexpr bool simd_size() { return lhs_simd_size() && rhs_simd_size(); }
292292
static constexpr bool forbid_simd() { return !has_simd_interface<E2>::value; }
293293
static constexpr bool simd_assign() { return contiguous_layout() && convertible_types() && simd_size() && has_simd_interface<E2>::value; }
@@ -511,16 +511,16 @@ namespace xt
511511
template <class E1, class E2>
512512
inline void linear_assigner<simd_assign>::run(E1& e1, const E2& e2)
513513
{
514-
using lhs_align_mode = xsimd::container_alignment_t<E1>;
514+
using lhs_align_mode = xt_simd::container_alignment_t<E1>;
515515
constexpr bool is_aligned = std::is_same<lhs_align_mode, aligned_mode>::value;
516516
using rhs_align_mode = std::conditional_t<is_aligned, inner_aligned_mode, unaligned_mode>;
517517
using value_type = std::common_type_t<typename E1::value_type, typename E2::value_type>;
518-
using simd_type = xsimd::simd_type<value_type>;
518+
using simd_type = xt_simd::simd_type<value_type>;
519519
using size_type = typename E1::size_type;
520520
size_type size = e1.size();
521521
constexpr size_type simd_size = simd_type::size;
522522

523-
size_type align_begin = is_aligned ? 0 : xsimd::get_alignment_offset(e1.data(), size, simd_size);
523+
size_type align_begin = is_aligned ? 0 : xt_simd::get_alignment_offset(e1.data(), size, simd_size);
524524
size_type align_end = align_begin + ((size - align_begin) & ~(simd_size - 1));
525525

526526
for (size_type i = 0; i < align_begin; ++i)
@@ -791,7 +791,7 @@ namespace xt
791791
// add this when we have std::array index!
792792
// std::fill(idx.begin(), idx.end(), 0);
793793
using value_type = std::common_type_t<typename E1::value_type, typename E2::value_type>;
794-
using simd_type = xsimd::simd_type<value_type>;
794+
using simd_type = xt_simd::simd_type<value_type>;
795795

796796
std::size_t simd_size = inner_loop_size / simd_type::size;
797797
std::size_t simd_rest = inner_loop_size % simd_type::size;

‎include/xtensor/xcontainer.hpp‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ namespace xt
8484
using const_pointer = typename storage_type::const_pointer;
8585
using size_type = typename inner_types::size_type;
8686
using difference_type = typename storage_type::difference_type;
87-
using simd_value_type = xsimd::simd_type<value_type>;
87+
using simd_value_type = xt_simd::simd_type<value_type>;
8888

8989
using shape_type = typename inner_types::shape_type;
9090
using strides_type = typename inner_types::strides_type;
@@ -102,8 +102,8 @@ namespace xt
102102

103103
static constexpr layout_type static_layout = inner_types::layout;
104104
static constexpr bool contiguous_layout = static_layout != layout_type::dynamic;
105-
using data_alignment = xsimd::container_alignment_t<storage_type>;
106-
using simd_type = xsimd::simd_type<value_type>;
105+
using data_alignment = xt_simd::container_alignment_t<storage_type>;
106+
using simd_type = xt_simd::simd_type<value_type>;
107107

108108
using storage_iterator = typename iterable_base::storage_iterator;
109109
using const_storage_iterator = typename iterable_base::const_storage_iterator;
@@ -172,12 +172,12 @@ namespace xt
172172
const_reference data_element(size_type i) const;
173173

174174
template <class requested_type>
175-
using simd_return_type = xsimd::simd_return_type<value_type, requested_type>;
175+
using simd_return_type = xt_simd::simd_return_type<value_type, requested_type>;
176176

177177
template <class align, class simd>
178178
void store_simd(size_type i, const simd& e);
179179
template <class align, class requested_type = value_type,
180-
std::size_t N = xsimd::simd_traits<requested_type>::size>
180+
std::size_t N = xt_simd::simd_traits<requested_type>::size>
181181
simd_return_type<requested_type> load_simd(size_type i) const;
182182

183183
storage_iterator storage_begin() noexcept;
@@ -706,7 +706,7 @@ namespace xt
706706
inline void xcontainer<D>::store_simd(size_type i, const simd& e)
707707
{
708708
using align_mode = driven_align_mode_t<alignment, data_alignment>;
709-
xsimd::store_simd<value_type, typename simd::value_type>(&(storage()[i]), e, align_mode());
709+
xt_simd::store_simd<value_type, typename simd::value_type>(&(storage()[i]), e, align_mode());
710710
}
711711

712712
template <class D>
@@ -715,7 +715,7 @@ namespace xt
715715
-> simd_return_type<requested_type>
716716
{
717717
using align_mode = driven_align_mode_t<alignment, data_alignment>;
718-
return xsimd::load_simd<value_type, requested_type>(&(storage()[i]), align_mode());
718+
return xt_simd::load_simd<value_type, requested_type>(&(storage()[i]), align_mode());
719719
}
720720

721721
template <class D>

‎include/xtensor/xdynamic_view.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ namespace xt
137137
using temporary_type = typename xcontainer_inner_types<self_type>::temporary_type;
138138
using base_index_type = xindex_type_t<shape_type>;
139139

140-
using simd_value_type = xsimd::simd_type<value_type>;
140+
using simd_value_type = xt_simd::simd_type<value_type>;
141141
using strides_vt = typename strides_type::value_type;
142142
using slice_type = xtl::variant<detail::xfake_slice<strides_vt>, xkeep_slice<strides_vt>, xdrop_slice<strides_vt>>;
143143
using slice_vector_type = std::vector<slice_type>;

‎include/xtensor/xfunction.hpp‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ namespace xt
9393

9494
template <class V>
9595
struct has_simd_type
96-
: std::integral_constant<bool, !std::is_same<V, xsimd::simd_type<V>>::value>
96+
: std::integral_constant<bool, !std::is_same<V, xt_simd::simd_type<V>>::value>
9797
{
9898
};
9999

@@ -109,7 +109,7 @@ namespace xt
109109
has_simd_type<xvalue_type_t<std::decay_t<CT>>>...>;
110110
// if yes, insert correct type here
111111
using simd_value_type = xtl::mpl::eval_if_t<simd_arguments_exist,
112-
meta_identity<xsimd::simd_type<scalar_result_type>>,
112+
meta_identity<xt_simd::simd_type<scalar_result_type>>,
113113
make_invalid_type<>>;
114114
// if all types are supported, check that the functor has a working
115115
// simd_apply and all arguments have the simd interface
@@ -221,7 +221,7 @@ namespace xt
221221
using simd_argument_type = simd_value_type;
222222

223223
template <class requested_type>
224-
using simd_return_type = xsimd::simd_return_type<value_type, requested_type>;
224+
using simd_return_type = xt_simd::simd_return_type<value_type, requested_type>;
225225

226226
using iterable_base = xconst_iterable<xfunction<F, CT...>>;
227227
using inner_shape_type = typename iterable_base::inner_shape_type;
@@ -327,7 +327,7 @@ namespace xt
327327
operator value_type() const;
328328

329329
template <class align, class requested_type = value_type,
330-
std::size_t N = xsimd::simd_traits<requested_type>::size>
330+
std::size_t N = xt_simd::simd_traits<requested_type>::size>
331331
simd_return_type<requested_type> load_simd(size_type i) const;
332332

333333
const tuple_type& arguments() const noexcept;
@@ -801,9 +801,9 @@ namespace xt
801801
struct get_simd_type
802802
{
803803
using simd_value_type = typename std::decay_t<T>::simd_value_type;
804-
static constexpr bool is_arg_bool = ::xsimd::is_batch_bool<simd_value_type>::value;
805-
static constexpr bool is_res_bool = ::xsimd::is_batch_bool<simd>::value;
806-
static constexpr bool is_arg_cplx = ::xsimd::is_batch_complex<simd_value_type>::value;
804+
static constexpr bool is_arg_bool = ::xt_simd::is_batch_bool<simd_value_type>::value;
805+
static constexpr bool is_res_bool = ::xt_simd::is_batch_bool<simd>::value;
806+
static constexpr bool is_arg_cplx = ::xt_simd::is_batch_complex<simd_value_type>::value;
807807
using type = std::conditional_t<is_res_bool,
808808
common_simd,
809809
std::conditional_t<is_arg_bool || is_arg_cplx,

‎include/xtensor/xfunctor_view.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ namespace xt
202202
// The following functions are defined inline because otherwise signatures
203203
// don't match on GCC.
204204
template <class align, class requested_type = typename xexpression_type::value_type,
205-
std::size_t N = xsimd::simd_traits<requested_type>::size, class FCT = functor_type>
205+
std::size_t N = xt_simd::simd_traits<requested_type>::size, class FCT = functor_type>
206206
auto load_simd(size_type i) const
207207
-> decltype(std::declval<FCT>().template proxy_simd_load<align, requested_type, N>(std::declval<undecay_expression>(), i))
208208
{

‎include/xtensor/xiterator.hpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ namespace xt
111111
using difference_type = typename subiterator_traits::difference_type;
112112
using size_type = typename storage_type::size_type;
113113
using shape_type = typename storage_type::shape_type;
114-
using simd_type = xsimd::simd_type<value_type>;
114+
using simd_type = xt_simd::simd_type<value_type>;
115115

116116
xstepper() = default;
117117
xstepper(storage_type* c, subiterator_type it, size_type offset) noexcept;
@@ -523,7 +523,7 @@ namespace xt
523523
{
524524
R reg;
525525
reg.load_unaligned(&(*m_it));
526-
m_it += xsimd::revert_simd_traits<R>::size;
526+
m_it += xt_simd::revert_simd_traits<R>::size;
527527
return reg;
528528
}
529529

@@ -532,7 +532,7 @@ namespace xt
532532
inline void xstepper<C>::store_simd(const R& vec)
533533
{
534534
vec.store_unaligned(&(*m_it));
535-
m_it += xsimd::revert_simd_traits<R>::size;;
535+
m_it += xt_simd::revert_simd_traits<R>::size;;
536536
}
537537

538538
template <class C>

‎include/xtensor/xmath.hpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ XTENSOR_INT_SPECIALIZATION_IMPL(FUNC_NAME, RETURN_VAL, unsigned long long);
537537
template <class A1, class A2>
538538
constexpr auto simd_apply(const A1& t1, const A2& t2) const noexcept
539539
{
540-
return xsimd::select(t1 < t2, t1, t2);
540+
return xt_simd::select(t1 < t2, t1, t2);
541541
}
542542
};
543543

@@ -553,7 +553,7 @@ XTENSOR_INT_SPECIALIZATION_IMPL(FUNC_NAME, RETURN_VAL, unsigned long long);
553553
template <class A1, class A2>
554554
constexpr auto simd_apply(const A1& t1, const A2& t2) const noexcept
555555
{
556-
return xsimd::select(t1 > t2, t1, t2);
556+
return xt_simd::select(t1 > t2, t1, t2);
557557
}
558558
};
559559

@@ -570,7 +570,7 @@ XTENSOR_INT_SPECIALIZATION_IMPL(FUNC_NAME, RETURN_VAL, unsigned long long);
570570
const A2& lo,
571571
const A3& hi) const
572572
{
573-
return xsimd::select(v < lo, lo, xsimd::select(hi < v, hi, v));
573+
return xt_simd::select(v < lo, lo, xt_simd::select(hi < v, hi, v));
574574
}
575575
};
576576
}

‎include/xtensor/xoffset_view.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace xt
2929
using proxy = xtl::xproxy_wrapper<M>;
3030

3131
template <class value_type, class requested_type>
32-
using simd_return_type = xsimd::simd_return_type<value_type, requested_type>;
32+
using simd_return_type = xt_simd::simd_return_type<value_type, requested_type>;
3333

3434
template <class T>
3535
decltype(auto) operator()(T&& t) const

‎include/xtensor/xoperation.hpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ namespace xt
9393
struct conditional_ternary
9494
{
9595
template <class B>
96-
using get_batch_bool = typename xsimd::simd_traits<typename xsimd::revert_simd_traits<B>::type>::bool_type;
96+
using get_batch_bool = typename xt_simd::simd_traits<typename xt_simd::revert_simd_traits<B>::type>::bool_type;
9797

9898
template <class B, class A1, class A2>
9999
constexpr auto operator()(const B& cond, const A1& v1, const A2& v2) const noexcept
@@ -106,7 +106,7 @@ namespace xt
106106
const B& t2,
107107
const B& t3) const noexcept
108108
{
109-
return xsimd::select(t1, t2, t3);
109+
return xt_simd::select(t1, t2, t3);
110110
}
111111
};
112112

‎include/xtensor/xoptional_assembly_base.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace xt
6262
using const_pointer = typename storage_type::const_pointer;
6363
using size_type = typename raw_value_expression::size_type;
6464
using difference_type = typename raw_value_expression::difference_type;
65-
using simd_value_type = xsimd::simd_type<value_type>;
65+
using simd_value_type = xt_simd::simd_type<value_type>;
6666

6767
using shape_type = typename raw_value_expression::shape_type;
6868
using strides_type = typename raw_value_expression::strides_type;

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL