From 3ae3a44c7431e7a6a8728a3b0a93568e8760e984 Mon Sep 17 00:00:00 2001 From: nihui Date: Tue, 20 Feb 2024 22:53:57 +0800 Subject: [PATCH] Update README.md --- README.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a0d6bcd..30f6e09 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,25 @@ detect cpu isa features with single-file - +
CPU arch ✅ x86, x86-64
✅ arm, aarch64
CPU arch ✅ x86, x86-64
✅ arm, aarch64
+ +```c +#define RUAPU_IMPLEMENTATION +#include "ruapu.h" + +int main() +{ + // initialize ruapu once + ruapu_cpu_init(); + + // now, tell me if this cpu has avx2 + int has_avx2 = ruapu_cpu_supports("avx2"); + + return 0; +} +``` + +
OS✅ Windows
✅ Linux
✅ macOS
✅ Android
✅ iOS
Compiler✅ GCC
✅ Clang
✅ MSVC