Re:Show HN: Krep a High-Performance String Search Utility Wr...
by doctorsher on Tuesday March 11, 2025 @11:52PM
(#43339808)
I am interested in the CPU intrinsics detection in a single header file, if you don’t mind dropping the link.
[ Parent
| on HN ]
Re:Show HN: Krep a High-Performance String Search Utility Wr...
by ashvardanian on Wednesday March 12, 2025 @03:32AM
(#43340702)
Here 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....
There are also several AVX-512 kernels for different CPU generations, so it’s obviously longer than just checking for AVX.
Re:Show HN: Krep a High-Performance String Search Utility Wr...
by johnisgood on Wednesday March 12, 2025 @06:36AM
(#43341726)
https://zolk3ri.name/cgit/cpudetect/about/ (direct link to the header file: 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).