You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a sample application which demonstrates how to cross-compile the application with Halide generated function for baremetal target system without OS.
4
+
5
+
This is a sample application which demonstrates how to cross-compile the
6
+
application with Halide generated function for baremetal target system without
7
+
OS.
4
8
5
9
## Setup
6
-
There are wide varieties of baremetal system and this application is created just for one of them. More specifically, it is tested with the following conditions.
7
-
- Compiled by [Arm GNU Toolchain](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads) (version 12.2) AArch32 bare-metal target (`arm-none-eabi`)
8
-
- Targeted for Arm 32 bit CPU with NEON (Cortex-A9) on Arm Realview boards on [QEMU Arm System emulator](https://www.qemu.org/docs/master/system/target-arm.html) (version 7.2.50)
9
-
- With "semihosting" mode, where some limited I/O communication is available between host and target (e.g. printf() to stdout)
10
10
11
-
Because we cannot rely on the abstraction of OS, you will probably need to modify some parts if you target for different setup.
11
+
There are wide varieties of baremetal system and this application is created
12
+
just for one of them. More specifically, it is tested with the following
13
+
conditions.
14
+
15
+
- Compiled by
16
+
[Arm GNU Toolchain](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads)
- Targeted for Arm 32 bit CPU with NEON (Cortex-A9) on Arm Realview boards on
19
+
[QEMU Arm System emulator](https://www.qemu.org/docs/master/system/target-arm.html)
20
+
(version 7.2.50)
21
+
- With "semihosting" mode, where some limited I/O communication is available
22
+
between host and target (e.g. printf() to stdout)
23
+
24
+
Because we cannot rely on the abstraction of OS, you will probably need to
25
+
modify some parts if you target for different setup.
12
26
13
27
## How to build
28
+
14
29
### Cross compilation
15
-
Halide cross-compiling in CMake is tricky and there are a couple of ways to realize it. This application demonstrates 3 different ways with concrete code, located in `CMakeLists.txt` in the following sub directories.
30
+
31
+
Halide cross-compiling in CMake is tricky and there are a couple of ways to
32
+
realize it. This application demonstrates 3 different ways with concrete code,
33
+
located in `CMakeLists.txt` in the following sub directories.
34
+
16
35
1. cmake-twice
17
-
1. cmake-super_build
18
-
1. cmake-external_project
36
+
2. cmake-super_build
37
+
3. cmake-external_project
19
38
20
-
If you want to understand the detail of build steps, please read "Cross compiling" section of [README_cmake](../../README_cmake.md#cross-compiling), and then `build.sh` and `CMakeLists.txt` in each sub directories.
39
+
If you want to understand the detail of build steps, please read "Cross
40
+
compiling" section of [README_cmake](../../README_cmake.md#cross-compiling), and
41
+
then `build.sh` and `CMakeLists.txt` in each sub directories.
21
42
22
43
### Build procedure
44
+
23
45
#### Baremetal target
24
-
As a prerequisite, toolchain described above needs to be installed in your host machine. The detail of the toolchanin configuration is set in [toolchain.arm-32-sample.cmake](cmake/toolchain.arm-32-sample.cmake), which you might need to modify depending on the target baremetal system.
25
-
Then, just run the build script in one of the aforementioned sub directories.
46
+
47
+
As a prerequisite, toolchain described above needs to be installed in your host
48
+
machine. The detail of the toolchanin configuration is set in
49
+
[toolchain.arm-32-sample.cmake](cmake/toolchain.arm-32-sample.cmake), which you
50
+
might need to modify depending on the target baremetal system. Then, just run
51
+
the build script in one of the aforementioned sub directories.
52
+
26
53
```
27
54
cd cmake-<xxx>/
28
55
./build.sh
29
56
```
30
57
31
58
#### Host target
32
-
This application can be built for host target as well by the simple steps shown below.
59
+
60
+
This application can be built for host target as well by the simple steps shown
Copy file name to clipboardExpand all lines: apps/HelloWasm/README.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,12 @@ To try it out,
8
8
9
9
- Run a local webserver using, e.g.: python3 -m http.server 8080 &
10
10
11
-
- Load Google chrome (at least version 84), go to chrome://flags, and turn on all the experimental webassembly stuff (e.g. threads, simd). If you don't do this, only the single-threaded scalar variant will work (at the time of writing).
11
+
- Load Google chrome (at least version 84), go to chrome://flags, and turn on
12
+
all the experimental webassembly stuff (e.g. threads, simd). If you don't do
13
+
this, only the single-threaded scalar variant will work (at the time of
14
+
writing).
12
15
13
16
- Visit http://127.0.0.1:8080/index.html
14
17
15
-
- Finally, run `make benchmark_native` and compare the performance you get with native code
18
+
- Finally, run `make benchmark_native` and compare the performance you get with
0 commit comments