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

Missing maximum() function for AVX512 #142

Open
jakob0 opened this issue May 20, 2021 · 2 comments
Open

Missing maximum() function for AVX512 #142

jakob0 opened this issue May 20, 2021 · 2 comments

Comments

@jakob0
Copy link

jakob0 commented May 20, 2021

Hi,
when I try to compile code using Fastor::max(), I get a compiler error.

The member function "maximum()" seems to be missing for Fastor::SIMDVector<double, simd_abi::avx512>.

@romeric
Copy link
Owner

romeric commented Jul 21, 2021

Yes. I did not write this one intentionally. Horizontal operations are very expensive on AVX512 vector lanes. If you're stuck at compiling we can add a scalar variant for now.

Thanks
Roman

@J-S-Robinson
Copy link

Ran into this problem after trying to compile some stuff on a skylake machine for the first time. Would just calling the 256-bit hmax on the upper and lower lane be an okay workaround? Something like:

double _mm512_hmax_pd(__m512d a) {
    __m256d afirst = _mm512_castpd512_pd256(a);
    __m256d asecond = _mm512_extractf64x4_pd (a,0x1);
    return std::fmax( _mm256_hmax_pd(afirst),_mm256_hmax_pd(asecond));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants