Skip to content

Commit

Permalink
Add Examples readme
Browse files Browse the repository at this point in the history
  • Loading branch information
denzp committed Jun 14, 2017
1 parent 5a9b91f commit 17cf6b4
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions examples/README.md
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"]
```

0 comments on commit 17cf6b4

Please sign in to comment.