Commit 4014f5a9 authored by COULAUD Olivier's avatar COULAUD Olivier
parents aa8ee3be 99e61ae2
......@@ -243,7 +243,7 @@ int main(int argc, char ** argv){
std::cout << "Cannot open file."<< std::endl;
return 1;
}
outfile.write((char* )(&NbPoints),sizeof(NbPoints));
outfile.write((char* )const_cast<int*>(&NbPoints),sizeof(NbPoints));
outfile.write((char*)&BoxWith,sizeof(BoxWith));
outfile.write((char*)Centre.getDataValue(),sizeof(FReal)*3);
//
......
......@@ -24,7 +24,7 @@ namespace FP2P{
FReal*const targetsForcesZ = inTargets->getForcesZ();
FReal*const targetsPotentials = inTargets->getPotentials();
std::cout << " OK AVX " << std::endl;
// std::cout << " OK AVX " << std::endl;
const __m256d mOne = _mm256_set1_pd(1.0);
for(int idxNeighbors = 0 ; idxNeighbors < limiteNeighbors ; ++idxNeighbors){
......@@ -209,10 +209,10 @@ namespace FP2P{
const __m256d*const sourcesZ = (const __m256d*)inNeighbors[idxNeighbors]->getPositions()[2];
for(int idxTarget = 0 ; idxTarget < nbParticlesTargets ; ++idxTarget){
const __m256d tx = _mm_load1_pd(&targetsX[idxTarget]);
const __m256d ty = _mm_load1_pd(&targetsY[idxTarget]);
const __m256d tz = _mm_load1_pd(&targetsZ[idxTarget]);
const __m256d tv = _mm_load1_pd(&targetsPhysicalValues[idxTarget]);
const __m256d tx = _mm256_broadcast_sd(&targetsX[idxTarget]);
const __m256d ty = _mm256_broadcast_sd(&targetsY[idxTarget]);
const __m256d tz = _mm256_broadcast_sd(&targetsZ[idxTarget]);
const __m256d tv = _mm256_broadcast_sd(&targetsPhysicalValues[idxTarget]);
__m256d tfx = _mm256_setzero_pd();
__m256d tfy = _mm256_setzero_pd();
__m256d tfz = _mm256_setzero_pd();
......
#ifndef FAVX_HPP
#define FAVX_HPP
#include "immintrin.h"
#ifdef __INTEL_COMPILER
//Side effect operators DOUBLE
inline __m256d& operator+=(__m256d & a, const __m256d & b){
return (a = _mm256_add_pd (a,b));
}
inline __m256d& operator-=(__m256d& a, const __m256d& b){
return (a = _mm256_sub_pd (a,b));
}
inline __m256d& operator*=(__m256d& a, const __m256d& b){
return (a = _mm256_mul_pd (a,b));
}
inline __m256d& operator/=(__m256d& a, const __m256d& b){
return (a = _mm256_div_pd (a,b));
}
//No side effect operators DOUBLE
inline __m256d operator+(const __m256d& a,const __m256d& b){
return _mm256_add_pd (a,b);
}
inline __m256d operator-(const __m256d& a, const __m256d& b){
return _mm256_sub_pd (a,b);
}
inline __m256d operator*(const __m256d& v1, const __m256d& v2){
return _mm256_mul_pd(v1, v2);
}
inline __m256d operator/(const __m256d& v1, const __m256d& v2){
return _mm256_div_pd(v1, v2);
}
//Side effect operators SINGLE
inline __m256& operator+=(__m256 & a, const __m256 & b){
return (a = _mm256_add_ps (a,b));
}
inline __m256& operator-=(__m256& a, const __m256& b){
return (a = _mm256_sub_ps (a,b));
}
inline __m256& operator*=(__m256& a, const __m256& b){
return (a = _mm256_mul_ps (a,b));
}
inline __m256& operator/=(__m256& a, const __m256& b){
return (a = _mm256_div_ps (a,b));
}
//No side effect operators SINGLE
inline __m256 operator+(const __m256& a,const __m256& b){
return _mm256_add_ps (a,b);
}
inline __m256 operator-(const __m256& a, const __m256& b){
return _mm256_sub_ps (a,b);
}
inline __m256 operator*(const __m256& v1, const __m256& v2){
return _mm256_mul_ps(v1, v2);
}
inline __m256 operator/(const __m256& v1, const __m256& v2){
return _mm256_div_ps(v1, v2);
}
#endif
#endif
......@@ -17,7 +17,7 @@
// return drand48();
//} ;
void initRandom() {
srand48( static_cast<unsigned int>(time(0))) ;
srand48( static_cast<long int>(time(0))) ;
} ;
FReal getRandom() {
return static_cast<FReal>(drand48());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment