Skip to content

Commit a9d1615

Browse files
committed
Fix typos and add formatting section
1 parent d29a7ae commit a9d1615

File tree

1 file changed

+14
-6
lines changed
  • blog/2024-11-21-optimizing-matrix-mul

1 file changed

+14
-6
lines changed

blog/2024-11-21-optimizing-matrix-mul/index.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,14 +312,14 @@ and you can run the benchmarks yourself with `cargo bench`.
312312

313313
You can also check out real-world projects using Rust GPU such as
314314
[`autograph`](https://github.com/charles-r-earp/autograph) and
315-
[`rederling`](https://renderling.xyz/).
315+
[`renderling`](https://renderling.xyz/).
316316

317317
:::
318318

319319
## Reflections on porting to Rust GPU
320320

321321
Porting to Rust GPU went quickly, as the kernels Zach used were fairly simple. Most of
322-
the time was spent with concerns that were not specifically about writing GPU code. For
322+
my time was spent with concerns that were not specifically about writing GPU code. For
323323
example, deciding how much to abstract vs how much to make the code easy to follow, if
324324
everything should be available at runtime or if each kernel should be a compilation
325325
target, etc. [The
@@ -460,15 +460,23 @@ other Rust project.
460460

461461
This required no new tools or workflows. The tools I already knew worked seamlessly.
462462
More importantly, this approach benefits anyone working on the project. Any Rust
463-
engineer can run these benchmarks with no additional setup—cargo bench` is a standard
463+
engineer can run these benchmarks with no additional setup—`cargo bench` is a standard
464464
part of the Rust ecosystem.
465465

466+
### Formatting
467+
468+
Rust GPU code is formatted with `rustfmt`, following the same standards as all Rust
469+
code. This not only ensured my GPU code looked identical to my CPU code, it made my GPU
470+
code consistent with the _entire Rust ecosystem_. Leveraging standard tools like
471+
`rustfmt` minimizes cognitive overhead and avoids the hassle of configuring third-party
472+
formatters of varying quality.
473+
466474
### Lint
467475

468476
Linting GPU code in Rust works the same way as for CPU code. Running `cargo clippy`
469-
highlighted issues and enforced consistent code quality. Any custom lint configurations
470-
are also applied to Rust GPU kernels. Lints ensure that GPU code is held to the same
471-
high standards as the rest of the project.
477+
highlighted issues and enforced consistent code quality. Though I didn't have any,
478+
custom lint configurations are applied to Rust GPU kernels as well. Lints ensure that
479+
GPU code is held to the same high standards as the rest of the project.
472480

473481
### Documentation
474482

0 commit comments

Comments
 (0)