Skip to content

Commit 035474a

Browse files
authored
Update to latest rust-gpu (#75)
We can get rid of some hacks.
1 parent d55be39 commit 035474a

File tree

19 files changed

+437
-259
lines changed

19 files changed

+437
-259
lines changed

blog/2024-11-25-optimizing-matmul/code/Cargo.lock

+399-236
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

blog/2024-11-25-optimizing-matmul/code/Cargo.toml

+4-11
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ members = [
4343
]
4444
resolver = "2"
4545

46+
[workspace.lints.rust]
47+
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(target_arch, values("spirv"))'] }
48+
4649
[workspace.dependencies]
47-
spirv-std = { git = "https://github.com/rust-gpu/rust-gpu", rev = "0da80f8a61867590a0824873fa45dc8983e49da8" }
50+
spirv-std = { git = "https://github.com/rust-gpu/rust-gpu", rev = "05042d1713012862be103e85bfd2c15dfeccda7b" }
4851
futures = "0.3"
4952
glam = { version = "0.29.2", features = ["cuda", "bytemuck"] }
5053
tracing = "0.1.40"
@@ -57,13 +60,3 @@ incremental = true
5760
# will treat the identical settings in `[profile.release.build-override]` below
5861
# as different sets of `rustc` flags and will not reuse artifacts between them.
5962
codegen-units = 256
60-
61-
# Compile build-dependencies in release mode with the same settings as regular
62-
# dependencies (including the incremental enabled above).
63-
#
64-
# We need this to templorarily work around
65-
# https://github.com/Rust-GPU/rust-gpu/issues/29.
66-
[profile.release.build-override]
67-
opt-level = 3
68-
incremental = true
69-
codegen-units = 256

blog/2024-11-25-optimizing-matmul/code/README.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ The Rust code that accompanies the blog post.
22

33
You will find:
44

5-
1. A binary (`blog`) that you can run with `cargo run`
5+
1. A binary (`blog`) that you can run with `cargo run`. Use `RUST_LOG=blog=info cargo run --release` to see output while running.
66
2. Benchmarks that you can run with `cargo bench`
77
3. GPU shaders/kernels written in Rust
88
4. CPU code that takes the shaders and runs it on the GPU (via `wgpu`) or the CPU with a
@@ -14,6 +14,3 @@ directory.
1414

1515
**Any changes to these files should ensure that the blog post is still correct as it
1616
uses line numbers to embed code snippets.**
17-
18-
Note: Everything needs to be run with `--release` to work around
19-
https://github.com/Rust-GPU/rust-gpu/issues/29.

blog/2024-11-25-optimizing-matmul/code/crates/cpu/compiled_for_gpu/isomorphic/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ edition = "2021"
77
crate-type = ["lib", "cdylib"]
88

99
[build-dependencies]
10-
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "0da80f8a61867590a0824873fa45dc8983e49da8" }
10+
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "05042d1713012862be103e85bfd2c15dfeccda7b" }

blog/2024-11-25-optimizing-matmul/code/crates/cpu/compiled_for_gpu/naive/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ edition = "2021"
77
crate-type = ["lib", "cdylib"]
88

99
[build-dependencies]
10-
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "0da80f8a61867590a0824873fa45dc8983e49da8" }
10+
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "05042d1713012862be103e85bfd2c15dfeccda7b" }

blog/2024-11-25-optimizing-matmul/code/crates/cpu/compiled_for_gpu/tiling_1d/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ edition = "2021"
77
crate-type = ["lib", "cdylib"]
88

99
[build-dependencies]
10-
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "0da80f8a61867590a0824873fa45dc8983e49da8" }
10+
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "05042d1713012862be103e85bfd2c15dfeccda7b" }

blog/2024-11-25-optimizing-matmul/code/crates/cpu/compiled_for_gpu/tiling_1d_loop/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ edition = "2021"
77
crate-type = ["lib", "cdylib"]
88

99
[build-dependencies]
10-
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "0da80f8a61867590a0824873fa45dc8983e49da8" }
10+
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "05042d1713012862be103e85bfd2c15dfeccda7b" }

blog/2024-11-25-optimizing-matmul/code/crates/cpu/compiled_for_gpu/tiling_2d/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ edition = "2021"
77
crate-type = ["lib", "cdylib"]
88

99
[build-dependencies]
10-
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "0da80f8a61867590a0824873fa45dc8983e49da8" }
10+
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "05042d1713012862be103e85bfd2c15dfeccda7b" }

blog/2024-11-25-optimizing-matmul/code/crates/cpu/compiled_for_gpu/workgroup_256/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ edition = "2021"
77
crate-type = ["lib", "cdylib"]
88

99
[build-dependencies]
10-
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "0da80f8a61867590a0824873fa45dc8983e49da8" }
10+
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "05042d1713012862be103e85bfd2c15dfeccda7b" }

blog/2024-11-25-optimizing-matmul/code/crates/cpu/compiled_for_gpu/workgroup_2d/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ edition = "2021"
77
crate-type = ["lib", "cdylib"]
88

99
[build-dependencies]
10-
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "0da80f8a61867590a0824873fa45dc8983e49da8" }
10+
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "05042d1713012862be103e85bfd2c15dfeccda7b" }

blog/2024-11-25-optimizing-matmul/code/crates/gpu/naive/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ edition = "2021"
66
[lib]
77
crate-type = ["dylib", "lib"]
88

9+
[lints]
10+
workspace = true
11+
912
[dependencies]
1013
settings = { path = "../../shared/settings"}
1114
spirv-std.workspace = true

blog/2024-11-25-optimizing-matmul/code/crates/gpu/tiling_1d/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ edition = "2021"
66
[lib]
77
crate-type = ["dylib", "lib"]
88

9+
[lints]
10+
workspace = true
11+
912
[dependencies]
1013
settings = { path = "../../shared/settings"}
1114
spirv-std.workspace = true

blog/2024-11-25-optimizing-matmul/code/crates/gpu/tiling_1d_loop/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ edition = "2021"
66
[lib]
77
crate-type = ["dylib", "lib"]
88

9+
[lints]
10+
workspace = true
11+
912
[dependencies]
1013
settings = { path = "../../shared/settings"}
1114
spirv-std.workspace = true

blog/2024-11-25-optimizing-matmul/code/crates/gpu/tiling_2d/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ edition = "2021"
66
[lib]
77
crate-type = ["dylib", "lib"]
88

9+
[lints]
10+
workspace = true
11+
912
[dependencies]
1013
settings = { path = "../../shared/settings" }
1114
spirv-std.workspace = true

blog/2024-11-25-optimizing-matmul/code/crates/gpu/workgroup_256/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ edition = "2021"
66
[lib]
77
crate-type = ["dylib", "lib"]
88

9+
[lints]
10+
workspace = true
11+
12+
913
[dependencies]
1014
settings = { path = "../../shared/settings" }
1115
spirv-std.workspace = true

blog/2024-11-25-optimizing-matmul/code/crates/gpu/workgroup_2d/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ edition = "2021"
66
[lib]
77
crate-type = ["dylib", "lib"]
88

9+
[lints]
10+
workspace = true
11+
912
[dependencies]
1013
settings = { path = "../../shared/settings" }
1114
spirv-std.workspace = true

blog/2024-11-25-optimizing-matmul/code/crates/shared/isomorphic/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ edition = "2021"
66
[lib]
77
crate-type = ["dylib", "lib"]
88

9+
[lints]
10+
workspace = true
11+
912
# Dependencies when run on either the CPU or GPU
1013
[dependencies]
1114
settings = { path = "../../shared/settings" }

blog/2024-11-25-optimizing-matmul/code/crates/shared/settings/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ edition = "2021"
66
[dependencies]
77
bytemuck = { version = "1.9", features = ["derive"] }
88

9+
[lints]
10+
workspace = true
11+
912
# Conditionally include `glam` only when not on the `spirv` target.
1013
[target.'cfg(not(target_arch = "spirv"))'.dependencies]
1114
glam = { workspace = true }
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2024-04-24"
2+
channel = "nightly-2024-11-22"
33
components = ["rust-src", "rustc-dev", "llvm-tools"]

0 commit comments

Comments
 (0)