Skip to content

Commit

Permalink
Merge pull request #408 from hiddenSymmetries/avx512
Browse files Browse the repository at this point in the history
Disable Avx512
  • Loading branch information
mbkumar authored Apr 29, 2024
2 parents 295ac65 + f595c3d commit fe1087e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

4 changes: 3 additions & 1 deletion src/simsoptpp/simdhelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ using AlignedPaddedVec = std::vector<double, AlignedPaddedAllocator<double>>;
#endif

#if defined(USE_XSIMD)
/*
#if __AVX512F__
// On skylake _mm512_sqrt_pd takes 24 CPI and _mm512_div_pd takes 16 CPI, so
// 1/sqrt(vec) takes 40 CPI. Instead we can use the approximate inverse square
Expand All @@ -147,6 +148,7 @@ inline simd_t rsqrt(simd_t r2){
return rinv;
}
#else
*/
inline simd_t rsqrt(const simd_t& r2){
//On my avx2 machine, computing the sqrt and then the inverse is actually a
//bit faster. just keeping this line here to remind myself how to compute
Expand All @@ -155,7 +157,7 @@ inline simd_t rsqrt(const simd_t& r2){
return 1./sqrt(r2);
}

#endif
//#endif
#endif

inline double rsqrt(const double& r2){
Expand Down

0 comments on commit fe1087e

Please sign in to comment.