24 template<
typename V,
unsigned int Size,
template<
typename V2,
unsigned int Size2>
class TestClass>
struct TestWrapper
26 static inline void run()
28 TestWrapper<V, Size/2, TestClass>
::run();
29 TestClass<V, Size>::test();
30 TestClass<V, Size - 1>::test();
33 template<
typename V,
template<
typename V2,
unsigned int Size>
class TestClass>
struct TestWrapper<V, 1, TestClass> {
34 static inline void run() {}
37 template<
typename V,
unsigned int Size>
struct TestEntries {
static void test() {
38 typedef typename V::EntryType
T;
43 for (
unsigned int i = 0; i <
Size; ++i) {
47 for (
unsigned int i = 0; i <
Size; ++i) {
52 for (
unsigned int i = 0; i <
Size; ++i) {
58 for (
unsigned int i = 0; i <
Size; ++i) {
62 for (
unsigned int i = 0; i <
Size; ++i) {
67 template<
typename V,
unsigned int Size>
struct TestEntries2D {
static void test() {
68 typedef typename V::EntryType
T;
73 for (
size_t i = 0; i <
Size; ++i) {
74 for (
size_t j = 0; j <
Size; ++j) {
78 for (
size_t i = 0; i <
Size; ++i) {
79 for (
size_t j = 0; j <
Size; ++j) {
84 for (
size_t i = 0; i <
Size; ++i) {
85 for (
size_t j = 0; j <
Size; ++j) {
86 COMPARE(m[i].entries()[j],
T(x + i + j));
87 COMPARE(m2[i].entries()[j],
T(x + i + j));
90 for (
size_t i = 0; i <
Size; ++i) {
92 for (
size_t j = 0; j <
Size; ++j) {
98 template<
typename V,
unsigned int Size>
struct TestVectors {
static void test()
115 for (
int shift = 0; shift <
V::Size; ++shift, ++
x) {
118 COMPARE(V(m3.vector(i, shift)), x);
126 template<
typename V,
unsigned int Size>
struct TestVectors2D {
static void test()
146 for (
int shift = 0; shift <
V::Size; ++shift, ++
x) {
157 template<
typename V,
unsigned int Size>
struct TestVectorReorganization {
static void test()
159 typename V::Memory
init;
160 for (
unsigned int i = 0; i <
V::Size; ++i) {
180 unsigned int indexes[
Size];
181 for (
unsigned int i = 0; i <
Size; ++i) {
184 for (
unsigned int i = 0; i + V::Size <
Size; ++i) {
190 for (
unsigned int i = 0; i <
V::Size; ++i) {
194 for (
unsigned int i = 0; i <
Size; ++i) {
195 indexes[i] = (i * 2) % Size;
197 for (
unsigned int i = 0; i + V::Size <
Size; ++i) {
201 x(x >= Size) -=
Size;
286 typedef typename V::EntryType
T;
_VC_CONSTEXPR size_t vectorsCount() const
_VC_CONSTEXPR size_t entriesCount() const
#define testAllTypes(name)
Vc_ALWAYS_INLINE Vc_PURE VectorPointerHelper< V, AlignedFlag > vector(size_t i)
void run(bool only_compile=false)
void testVectorReorganization()
A helper class for fixed-size two-dimensional arrays.
Vc_ALWAYS_INLINE Vc_PURE V gather(const unsigned char *indexes) const
_VC_CONSTEXPR size_t rowsCount() const
Vc_ALWAYS_INLINE void setZero()
void testCopyAssignment()