FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
xtensor/test/test_xsimd.cpp at stable · xtensor-stack/xtensor · GitHub
xtensor-stack
xtensor
Repository navigation
Code
Issues
381
(381)
Pull requests
44
(44)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
xtensor
/
test
/
test_xsimd.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
52 lines (41 loc) · 1.39 KB
Breadcrumbs
xtensor
/
test
/
test_xsimd.cpp
Copy path
File metadata and controls
52 lines (41 loc) · 1.39 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
**************************************************************************
* Copyright (c) Johan Mabille, Sylvain Corlay and Wolf Vollprecht *
* Copyright (c) QuantStack *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
***************************************************************************
*/
#
include
<
complex
>
#
include
<
limits
>
#
include
"
gtest/gtest.h
"
#
include
"
xtensor/xfixed.hpp
"
#
include
"
xtensor/xtensor_config.hpp
"
template
<
typename
T>
class
alignas
(
XTENSOR_FIXED_ALIGN
) Foo
{
public:
using
allocator_type = std::
conditional_t
<
XTENSOR_FIXED_ALIGN
!=
0
,
xt_simd::aligned_allocator<T,
XTENSOR_FIXED_ALIGN
>,
std::allocator<T>>;
Foo
(T fac) :
m_fac
(fac)
{
m_bar.
fill
(fac);
}
auto
get
()
const
{
return
m_bar;
}
private:
xt::xtensor_fixed<T, xt::xshape<
10
,
10
>> m_bar;
T m_fac;
};
namespace
xt
{
TEST
(xsimd,
alignas
)
{
int
fac =
10
;
Foo<
int
>
foo
(
10
);
EXPECT_TRUE
(
xt::sum
(foo.
get
())() == fac *
10
*
10
);
}
}
Back
|
FazBrowse Home
|
New Git URL