Skip to content

Commit 0588363

Browse files
committed
simplify docs further
1 parent 42cff0b commit 0588363

File tree

1 file changed

+3
-3
lines changed
  • src/doc/rustc-dev-guide/src/offload

1 file changed

+3
-3
lines changed

src/doc/rustc-dev-guide/src/offload/usage.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@ pub extern "gpu-kernel" fn kernel_1(x: *mut [f64; 256]) {
6868
## Compile instructions
6969
It is important to use a clang compiler build on the same llvm as rustc. Just calling clang without the full path will likely use your system clang, which probably will be incompatible. So either substitute clang/lld invocations below with absolute path, or set your `PATH` accordingly.
7070

71-
First we generate the host (cpu) code. The first build is just to compile libc, take note of the hashed path. Then we call rustc directly to build our host code, while providing the libc artifact to rustc.
71+
First we generate the host (cpu) code.
7272
```
73-
cargo +offload build -r -v
74-
rustc +offload --edition 2024 src/lib.rs -g --crate-type cdylib -C opt-level=3 -C panic=abort -C lto=fat -L dependency=/absolute_path_to/target/release/deps --extern libc=/absolute_path_to/target/release/deps/liblibc-<HASH>.rlib --emit=llvm-bc,llvm-ir -Zoffload=Enable -Zunstable-options
73+
RUSTFLAGS=" --emit=llvm-bc,llvm-ir -Zoffload=Enable -Zunstable-options" cargo +offload build -r
7574
```
7675

7776
Now we generate the device code. Replace the target-cpu with the right code for your gpu.
@@ -99,6 +98,7 @@ The first element is zero 0.000000
9998
The first element is NOT zero 21.000000
10099
The second element is 0.000000
101100
```
101+
If this fails, check whether you've loaded the right drivers or runtime. E.g. for an AMD GPU, you want rocm (or more specific HSA) available.
102102

103103
To receive more information about the memory transfer, you can enable info printing with
104104
```

0 commit comments

Comments
 (0)