Skip to content

Are SVE/I8MM ever detected at runtime? #1252

@AntoinePrv

Description

@AntoinePrv

Related to working #1245, I am wondering if dynamic dispatch to SVE (to name one) is ever possible.

If I understand correctly, for a give function add we would like to dispatch, it would get compiled to

  • add_neon.cpp (assuming we also dispatch it for simplicity here) with XSIMD_WITH_NEON (__ARM_NEON...)
  • add_sve.cpp XSIMD_WITH_SVE (__ARM_FEATURE_SVE...)
  • add_dispatch.cpp where we use xsimd::dispatch with no compilation options in particular (since it needs to run on all platforms).

However in the supported architecture code, getting sve value from getauxval is gated behind a check for compile-time activation of SVE.
Therefore in add_dispatch.cpp, SVE is never detected.

#elif defined(__ARM_FEATURE_SVE) && defined(__ARM_FEATURE_SVE_BITS) && __ARM_FEATURE_SVE_BITS > 0
#if defined(__linux__) && (!defined(__ANDROID_API__) || __ANDROID_API__ >= 18)
sve = bool(getauxval(AT_HWCAP) & HWCAP_SVE);
#endif

Am I understanding this correctly @serge-sans-paille @kou ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions