Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 static int nb_load;
00026 static int nb_loadu;
00027 static int nb_store;
00028 static int nb_storeu;
00029
00030 #define EIGEN_DEBUG_ALIGNED_LOAD { nb_load++; }
00031 #define EIGEN_DEBUG_UNALIGNED_LOAD { nb_loadu++; }
00032 #define EIGEN_DEBUG_ALIGNED_STORE { nb_store++; }
00033 #define EIGEN_DEBUG_UNALIGNED_STORE { nb_storeu++; }
00034
00035 #define VERIFY_ALIGNED_UNALIGNED_COUNT(XPR,AL,UL,AS,US) {\
00036 nb_load = nb_loadu = nb_store = nb_storeu = 0; \
00037 XPR; \
00038 if(!(nb_load==AL && nb_loadu==UL && nb_store==AS && nb_storeu==US)) \
00039 std::cerr << " >> " << nb_load << ", " << nb_loadu << ", " << nb_store << ", " << nb_storeu << "\n"; \
00040 VERIFY( (#XPR) && nb_load==AL && nb_loadu==UL && nb_store==AS && nb_storeu==US ); \
00041 }
00042
00043
00044 #include "main.h"
00045
00046 void test_unalignedcount()
00047 {
00048 #ifdef EIGEN_VECTORIZE_SSE
00049 VectorXf a(40), b(40);
00050 VERIFY_ALIGNED_UNALIGNED_COUNT(a += b, 20, 0, 10, 0);
00051 VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0,40) += b.segment(0,40), 10, 10, 10, 0);
00052 VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0,40) -= b.segment(0,40), 10, 10, 10, 0);
00053 VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0,40) *= 3.5, 10, 0, 10, 0);
00054 VERIFY_ALIGNED_UNALIGNED_COUNT(a.segment(0,40) /= 3.5, 10, 0, 10, 0);
00055 #else
00056
00057 nb_load = nb_loadu = nb_store = nb_storeu = 0;
00058 #endif
00059 }