Skip to content

Commit ea52c7b

Browse files
Enhance documentation for building and testing KleidiCV on macOS by clarifying steps and expected outputs
1 parent 0621336 commit ea52c7b

File tree

2 files changed

+43
-11
lines changed

2 files changed

+43
-11
lines changed

content/learning-paths/laptops-and-desktops/kleidicv-on-mac/build-1.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ You can use KleidiCV as a standalone image processing library or integrate it wi
1515

1616
## Set up your environment
1717

18-
To follow this example you'll need a MacBook Pro with an Apple Silicon M4 processor. To check your operating system version, select the **Apple menu ()** in the top-left corner of your screen and choose **About This Mac**. Alternatively, open a terminal and run:
18+
To follow this example you'll need a MacBook Pro with an Apple Silicon M4 processor.
19+
20+
To check your operating system version, follow these steps:
21+
22+
- Select the **Apple menu ()** in the top-left corner of your screen
23+
- Select **About This Mac**
24+
- Alternatively, open a terminal and run:
1925

2026
```console
2127
sw_vers
@@ -27,8 +33,9 @@ ProductName: macOS
2733
ProductVersion: 15.5
2834
BuildVersion: 24F74
2935
```
36+
### Install CMake
3037

31-
You also need CMake. If CMake is not already installed on your host machine, you can install it using Homebrew:
38+
If CMake is not already installed on your host machine, you can install it using Homebrew:
3239

3340
```bash
3441
brew install cmake
@@ -115,7 +122,7 @@ export WORKSPACE=$HOME/kleidi
115122

116123
To set up KleidiCV and OpenCV, first download the source code from GitLab.
117124

118-
In your $WORKSPACE directory, clone KleidiCV using the v0.6.0 release tag.
125+
In your $WORKSPACE directory, clone KleidiCV using the v0.6.0 release tag:
119126

120127
```bash
121128
cd $WORKSPACE
@@ -138,10 +145,11 @@ patch -p1 < ../kleidicv/adapters/opencv/opencv-4.12.patch
138145
patch -p1 < ../kleidicv/adapters/opencv/extra_benchmarks/opencv-4.12.patch
139146
```
140147

141-
142148
## Build options
143149

144-
KleidiCV provides several CMake options to control which instruction sets and features are enabled during the build. Here are the most important options for Arm systems:
150+
KleidiCV provides several CMake options to control which instruction sets and features are enabled during the build.
151+
152+
Here are the most important options for Arm systems:
145153

146154
- **KLEIDICV_ENABLE_SVE2**
147155
Enables Scalable Vector Extension 2 (SVE2) code paths. This is on by default for popular compilers that support SVE2, but off otherwise.
@@ -191,7 +199,7 @@ ls ./build-kleidicv-benchmark-SME/benchmark/kleidicv-benchmark
191199
```
192200
## Build the OpenCV with KleidiCV
193201

194-
The following command can be used to build OpenCV with KleidiCV:
202+
You can use the following command to build OpenCV with KleidiCV:
195203

196204
```bash
197205
cmake -S $WORKSPACE/opencv \

content/learning-paths/laptops-and-desktops/kleidicv-on-mac/run-test-2.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ The command for running the test is as follows:
8686
--gtest_repeat=3
8787
```
8888

89-
The output will appear as follows:
89+
The expected output is:
9090

9191
```output
9292
[ERROR:[email protected]] global persistence.cpp:566 open Can't open file: 'imgproc.xml' in read mode
@@ -428,8 +428,7 @@ kleidicv API:: kleidicv_remap_f32_u8_resolver,NEON backend.
428428
kleidicv API:: kleidicv_remap_f32_u16_resolver,NEON backend.
429429
kleidicv API:: kleidicv_warp_perspective_stripe_u8_resolver,NEON backend.
430430
```
431-
432-
The output is truncated, but you will see performance metrics for all operations at 1280x720 resolution.
431+
The output is truncated for brevity, but you will see detailed performance metrics for each operation at 1280x720 resolution. Look for lines showing the operation name, sample count, mean and median times, and standard deviation. These results help you compare the performance of different backends and confirm that SME or NEON acceleration is active.
433432

434433
## Use lldb to check the SME backend implementation
435434

@@ -452,10 +451,35 @@ lldb ./build-kleidicv-benchmark-SME/test/api/kleidicv-api-test
452451
```
453452

454453
The interactions with the `(lldb)` command line are shown below.
454+
Start by entering the following commands in the `lldb` debugger:
455+
456+
```console
457+
target create "./build-kleidicv-benchmark-SME/test/api/kleidicv-api-test"
458+
b saturating_add_abs_with_threshold
459+
run
460+
```
461+
462+
When the program stops at your breakpoint, enter:
463+
464+
```console
465+
bt
466+
```
455467

456-
Enter the `target` command followed by the `b` command for the breakpoint, and the `run` command. When the breakpoint is reached enter the `bt` command to see the stack trace followed by the `disassemble` command to display the assembly instructions in SME streaming mode. Use the `quit` command at the end to exit `lldb`.
468+
This command displays the stack trace, showing how the function was called.
469+
470+
Next, to view the assembly instructions (including SME streaming mode), enter:
471+
472+
```console
473+
disassemble --frame
474+
```
475+
476+
After you finish inspecting the output, exit `lldb` by typing:
477+
478+
```console
479+
quit
480+
```
457481

458-
Some of the paths will be different for you, but you can enter the commands and follow the output.
482+
Note: Your file paths may differ, but the sequence of commands remains the same. Enter each command as shown and review the output at each step.
459483

460484
```console
461485
target create "./build-kleidicv-benchmark-SME/test/api/kleidicv-api-test"

0 commit comments

Comments
 (0)