aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md27
1 files changed, 1 insertions, 26 deletions
diff --git a/README.md b/README.md
index 8a34168..29d7946 100644
--- a/README.md
+++ b/README.md
@@ -30,10 +30,6 @@ instructions) at runtime.
- **Unit tested.**
<a name="codesample"></a>
-## Code samples
-
-**Note:** For C++ code, the library functions are defined in the `CpuFeatures` namespace.
-
### Checking features at runtime
Here's a simple example that executes a codepath if the CPU supports both the
@@ -42,7 +38,6 @@ AES and the SSE4.2 instruction sets:
```c
#include "cpuinfo_x86.h"
-// For C++, add `using namespace CpuFeatures;`
static const X86Features features = GetX86Info().features;
void Compute(void) {
@@ -64,7 +59,6 @@ features and then check whether AES and NEON are supported.
#include <stdbool.h>
#include "cpuinfo_arm.h"
-// For C++, add `using namespace CpuFeatures;`
static const ArmFeatures features = GetArmInfo().features;
static const bool has_aes_and_neon = features.aes && features.neon;
@@ -84,7 +78,6 @@ instruction set (e.g., `g++ -mavx`) and sets `has_avx` accordingly.
#include <stdbool.h>
#include "cpuinfo_x86.h"
-// For C++, add `using namespace CpuFeatures;`
static const X86Features features = GetX86Info().features;
static const bool has_avx = CPU_FEATURES_COMPILED_X86_AVX || features.avx;
@@ -107,7 +100,6 @@ set&mdash;but only if it's not Sandy Bridge.
#include <stdbool.h>
#include "cpuinfo_x86.h"
-// For C++, add `using namespace CpuFeatures;`
static const X86Info info = GetX86Info();
static const X86Microarchitecture uarch = GetX86Microarchitecture(&info);
static const bool has_fast_avx = info.features.avx && uarch != INTEL_SNB;
@@ -120,7 +112,7 @@ This feature is currently available only for x86 microarchitectures.
<a name="usagesample"></a>
### Running sample code
-Building `cpu_features` (check [quickstart](#quickstart) below) brings a small executable to test the library.
+Building `cpu_features` brings a small executable to test the library.
```shell
% ./build/list_cpu_features
@@ -180,20 +172,3 @@ See [LICENSE](LICENSE) for more information.
## Build with CMake
Please check the [CMake build instructions](cmake/README.md).
-
-<a name="quickstart"></a>
-### Quickstart with `Ninja`
-
- - build `list_cpu_features`
-```
- cmake -B/tmp/cpu_features -H. -GNinja -DCMAKE_BUILD_TYPE=Release
- ninja -C/tmp/cpu_features
- /tmp/cpu_features/list_cpu_features --json
-```
-
- - run tests
-```
- cmake -B/tmp/cpu_features -H. -GNinja -DBUILD_TESTING=ON
- ninja -C/tmp/cpu_features
- ninja -C/tmp/cpu_features test
-```