4 ms·
I am interested in the CPU intrinsics detection in a single header file, if you don’t mind dropping the link.
by doctorsher 2y ago
I am interested in the CPU intrinsics detection in a single header file, if you don’t mind dropping the link.
- ashvardanian 2y agoHere is the code I use to detect available CPU features at runtime and dispatch the correct kernels - https://github.com/ashvardanian/StringZilla/blob/main/c/lib.c https://github.com/ashvardanian/StringZilla/blob/main/c/lib.... There are also several AVX-512 kernels for different CPU generations, so it’s obviously longer than just checking for AVX.
- johnisgood 2y agohttps://zolk3ri.name/cgit/cpudetect/about/ https://zolk3ri.name/cgit/cpudetect/about/ (direct link to the header file: https://zolk3ri.name/cgit/cpudetect/tree/cpudetect.h https://zolk3ri.name/cgit/cpudetect/tree/cpudetect.h) If you are unsure about something, or it misses something you'd like added, feel free to e-mail the author. I am in touch with him at times and he seems friendly. I remember he wanted to implement more than just detecting CPU instructions, but he did not want to make it bloated with checking for cache sizes and whatnot (can't remember the details).