File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414 llvm_version : ' 8'
1515 clang_9 :
1616 llvm_version : ' 9'
17+ clang_10 :
18+ llvm_version : ' 10'
19+ disable_xsimd : 1
1720 pool :
1821 vmImage : ubuntu-16.04
1922 variables :
Original file line number Diff line number Diff line change @@ -18,19 +18,19 @@ Alignment of fixed-size members
1818
1919If you define a structure having members of fixed-size xtensor types,
2020you must ensure that the buffers properly aligned.
21- For this you can use the macro ``XTENSOR_SELECT_ALIGN `` available in
21+ For this you can use the macro ``XTENSOR_FIXED_ALIGN `` available in
2222``xtensor/xtensor_config.hpp ``.
2323Consider the following example:
2424
2525.. code-block :: cpp
2626
2727 template <typename T>
28- class alignas(XTENSOR_SELECT_ALIGN(T) ) Foo
28+ class alignas(XTENSOR_FIXED_ALIGN ) Foo
2929 {
3030 public:
3131
32- using allocator_type = std::conditional_t<XTENSOR_SELECT_ALIGN(T) != 0,
33- xt_simd::aligned_allocator<T, XTENSOR_SELECT_ALIGN(T) >,
32+ using allocator_type = std::conditional_t<XTENSOR_FIXED_ALIGN != 0,
33+ xt_simd::aligned_allocator<T, XTENSOR_FIXED_ALIGN >,
3434 std::allocator<T>>;
3535
3636 Foo(T fac) : m_fac(fac)
Original file line number Diff line number Diff line change 114114#define XTENSOR_SELECT_ALIGN (T ) (XTENSOR_DEFAULT_ALIGNMENT != 0 ? XTENSOR_DEFAULT_ALIGNMENT : alignof (T))
115115#endif
116116
117+ #ifndef XTENSOR_FIXED_ALIGN
118+ #define XTENSOR_FIXED_ALIGN XTENSOR_SELECT_ALIGN (void *)
119+ #endif
120+
117121#ifdef IN_DOXYGEN
118122namespace xtl
119123{
Original file line number Diff line number Diff line change 1515#include " xtensor/xtensor_config.hpp"
1616
1717template <typename T>
18- class alignas (XTENSOR_SELECT_ALIGN(T) ) Foo
18+ class alignas (XTENSOR_FIXED_ALIGN ) Foo
1919{
2020public:
2121
22- using allocator_type = std::conditional_t <XTENSOR_SELECT_ALIGN (T) != 0 ,
23- xt_simd::aligned_allocator<T, XTENSOR_SELECT_ALIGN (T) >,
22+ using allocator_type = std::conditional_t <XTENSOR_FIXED_ALIGN != 0 ,
23+ xt_simd::aligned_allocator<T, XTENSOR_FIXED_ALIGN >,
2424 std::allocator<T>>;
2525
2626 Foo (T fac) : m_fac (fac)
@@ -49,3 +49,4 @@ namespace xt
4949 EXPECT_TRUE (xt::sum (foo.get ())() == fac * 10 * 10 );
5050 }
5151}
52+
You can’t perform that action at this time.
0 commit comments