Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Avx512 #408

Merged
merged 3 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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__
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If AVX-512 is disabled, shouldn't __AVX512F__ not be defined, and this section of code would be avoided?

// 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
Loading