Jakub Jelinek wrote:
It of course makes a lot of sense. declare simd is used mostly on the host in the wild, outside of target regions.
On "normal" Linux for instance in /usr/include/bits/math-vector.h, albeit most of the time -fopenmp is not active such that the "simd" attribute is used instead (as always with gfortran). In general, my feeling is that 'declare variant' is not widely used, possibly except in some corner cases with vendor libraries. — And for manually coded vector functions, I find it much more likely to see a x86-64 (or aarch64) version than a GPU version. And that's what matters for 'declare variant' with a 'simd' trait in the context selector. That's separate from finding 'parallel for simd' in user code, which can be found alike for host and non-host device code. Still, most of the time it is just used without any 'declare simd' and I doubt that there is much if any production code that goes further and uses 'declare variant' with a 'simd' trait in the selector (in general and for non-host code in particular). Tobias