-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Followup review feedback on e2e codegen example
- Loading branch information
1 parent
1d706f6
commit 05d7bb9
Showing
3 changed files
with
74 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
## End-to-end code generation example | ||
|
||
This example demonstrates an end-to-end pipeline of code generation and execution that typically occurs in a JIT engine. | ||
It creates a simple function (adding +1 to an array and storing the result in a second one) via llvm API, | ||
converts it to spirv, and submits it to the runtime. | ||
|
||
## Running the example | ||
|
||
The following commands are executed from the project root directory. | ||
|
||
### Using conda environment | ||
|
||
``` | ||
$ conda env create -f third_party/deps.yml | ||
$ conda activate examples | ||
$ mkdir build && cd build | ||
# configure with: | ||
$ cmake .. -DUR_BUILD_ADAPTER_L0=ON -DUR_BUILD_EXAMPLE_CODEGEN=ON | ||
$ make | ||
$ ./bin/codegen | ||
``` | ||
|
||
### Without using conda | ||
|
||
To run the example with llvm 13, you will need to make sure that `llvm-13` and `libllvmspirvlib-13-dev` are installed. | ||
|
||
**NOTE**: The example could be working with other llvm versions but it was tested with version 13. | ||
|
||
``` | ||
$ mkdir build && cd build | ||
# configure with: | ||
$ cmake .. -DUR_BUILD_ADAPTER_L0=ON -DUR_BUILD_EXAMPLE_CODEGEN=ON -DLLVM_DIR=/usr/lib/llvm-13/cmake | ||
$ make | ||
$ ./bin/codegen | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.