Skip to content

Update to latest rust-gpu #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
635 changes: 399 additions & 236 deletions blog/2024-11-25-optimizing-matmul/code/Cargo.lock

Large diffs are not rendered by default.

15 changes: 4 additions & 11 deletions blog/2024-11-25-optimizing-matmul/code/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ members = [
]
resolver = "2"

[workspace.lints.rust]
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(target_arch, values("spirv"))'] }

[workspace.dependencies]
spirv-std = { git = "https://github.com/rust-gpu/rust-gpu", rev = "0da80f8a61867590a0824873fa45dc8983e49da8" }
spirv-std = { git = "https://github.com/rust-gpu/rust-gpu", rev = "05042d1713012862be103e85bfd2c15dfeccda7b" }
futures = "0.3"
glam = { version = "0.29.2", features = ["cuda", "bytemuck"] }
tracing = "0.1.40"
Expand All @@ -57,13 +60,3 @@ incremental = true
# will treat the identical settings in `[profile.release.build-override]` below
# as different sets of `rustc` flags and will not reuse artifacts between them.
codegen-units = 256

# Compile build-dependencies in release mode with the same settings as regular
# dependencies (including the incremental enabled above).
#
# We need this to templorarily work around
# https://github.com/Rust-GPU/rust-gpu/issues/29.
[profile.release.build-override]
opt-level = 3
incremental = true
codegen-units = 256
5 changes: 1 addition & 4 deletions blog/2024-11-25-optimizing-matmul/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ The Rust code that accompanies the blog post.

You will find:

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

**Any changes to these files should ensure that the blog post is still correct as it
uses line numbers to embed code snippets.**

Note: Everything needs to be run with `--release` to work around
https://github.com/Rust-GPU/rust-gpu/issues/29.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ edition = "2021"
crate-type = ["lib", "cdylib"]

[build-dependencies]
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "0da80f8a61867590a0824873fa45dc8983e49da8" }
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "05042d1713012862be103e85bfd2c15dfeccda7b" }
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ edition = "2021"
crate-type = ["lib", "cdylib"]

[build-dependencies]
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "0da80f8a61867590a0824873fa45dc8983e49da8" }
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "05042d1713012862be103e85bfd2c15dfeccda7b" }
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ edition = "2021"
crate-type = ["lib", "cdylib"]

[build-dependencies]
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "0da80f8a61867590a0824873fa45dc8983e49da8" }
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "05042d1713012862be103e85bfd2c15dfeccda7b" }
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ edition = "2021"
crate-type = ["lib", "cdylib"]

[build-dependencies]
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "0da80f8a61867590a0824873fa45dc8983e49da8" }
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "05042d1713012862be103e85bfd2c15dfeccda7b" }
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ edition = "2021"
crate-type = ["lib", "cdylib"]

[build-dependencies]
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "0da80f8a61867590a0824873fa45dc8983e49da8" }
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "05042d1713012862be103e85bfd2c15dfeccda7b" }
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ edition = "2021"
crate-type = ["lib", "cdylib"]

[build-dependencies]
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "0da80f8a61867590a0824873fa45dc8983e49da8" }
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "05042d1713012862be103e85bfd2c15dfeccda7b" }
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ edition = "2021"
crate-type = ["lib", "cdylib"]

[build-dependencies]
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "0da80f8a61867590a0824873fa45dc8983e49da8" }
spirv-builder = { git = "https://github.com/rust-gpu/rust-gpu", rev = "05042d1713012862be103e85bfd2c15dfeccda7b" }
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ edition = "2021"
[lib]
crate-type = ["dylib", "lib"]

[lints]
workspace = true

[dependencies]
settings = { path = "../../shared/settings"}
spirv-std.workspace = true
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ edition = "2021"
[lib]
crate-type = ["dylib", "lib"]

[lints]
workspace = true

[dependencies]
settings = { path = "../../shared/settings"}
spirv-std.workspace = true
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ edition = "2021"
[lib]
crate-type = ["dylib", "lib"]

[lints]
workspace = true

[dependencies]
settings = { path = "../../shared/settings"}
spirv-std.workspace = true
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ edition = "2021"
[lib]
crate-type = ["dylib", "lib"]

[lints]
workspace = true

[dependencies]
settings = { path = "../../shared/settings" }
spirv-std.workspace = true
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ edition = "2021"
[lib]
crate-type = ["dylib", "lib"]

[lints]
workspace = true


[dependencies]
settings = { path = "../../shared/settings" }
spirv-std.workspace = true
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ edition = "2021"
[lib]
crate-type = ["dylib", "lib"]

[lints]
workspace = true

[dependencies]
settings = { path = "../../shared/settings" }
spirv-std.workspace = true
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ edition = "2021"
[lib]
crate-type = ["dylib", "lib"]

[lints]
workspace = true

# Dependencies when run on either the CPU or GPU
[dependencies]
settings = { path = "../../shared/settings" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ edition = "2021"
[dependencies]
bytemuck = { version = "1.9", features = ["derive"] }

[lints]
workspace = true

# Conditionally include `glam` only when not on the `spirv` target.
[target.'cfg(not(target_arch = "spirv"))'.dependencies]
glam = { workspace = true }
2 changes: 1 addition & 1 deletion blog/2024-11-25-optimizing-matmul/code/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2024-04-24"
channel = "nightly-2024-11-22"
components = ["rust-src", "rustc-dev", "llvm-tools"]
Loading