Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
13a26ad
Merge ref '5a30e4307f05' from rust-lang/rust
Kobzol Jul 23, 2025
3925725
Merge pull request #1883 from Kobzol/pull
folkertdev Jul 23, 2025
5eacd7d
Merge pull request #1879 from heiher/loong-simd-unified-types
folkertdev Jul 25, 2025
abb1867
Merge pull request #1863 from folkertdev/combine-rust-files
sayantn Jul 25, 2025
fc449f9
Merge ref '32e7a4b92b10' from rust-lang/rust
invalid-email-address Jul 31, 2025
27b7c0e
Merge pull request #1889 from rust-lang/rustc-pull
folkertdev Aug 3, 2025
ba7cd70
Merge pull request #1895 from madhav-madhusoodanan/intrinsic-test-int…
folkertdev Aug 5, 2025
cf51509
Merge ref '73e6c9ebd912' from rust-lang/rust
Kobzol Nov 2, 2025
ef2667f
Merge pull request #1950 from Kobzol/pull-nov-2025
folkertdev Nov 2, 2025
ca257f2
Merge pull request #1948 from folkertdev/forward-percentage
Amanieu Nov 4, 2025
5a03e8f
Merge pull request #1846 from sayantn/new-amx-intrinsics
Amanieu Nov 4, 2025
4abe091
Merge ref '8401398e1f14' from rust-lang/rust
invalid-email-address Nov 10, 2025
f6db2dc
Merge pull request #1954 from rust-lang/rustc-pull
sayantn Nov 10, 2025
76e0269
Merge pull request #1953 from sayantn/masked-load-store
folkertdev Nov 12, 2025
7adb635
Merge ref '69d4d5fc0e4d' from rust-lang/rust
Nov 17, 2025
0b32773
Merge pull request #4699 from rust-lang/rustup-2025-11-17
RalfJung Nov 17, 2025
eceb654
Merge pull request #4697 from michaliskok/genmc-llvm-dep
RalfJung Nov 17, 2025
088fd31
Merge pull request #4630 from royAmmerschuber/pull-request/wildcard-p…
RalfJung Nov 17, 2025
52b2a93
Auto merge of #148763 - yotamofek:use-yarn, r=Kobzol
bors Nov 17, 2025
2adc6ba
Auto merge of #149022 - RalfJung:miri, r=RalfJung
bors Nov 17, 2025
eae636f
Auto merge of #149118 - folkertdev:stdarch-sync-2025-11-19, r=tgross35
bors Nov 20, 2025
299a15f
Rollup merge of #146925 - DiuDiu777:va-doc-fix, r=tgross35
matthiaskrgr Nov 20, 2025
014e836
Rollup merge of #147035 - joboet:extract_if_debug, r=tgross35
matthiaskrgr Nov 20, 2025
0bd23ee
Rollup merge of #147173 - androm3da:bcain/hexagon_qurt, r=davidtwco,t…
matthiaskrgr Nov 20, 2025
5fa665f
Rollup merge of #148261 - aDotInTheVoid:no-sync-for-smir, r=celinval
matthiaskrgr Nov 20, 2025
b15f955
Rollup merge of #149095 - tshepang:rdg-sync, r=tshepang
matthiaskrgr Nov 20, 2025
2b5b02c
Rollup merge of #149108 - daltenty:daltenty/add-maintainer, r=Noratrieb
matthiaskrgr Nov 20, 2025
b9eb517
Auto merge of #149132 - matthiaskrgr:rollup-8khp9s2, r=matthiaskrgr
bors Nov 20, 2025
e10f3ad
Auto merge of #149109 - scottmcm:align-always-alignment, r=tgross35
bors Nov 20, 2025
393eb8d
Auto merge of #148831 - clubby789:cargo-update-11-11-25, r=jieyouxu
bors Nov 22, 2025
4c7c89d
Auto merge of #149044 - clubby789:implicit-return-span, r=cjgillot
bors Nov 22, 2025
cb612bd
Auto merge of #147536 - mati865:gnullvm-self-contained, r=petrochenkov
bors Nov 22, 2025
75c5284
Auto merge of #149096 - chenyukang:yukang-fix-unused-vars-148373, r=o…
bors Nov 23, 2025
dbdf31d
Auto merge of #148882 - 20jasper:patch-1, r=nnethercote,Kivooeo
bors Nov 23, 2025
9c03bbb
update dev guide
ZuseZ4 Nov 21, 2025
a708070
Auto merge of #149170 - ZuseZ4:automate-offload-packager, r=oli-obk
bors Nov 23, 2025
20025f6
Auto merge of #147804 - tmiasko:move-copy, r=cjgillot,saethlin
bors Nov 23, 2025
12f42d8
Auto merge of #147827 - saethlin:maybeuninit-codegen2, r=scottmcm
bors Nov 23, 2025
de08591
Auto merge of #148925 - madsmtm:jemalloc-perf, r=Kobzol
bors Nov 23, 2025
85fb942
Prepare for merging from rust-lang/rust
invalid-email-address Nov 24, 2025
3feef33
Merge ref 'd3e1ccdf40ae' from rust-lang/rust
invalid-email-address Nov 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cc328c12382f05d8ddf6ffc8139deb7985270ad8
d3e1ccdf40ae7b7a6dc81edc073d80dad7b66f75
14 changes: 2 additions & 12 deletions src/offload/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,27 +79,17 @@ Now we generate the device code. Replace the target-cpu with the right code for
RUSTFLAGS="-Ctarget-cpu=gfx90a --emit=llvm-bc,llvm-ir -Zoffload=Enable -Zunstable-options" cargo +offload build -Zunstable-options -r -v --target amdgcn-amd-amdhsa -Zbuild-std=core
```

Now find the `<libname>.ll` under target/amdgcn-amd-amdhsa folder and copy it to a device.ll file (or adjust the file names below).
If you work on an NVIDIA or Intel gpu, please adjust the names acordingly and open an issue to share your results (either if you succeed or fail).
First we compile our .ll files (good for manual inspections) to .bc files and clean up leftover artifacts. The cleanup is important, otherwise caching might interfere on following runs.
```
opt lib.ll -o lib.bc
opt device.ll -o device.bc
rm *.o
rm bare.amdgcn.gfx90a.img*
```

```
"clang-offload-packager" "-o" "host.out" "--image=file=device.bc,triple=amdgcn-amd-amdhsa,arch=gfx90a,kind=openmp"
"clang-21" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-S" "-save-temps=cwd" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "lib.rs" "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie" "-mframe-pointer=all" "-fmath-errno" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-funwind-tables=2" "-target-cpu" "x86-64" "-tune-cpu" "generic" "-resource-dir" "/<ABSOLUTE_PATH_TO>/rust/build/x86_64-unknown-linux-gnu/llvm/lib/clang/21" "-ferror-limit" "19" "-fopenmp" "-fopenmp-offload-mandatory" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-fembed-offload-object=host.out" "-fopenmp-targets=amdgcn-amd-amdhsa" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o" "host.s" "-x" "ir" "lib.bc"
"clang-21" "-cc1as" "-triple" "x86_64-unknown-linux-gnu" "-filetype" "obj" "-main-file-name" "lib.rs" "-target-cpu" "x86-64" "-mrelocation-model" "pic" "-o" "host.o" "host.s"
"clang-linker-wrapper" "--should-extract=gfx90a" "--device-compiler=amdgcn-amd-amdhsa=-g" "--device-compiler=amdgcn-amd-amdhsa=-save-temps=cwd" "--device-linker=amdgcn-amd-amdhsa=-lompdevice" "--host-triple=x86_64-unknown-linux-gnu" "--save-temps" "--linker-path=/ABSOlUTE_PATH_TO/rust/build/x86_64-unknown-linux-gnu/lld/bin/ld.lld" "--hash-style=gnu" "--eh-frame-hdr" "-m" "elf_x86_64" "-pie" "-dynamic-linker" "/lib64/ld-linux-x86-64.so.2" "-o" "bare" "/lib/../lib64/Scrt1.o" "/lib/../lib64/crti.o" "/ABSOLUTE_PATH_TO/crtbeginS.o" "-L/ABSOLUTE_PATH_TO/rust/build/x86_64-unknown-linux-gnu/llvm/bin/../lib/x86_64-unknown-linux-gnu" "-L/ABSOLUTE_PATH_TO/rust/build/x86_64-unknown-linux-gnu/llvm/lib/clang/21/lib/x86_64-unknown-linux-gnu" "-L/lib/../lib64" "-L/usr/lib64" "-L/lib" "-L/usr/lib" "host.o" "-lstdc++" "-lm" "-lomp" "-lomptarget" "-L/ABSOLUTE_PATH_TO/rust/build/x86_64-unknown-linux-gnu/llvm/lib" "-lgcc_s" "-lgcc" "-lpthread" "-lc" "-lgcc_s" "-lgcc" "/ABSOLUTE_PATH_TO/crtendS.o" "/lib/../lib64/crtn.o"
```

Especially for the last command I recommend to not fix the paths, but rather just re-generate them by copying a bare-mode openmp example and compiling it with your clang. By adding `-###` to your clang invocation, you can see the invidual steps.
Especially for the last three commands I recommend to not fix the paths, but rather just re-generate them by copying a bare-mode openmp example and compiling it with your clang. By adding `-###` to your clang invocation, you can see the invidual steps.
You can ignore other steps, e.g. the invocation of a "clang-offload-packager".
```
myclang++ -fuse-ld=lld -O3 -fopenmp -fopenmp-offload-mandatory --offload-arch=gfx90a omp_bare.cpp -o main -###
```
Expand Down
Loading