mirror of
				https://github.com/paboyle/Grid.git
				synced 2025-11-03 21:44:33 +00:00 
			
		
		
		
	@@ -1,5 +1,9 @@
 | 
			
		||||
#include "Grid.h"
 | 
			
		||||
 | 
			
		||||
//DEBUG
 | 
			
		||||
#include "simd/Grid_vector_types.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
using namespace std;
 | 
			
		||||
using namespace Grid;
 | 
			
		||||
using namespace Grid::QCD;
 | 
			
		||||
@@ -151,6 +155,39 @@ int main (int argc, char ** argv)
 | 
			
		||||
    
 | 
			
		||||
    scMat = sMat*scMat;  // LatticeSpinColourMatrix = LatticeSpinMatrix       * LatticeSpinColourMatrix
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef SSE4
 | 
			
		||||
    ///////// Tests the new class Grid_simd 
 | 
			
		||||
    std::complex<double> ctest(3.0,2.0);
 | 
			
		||||
    std::complex<float> ctestf(3.0,2.0);
 | 
			
		||||
    MyComplexF TestMe1(1.0); // fill real part
 | 
			
		||||
    MyComplexD TestMe2(ctest);
 | 
			
		||||
    MyComplexD TestMe3(ctest);// compiler generate conversion of basic types
 | 
			
		||||
    //MyRealF TestMe5(ctest);// Must generate compiler error
 | 
			
		||||
    MyRealD TestMe4(2.0); 
 | 
			
		||||
 
 | 
			
		||||
    MyComplexF TestMe6(ctestf);
 | 
			
		||||
    MyComplexF TestMe7(ctestf);  
 | 
			
		||||
    
 | 
			
		||||
    MyComplexD TheSum= TestMe2*TestMe3;
 | 
			
		||||
    MyComplexF TheSumF= TestMe6*TestMe7;
 | 
			
		||||
 | 
			
		||||
    double dsum[2];
 | 
			
		||||
    _mm_store_pd(dsum, TheSum.v);
 | 
			
		||||
    for (int i =0; i< 2; i++)
 | 
			
		||||
      printf("%f\n", dsum[i]);
 | 
			
		||||
 | 
			
		||||
    float fsum[4];
 | 
			
		||||
    _mm_store_ps(fsum, TheSumF.v);
 | 
			
		||||
    for (int i =0; i< 4; i++)
 | 
			
		||||
      printf("%f\n", fsum[i]);
 | 
			
		||||
 | 
			
		||||
    vstore(TheSum, &ctest);
 | 
			
		||||
    std::cout << ctest<< std::endl;
 | 
			
		||||
#endif
 | 
			
		||||
    ///////////////////////
 | 
			
		||||
 | 
			
		||||
    // Non-lattice (const objects) * Lattice
 | 
			
		||||
    ColourMatrix cm;
 | 
			
		||||
    SpinColourMatrix scm;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user