Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:04

0001 #include <iostream>
0002 #include "DataFormats/Math/interface/SSEVec.h"
0003 
0004 int main() {
0005 #ifdef CMS_USE_SSE
0006   {
0007     mathSSE::Vec4<float> yAxis(-0.0144846, 0.932024, -0.362108);
0008     mathSSE::Vec4<float> zAxis(-0.204951, 0.351689, 0.913406);
0009 
0010     auto xAxis = ::cross(yAxis, zAxis);
0011 
0012     const mathSSE::Vec4<float> correctXAxis(0.978666, 0.0874447, 0.185925);
0013     std::cout << " x axis " << xAxis << std::endl;
0014     if (abs(xAxis.o.theX - correctXAxis.o.theX) > 0.000001 or abs(xAxis.o.theY - correctXAxis.o.theY) > 0.000001 or
0015         abs(xAxis.o.theZ - correctXAxis.o.theZ) > 0.000001) {
0016       std::cout << "BAD since not same as " << correctXAxis << std::endl;
0017       return 1;
0018     }
0019   }
0020   {
0021     mathSSE::Vec4<double> yAxis(-0.0144846, 0.932024, -0.362108);
0022     mathSSE::Vec4<double> zAxis(-0.204951, 0.351689, 0.913406);
0023 
0024     auto xAxis = ::cross(yAxis, zAxis);
0025 
0026     const mathSSE::Vec4<float> correctXAxis(0.978666, 0.0874447, 0.185925);
0027     std::cout << " x axis " << xAxis << std::endl;
0028     if (abs(xAxis.o.theX - correctXAxis.o.theX) > 0.000001 or abs(xAxis.o.theY - correctXAxis.o.theY) > 0.000001 or
0029         abs(xAxis.o.theZ - correctXAxis.o.theZ) > 0.000001) {
0030       std::cout << "BAD since not same as " << correctXAxis << std::endl;
0031       return 1;
0032     }
0033   }
0034 
0035   std::cout << "arch->x86" << std::endl;
0036 #else
0037   std::cout << "arch->non-x86" << std::endl;
0038 #endif
0039   return 0;
0040 }