diff --git a/libsrc/gprim/geomobjects.hpp b/libsrc/gprim/geomobjects.hpp index e1e56785..f32376fb 100644 --- a/libsrc/gprim/geomobjects.hpp +++ b/libsrc/gprim/geomobjects.hpp @@ -17,7 +17,7 @@ namespace netgen template - class Point : public AlignedAlloc> + class Point : public ngsimd::AlignedAlloc> { protected: @@ -67,7 +67,7 @@ namespace netgen }; template - class Vec : public AlignedAlloc> + class Vec : public ngsimd::AlignedAlloc> { protected: @@ -150,7 +150,7 @@ namespace netgen template - class Mat : public AlignedAlloc> + class Mat : public ngsimd::AlignedAlloc> { protected: diff --git a/libsrc/interface/nginterface_v2.cpp b/libsrc/interface/nginterface_v2.cpp index ff5acc79..d95f71e1 100644 --- a/libsrc/interface/nginterface_v2.cpp +++ b/libsrc/interface/nginterface_v2.cpp @@ -646,26 +646,29 @@ namespace netgen +#ifdef __AVX__ +#include + template<> DLL_HEADER void Ngx_Mesh :: MultiElementTransformation<1,1> (int elnr, int npts, - const SIMD * xi, size_t sxi, - SIMD * x, size_t sx, - SIMD * dxdxi, size_t sdxdxi) const + const __m256d * xi, size_t sxi, + __m256d * x, size_t sx, + __m256d * dxdxi, size_t sdxdxi) const { cout << "multi-eltrafo simd called, 1,1,simd" << endl; } template<> DLL_HEADER void Ngx_Mesh :: MultiElementTransformation<2,2> (int elnr, int npts, - const SIMD * xi, size_t sxi, - SIMD * x, size_t sx, - SIMD * dxdxi, size_t sdxdxi) const + const __m256d * xi, size_t sxi, + __m256d * x, size_t sx, + __m256d * dxdxi, size_t sdxdxi) const { mesh->GetCurvedElements().CalcMultiPointSurfaceTransformation<2> (elnr, npts, - xi, sxi, - x, sx, - dxdxi, sdxdxi); + reinterpret_cast*> (xi), sxi, + reinterpret_cast*> (x), sx, + reinterpret_cast*> (dxdxi), sdxdxi); /* for (int i = 0; i < npts; i++) { @@ -692,15 +695,15 @@ namespace netgen template<> DLL_HEADER void Ngx_Mesh :: MultiElementTransformation<3,3> (int elnr, int npts, - const SIMD * xi, size_t sxi, - SIMD * x, size_t sx, - SIMD * dxdxi, size_t sdxdxi) const + const __m256d * xi, size_t sxi, + __m256d * x, size_t sx, + __m256d * dxdxi, size_t sdxdxi) const { mesh->GetCurvedElements().CalcMultiPointElementTransformation (elnr, npts, - xi, sxi, - x, sx, - dxdxi, sdxdxi); + reinterpret_cast*> (xi), sxi, + reinterpret_cast*> (x), sx, + reinterpret_cast*> (dxdxi), sdxdxi); /* for (int i = 0; i < npts; i++) { @@ -727,27 +730,27 @@ namespace netgen template<> DLL_HEADER void Ngx_Mesh :: MultiElementTransformation<0,2> (int elnr, int npts, - const SIMD *xi, size_t sxi, - SIMD * x, size_t sx, - SIMD * dxdxi, size_t sdxdxi) const + const __m256d *xi, size_t sxi, + __m256d * x, size_t sx, + __m256d * dxdxi, size_t sdxdxi) const { cout << "MultiElementtransformation<0,2> simd not implemented" << endl; } template<> DLL_HEADER void Ngx_Mesh :: MultiElementTransformation<0,1> (int elnr, int npts, - const SIMD * xi, size_t sxi, - SIMD * x, size_t sx, - SIMD * dxdxi, size_t sdxdxi) const + const __m256d * xi, size_t sxi, + __m256d * x, size_t sx, + __m256d * dxdxi, size_t sdxdxi) const { cout << "multi-eltrafo simd called, 0,1,simd" << endl; } template<> DLL_HEADER void Ngx_Mesh :: MultiElementTransformation<1,3> (int elnr, int npts, - const SIMD * xi, size_t sxi, - SIMD * x, size_t sx, - SIMD * dxdxi, size_t sdxdxi) const + const __m256d * xi, size_t sxi, + __m256d * x, size_t sx, + __m256d * dxdxi, size_t sdxdxi) const { double hxi[4][1]; double hx[4][3]; @@ -769,9 +772,9 @@ namespace netgen template<> DLL_HEADER void Ngx_Mesh :: MultiElementTransformation<1,2> (int elnr, int npts, - const SIMD * xi, size_t sxi, - SIMD * x, size_t sx, - SIMD * dxdxi, size_t sdxdxi) const + const __m256d * xi, size_t sxi, + __m256d * x, size_t sx, + __m256d * dxdxi, size_t sdxdxi) const { for (int i = 0; i < npts; i++) { @@ -798,15 +801,15 @@ namespace netgen template<> DLL_HEADER void Ngx_Mesh :: MultiElementTransformation<2,3> (int elnr, int npts, - const SIMD * xi, size_t sxi, - SIMD * x, size_t sx, - SIMD * dxdxi, size_t sdxdxi) const + const __m256d * xi, size_t sxi, + __m256d * x, size_t sx, + __m256d * dxdxi, size_t sdxdxi) const { mesh->GetCurvedElements().CalcMultiPointSurfaceTransformation<3> (elnr, npts, - xi, sxi, - x, sx, - dxdxi, sdxdxi); + reinterpret_cast*> (xi), sxi, + reinterpret_cast*> (x), sx, + reinterpret_cast*> (dxdxi), sdxdxi); /* for (int i = 0; i < npts; i++) { @@ -831,6 +834,7 @@ namespace netgen */ } +#endif diff --git a/libsrc/visualization/soldata.hpp b/libsrc/visualization/soldata.hpp index 0ae4b453..4c846d62 100644 --- a/libsrc/visualization/soldata.hpp +++ b/libsrc/visualization/soldata.hpp @@ -92,15 +92,17 @@ namespace netgen return res; } +#ifdef __AVX__ virtual bool GetMultiSurfValue (size_t selnr, size_t facetnr, size_t npts, - const SIMD * xref, - const SIMD * x, - const SIMD * dxdxref, - SIMD * values) + const __m256d * xref, + const __m256d * x, + const __m256d * dxdxref, + __m256d * values) { cerr << "GetMultiSurfVaue not overloaded for SIMD" << endl; return false; } +#endif virtual bool GetSegmentValue (int segnr, double xref, double * values) { return false; }