ggml-cpu: add arm64 CPU feature check for OpenBSD, FreeBSD
cc @ggerganov
These feature checks are not really functional, because enabling these features, which is necessary to use the intrinsics, may still cause the compiler to emit code using these instruction sets, even when the instrinsics are not directly used. So what we really need to do is remove it entirely, and rely only on the compile flags to determine which instruction sets to use.
These feature checks are not really functional, because enabling these features, which is necessary to use the intrinsics, may still cause the compiler to emit code using these instruction sets, even when the instrinsics are not directly used. So what we really need to do is remove it entirely, and rely only on the compile flags to determine which instruction sets to use.
That sounds problematic from a perspective of building packages. Packages have to run on a wide range of systems and that just means having to build to the lowest common denominator which means no benefit from the newer CPU features.
For x64 we have the ability to build multiple versions of the CPU backend with different architecture flags and choose the best one to load at runtime. This allows building a package that works on every computer, and it is enabled by building with GGML_BACKEND_DL and GGML_CPU_ALL_VARIANTS enabled.
This is not support for ARM at the moment because it lacks the implementation of the feature checking interface that allows it to select the best variant to load. For x64 this is implemented in cpu-feats-x86.cpp. So that's where the development effort should be directed, not on this feature check that doesn't really work.