-
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 45f3701
Showing
3 changed files
with
68 additions
and
1 deletion.
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,31 @@ | ||
## 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 | ||
|
||
### Using conda envrionment | ||
|
||
``` | ||
$ conda env create -f third_party/deps.yml | ||
$ conda activate examples | ||
# configure with: | ||
$ cmake .. -DUR_BUILD_ADAPTER_L0=ON -DUR_BUILD_EXAMPLE_CODEGEN=ON | ||
$ make | ||
$ UR_ADAPTERS_FORCE_LOAD=./lib/libur_adapter_level_zero.so ./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. | ||
|
||
``` | ||
# configure with: | ||
$ cmake .. -DUR_BUILD_ADAPTER_L0=ON -DUR_BUILD_EXAMPLE_CODEGEN=ON -DLLVM_DIR=/usr/lib/llvm-13/cmake | ||
$ make | ||
$ UR_ADAPTERS_FORCE_LOAD=./lib/libur_adapter_level_zero.so ./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.