Skip to content

Commit 6e87e07

Browse files
updates
1 parent eeb54af commit 6e87e07

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

content/learning-paths/servers-and-cloud-computing/sve2-match/sve2-match-search.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Create a directory for your implementations:
3838
mkdir -p sve2_match_demo
3939
cd sve2_match_demo
4040
```
41-
## Understanding the Problem
41+
## Understanding the problem
4242

4343
Your goal is to implement a function that searches for any occurrence of a set of keys in an array. The function should return true if any element in the array matches any of the keys, and false otherwise.
4444

@@ -89,7 +89,7 @@ int search_generic_u16(const uint16_t *hay, size_t n, const uint16_t *keys,
8989
```
9090
The `search_generic_u8()` and `search_generic_u16()` functions both return 1 immediately when a match is found in the inner loop.
9191
92-
### 2. SVE2 MATCH Implementation
92+
### 2. SVE2 MATCH implementation
9393
9494
Now create an implementation that uses SVE2 MATCH instructions to process multiple elements in parallel. Copy the code shown into the same file:
9595
@@ -143,7 +143,7 @@ The SVE MATCH implementation with the `search_sve2_match_u8()` and `search_sve2_
143143
- Processes data in vector-sized chunks with early termination when matches are found. Stops immediately when any element in the vector matches.
144144
- Falls back to scalar code for remainder elements
145145

146-
### 3. Optimized SVE2 MATCH Implementation
146+
### 3. Optimized SVE2 MATCH implementation
147147

148148
In this next SVE2 implementation you will add loop unrolling and prefetching to further improve performance. Copy the code shown into the same source file:
149149

@@ -249,9 +249,9 @@ The main highlights of this implementation are:
249249
- Leverages the svmatch_u8/u16 instruction to efficiently compare each element against multiple keys in a single operation
250250
- Aligns memory to 64-byte boundaries for better memory access performance
251251
252-
## Benchmarking Framework
252+
## Benchmarking framework
253253
254-
To compare the performance of the three implementations, you will use a benchmarking framework that measures the execution time of each implementation. You will also add helper functions for membership testing that are needed to setup the test data with controlled hit rates:
254+
To compare the performance of the three implementations, use a benchmarking framework that measures the execution time of each implementation. You will also add helper functions for membership testing that are needed to setup the test data with controlled hit rates:
255255
256256
```c
257257
// Timing function
@@ -423,7 +423,7 @@ You can now compile the different search implementations:
423423
gcc -O3 -march=armv9-a+sve2 -mcpu=neoverse-v2 sve2_match_demo.c -o sve2_match_demo
424424
```
425425

426-
Now run the benchmark on a dataset of 65,536 elements (2^16) with a 0.001% hit rate:
426+
Run the benchmark on a dataset of 65,536 elements (2^16) with a 0.001% hit rate:
427427

428428
```bash
429429
./sve2_match_demo $((1<<16)) 3 0.00001
@@ -455,7 +455,7 @@ You can experiment with different haystack lengths, iterations and hit probabili
455455
```
456456
## Performance Results
457457

458-
When running on a Graviton4 instance with Ubuntu 24.04 and a dataset of 65,536 elements (2^16), you will observe the following results for different hit probabilities:
458+
When running on a Graviton4 instance with Ubuntu 24.04 and a dataset of 65,536 elements (2^16), you will see different hit probabilities, as shown in the following results:
459459

460460
### Latency (ns per iteration) for Different Hit Rates (8-bit)
461461

0 commit comments

Comments
 (0)