-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 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,30 @@ | ||
# Examples | ||
|
||
To run the examples: | ||
``` | ||
xargo rustc --target nvptx64-nvidia-cuda --release | ||
``` | ||
|
||
## Deep Dependencies Example: `deep-deps-example` | ||
This example shows that the linker is actually "linking" :) | ||
|
||
The dependencies hierarchy is: | ||
``` | ||
example (is the CUDA kernel dylib crate) | ||
└─ dummy_math (rlib crate) | ||
└─ dummy_utils (rlib crate) | ||
``` | ||
|
||
Both `dummy_math` and `dummy_utils` exports a function and also a kernel. | ||
|
||
A PTX output at `target/nvptx64-nvidia-cuda/release/example.ptx` should contain no `.extern` function declaration and have 3 kernels. | ||
|
||
|
||
## Undefined Reference Example: `undefined-ref-example` | ||
This example shows that the linker can find unresoved external references and reject linking because the output won't be a valid PTX. | ||
|
||
When you try to run the example the linker should fail with error message: | ||
``` | ||
[ERROR] Unable to link modules | ||
[ERROR] caused by: Undefined references: ["bar"] | ||
``` |