Skip to content

Commit dab15bd

Browse files
committed
Use sentence case for headings.
Currently headings are a mix of sentence case ("The quick brown fox") and title case ("The Quick Brown Fox"). Title case is extremely formal, so sentence case feels more natural here.
1 parent 08438c7 commit dab15bd

File tree

14 files changed

+70
-68
lines changed

14 files changed

+70
-68
lines changed

guide/src/cuda/gpu_computing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# GPU Computing
1+
# GPU computing
22

33
You probably already know what GPU computing is, but if you don't, it is utilizing the extremely parallel
44
nature of GPUs for purposes other than rendering. It is widely used in many scientific and consumer fields.

guide/src/cuda/pipeline.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# The CUDA Pipeline
1+
# The CUDA pipeline
22

33
CUDA is traditionally used via CUDA C/C++ files which have a `.cu` extension. These files can be
44
compiled using NVCC (NVIDIA CUDA Compiler) into an executable.

guide/src/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Frequently Asked Questions
1+
# Frequently asked questions
22

33
This page will cover a lot of the questions people often have when they encounter this project,
44
so they are addressed all at once.

guide/src/features.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Supported Features
1+
# Supported features
22

33
This page is used for tracking Cargo/Rust and CUDA features that are currently supported
44
or planned to be supported in the future. As well as tracking some information about how they could
@@ -14,7 +14,7 @@ around to adding it yet.
1414
| ✔️ | Fully Supported |
1515
| 🟨 | Partially Supported |
1616

17-
# Rust Features
17+
# Rust features
1818

1919
| Feature Name | Support Level | Notes |
2020
| ------------ | ------------- | ----- |
@@ -40,7 +40,7 @@ around to adding it yet.
4040
| Float Ops | ✔️ | Maps to libdevice intrinsics, calls to libm are not intercepted though, which we may want to do in the future |
4141
| Atomics ||
4242

43-
# CUDA Libraries
43+
# CUDA libraries
4444

4545
| Library Name | Support Level | Notes |
4646
| ------------ | ------------- | ----- |
@@ -56,7 +56,7 @@ around to adding it yet.
5656
| cuTENSOR ||
5757
| OptiX | 🟨 | CPU OptiX is mostly complete, GPU OptiX is still heavily in-progress because it needs support from the codegen backend |
5858

59-
# GPU-side Features
59+
# GPU-side features
6060

6161
Note: Most of these categories are used __very__ rarely in CUDA code, therefore
6262
do not be alarmed that it seems like many things are not supported. We just focus

guide/src/guide/compute_capabilities.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Compute Capability Gating
1+
# Compute capability gating
22

33
This section covers how to write code that adapts to different CUDA compute capabilities
44
using conditional compilation.
55

6-
## What are Compute Capabilities?
6+
## What are compute capabilities?
77

88
CUDA GPUs have different "compute capabilities" that determine which features they
99
support. Each capability is identified by a version number like `3.5`, `5.0`, `6.1`,
@@ -17,7 +17,7 @@ For example:
1717

1818
For comprehensive details, see [NVIDIA's CUDA documentation on GPU architectures](https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/#gpu-compilation).
1919

20-
## Virtual vs Real Architectures
20+
## Virtual vs real Architectures
2121

2222
In CUDA terminology:
2323

@@ -28,7 +28,7 @@ In CUDA terminology:
2828
Rust CUDA works exclusively with virtual architectures since it only generates PTX. The
2929
`NvvmArch::ComputeXX` enum values correspond to CUDA's virtual architectures.
3030

31-
## Using Target Features
31+
## Using target features
3232

3333
When building your kernel, the `NvvmArch::ComputeXX` variant you choose enables specific
3434
`target_feature` flags. These can be used with `#[cfg(...)]` to conditionally compile
@@ -51,12 +51,12 @@ which `NvvmArch::ComputeXX` is used to build the kernel, there is a different an
5151
These features let you write optimized code paths for specific GPU generations while
5252
still supporting older ones.
5353

54-
## Specifying Compute Capabilites
54+
## Specifying compute capabilites
5555

5656
Starting with CUDA 12.9, NVIDIA introduced architecture suffixes that affect
5757
compatibility.
5858

59-
### Base Architecture (No Suffix)
59+
### Base architecture (no suffix)
6060

6161
Example: `NvvmArch::Compute70`
6262

@@ -79,7 +79,7 @@ CudaBuilder::new("kernels")
7979
#[cfg(target_feature = "compute_80")] // ✗ Fail (newer compute capability)
8080
```
8181

82-
### Family Suffix ('f')
82+
### Family suffix ('f')
8383

8484
Example: `NvvmArch::Compute101f`
8585

@@ -108,7 +108,7 @@ CudaBuilder::new("kernels")
108108
#[cfg(target_feature = "compute_110")] // ✗ Fail (different major)
109109
```
110110

111-
### Architecture Suffix ('a')
111+
### Architecture suffix ('a')
112112

113113
Example: `NvvmArch::Compute100a`
114114

@@ -142,7 +142,7 @@ Note: While the 'a' variant enables all these features during compilation (allow
142142

143143
For more details on suffixes, see [NVIDIA's blog post on family-specific architecture features](https://developer.nvidia.com/blog/nvidia-blackwell-and-nvidia-cuda-12-9-introduce-family-specific-architecture-features/).
144144

145-
### Manual Compilation (Without cuda_builder)
145+
### Manual compilation (without cuda_builder)
146146

147147
If you're invoking rustc directly instead of using cuda_builder, you only need to specify the architecture through LLVM args:
148148

@@ -162,11 +162,11 @@ cargo build --target nvptx64-nvidia-cuda
162162

163163
The codegen backend automatically synthesizes target features based on the architecture type as described above.
164164

165-
### Common Patterns for Base Architectures
165+
### Common patterns for base architectures
166166

167167
These patterns work when using base architectures (no suffix), which enable all lower capabilities:
168168

169-
#### At Least a Capability (Default)
169+
#### At least a capability (default)
170170

171171
```rust,no_run
172172
// Code that requires compute 6.0 or higher
@@ -176,7 +176,7 @@ These patterns work when using base architectures (no suffix), which enable all
176176
}
177177
```
178178

179-
#### Exactly One Capability
179+
#### Exactly one capability
180180

181181
```rust,no_run
182182
// Code that targets exactly compute 6.1 (not 6.2+)
@@ -186,7 +186,7 @@ These patterns work when using base architectures (no suffix), which enable all
186186
}
187187
```
188188

189-
#### Up To a Maximum Capability
189+
#### Up to a maximum capability
190190

191191
```rust,no_run
192192
// Code that works up to compute 6.0 (not 6.1+)
@@ -196,7 +196,7 @@ These patterns work when using base architectures (no suffix), which enable all
196196
}
197197
```
198198

199-
#### Targeting Specific Architecture Ranges
199+
#### Targeting specific architecture ranges
200200

201201
```rust,no_run
202202
// This block compiles when building for architectures >= 6.0 but < 8.0
@@ -206,7 +206,7 @@ These patterns work when using base architectures (no suffix), which enable all
206206
}
207207
```
208208

209-
## Debugging Capability Issues
209+
## Debugging capability issues
210210

211211
If you encounter errors about missing functions or features:
212212

@@ -215,7 +215,7 @@ If you encounter errors about missing functions or features:
215215
3. Use `nvidia-smi` to check your GPU's compute capability
216216
4. Add appropriate `#[cfg]` guards or increase the target architecture
217217

218-
## Runtime Behavior
218+
## Runtime behavior
219219

220220
Again, Rust CUDA **only generates PTX**, not pre-compiled GPU binaries
221221
("[fatbinaries](https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/#fatbinaries)").

guide/src/guide/getting_started.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Getting Started
1+
# Getting started
22

33
This section covers how to get started writing GPU crates with cuda_std and cuda_builder.
44

5-
## Required Libraries
5+
## Required libraries
66

77
Before you can use the project to write GPU crates, you will need a couple of prerequisites:
88

@@ -60,7 +60,7 @@ We changed our crate's crate types to `cdylib` and `rlib`. We specified `cdylib`
6060

6161
## `lib.rs`
6262

63-
Before we can write any GPU kernels, we must add a few directives to our `lib.rs` which are required by the codegen:
63+
Before we can write any GPU kernels, we must add a few directives to our `lib.rs` which are required by the codegen backend:
6464

6565
```rs
6666
#![cfg_attr(
@@ -76,7 +76,7 @@ This does a couple of things:
7676

7777
- It only applies the attributes if we are compiling the crate for the GPU (target_os = "cuda").
7878
- It declares the crate to be `no_std` on CUDA targets.
79-
- It registers a special attribute required by the codegen for things like figuring out
79+
- It registers a special attribute required by the codegen backend for things like figuring out
8080
what functions are GPU kernels.
8181
- It explicitly includes `kernel` macro and `thread`
8282

@@ -156,7 +156,7 @@ Internally what this does is it first checks that a couple of things are right i
156156
- The function is `unsafe`.
157157
- The function does not return anything.
158158

159-
Then it declares this kernel to the codegen so that the codegen can tell CUDA this is a GPU kernel.
159+
Then it declares this kernel to the codegen backend so it can tell CUDA this is a GPU kernel.
160160
It also applies `#[no_mangle]` so the name of the kernel is the same as it is declared in the code.
161161

162162
## Building the GPU crate

guide/src/guide/kernel_abi.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Kernel ABI
22

3-
This section details how parameters are passed to GPU kernels by the Codegen at the current time.
4-
In other words, how the codegen expects you to pass different types to GPU kernels from the CPU.
3+
This section details how parameters are passed to GPU kernels by the codegen backend. In other
4+
words, how the codegen backend expects you to pass different types to GPU kernels from the CPU.
55

66
⚠️ If you find any bugs in the ABI please report them. ⚠️
77

@@ -15,7 +15,7 @@ other ABI we override purely to avoid footguns.
1515

1616
Functions marked as `#[kernel]` are enforced to be `extern "C"` by the kernel macro, and it is expected
1717
that __all__ GPU kernels be `extern "C"`, not that you should be declaring any kernels without the `#[kernel]` macro,
18-
because the codegen/cuda_std is allowed to rely on the behavior of `#[kernel]` for correctness.
18+
because the codegen backend/cuda_std is allowed to rely on the behavior of `#[kernel]` for correctness.
1919

2020
## Structs
2121

@@ -119,7 +119,7 @@ unsafe {
119119
}
120120
```
121121

122-
You may get warnings about slices being an improper C-type, but the warnings are safe to ignore, the codegen guarantees
122+
You may get warnings about slices being an improper C-type, but the warnings are safe to ignore, the codegen backend guarantees
123123
that slices are passed as pairs of params.
124124

125125
You cannot however pass mutable slices, this is because it would violate aliasing rules, each thread receiving a copy of the mutable
@@ -135,7 +135,7 @@ ZSTs (zero-sized types) are ignored and become nothing in the final PTX.
135135
Primitive types are passed directly by value, same as structs. They map to the special PTX types `.s8`, `.s16`, `.s32`, `.s64`, `.u8`, `.u16`, `.u32`, `.u64`, `.f32`, and `.f64`.
136136
With the exception that `u128` and `i128` are passed as byte arrays (but this has no impact on how they are passed from the CPU).
137137

138-
## References And Pointers
138+
## References And pointers
139139

140140
References and Pointers are both passed as expected, as pointers. It is therefore expected that you pass such parameters using device memory:
141141

guide/src/guide/safety.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Note however, that unified memory can be accessed by multiple GPUs and multiple
9090
takes care of copying and moving data automatically from GPUs/CPU when a page fault occurs. For this reason
9191
as well as general ease of use, we suggest that unified memory generally be used over regular device memory.
9292

93-
### Kernel Launches
93+
### Kernel launches
9494

9595
Kernel Launches are the most unsafe part of CUDA, many things must be checked by the developer to soundly launch a kernel.
9696
It is fundamentally impossible for us to verify a large portion of the invariants expected by the kernel/CUDA.

guide/src/guide/tips.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This section contains some tips on what to do and what not to do using the proje
44

55
## GPU kernels
66

7-
- Generally don't derive `Debug` for structs in GPU crates. The codegen currently does not do much global
7+
- Generally don't derive `Debug` for structs in GPU crates. The codegen backend currently does not do much global
88
DCE (dead code elimination) so debug can really slow down compile times and make the PTX gigantic. This
99
will get much better in the future but currently it will cause some undesirable effects.
1010

guide/src/nvvm/backends.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
# Custom rustc Backends
1+
# Custom rustc backends
22

3-
Before we get into the details of rustc_codegen_nvvm, we obviously need to explain what a codegen is!
3+
Before we get into the details of rustc_codegen_nvvm, we obviously need to explain what a codegen backend is!
44

5-
Custom codegens are rustc's answer to "well what if I want Rust to compile to X?". This is a problem
5+
Custom codegen backends are rustc's answer to "well what if I want Rust to compile to X?". This is a problem
66
that comes up in many situations, especially conversations of "well LLVM cannot target this, so we are screwed".
77
To solve this problem, rustc decided to incrementally decouple itself from being attached/reliant on LLVM exclusively.
88

9-
Previously, rustc only had a single codegen, the LLVM codegen. The LLVM codegen translated MIR directly to LLVM IR.
9+
Previously, rustc only had a single codegen backend, the LLVM codegen backed. This translated MIR directly to LLVM IR.
1010
This is great if you just want to support LLVM, but LLVM is not perfect, and inevitably you will hit limits to what LLVM
1111
is able to do. Or, you may just want to stop using LLVM, LLVM is not without problems (it is often slow, clunky to deal with,
1212
and does not support a lot of targets).
1313

14-
Nowadays, rustc is almost fully decoupled from LLVM and it is instead generic over the "codegen" backend used.
14+
Nowadays, rustc is almost fully decoupled from LLVM and it is instead generic over the codegen backend used.
1515
rustc instead uses a system of codegen backends that implement traits and then get loaded as dynamically linked libraries.
1616
This allows Rust to compile to virtually anything with a surprisingly small amount of work. At the time of writing, there are
17-
five publicly known codegens that exist:
17+
five publicly known codegen backends that exist:
1818
- rustc_codegen_cranelift
1919
- rustc_codegen_llvm
2020
- rustc_codegen_gcc
2121
- rustc_codegen_spirv
22-
- rustc_codegen_nvvm, obviously the best codegen ;)
22+
- rustc_codegen_nvvm, obviously the best backend ;)
2323

2424
rustc_codegen_cranelift targets the cranelift backend, which is a codegen backend written in Rust that is faster than LLVM but does not have many optimizations
2525
compared to LLVM. rustc_codegen_llvm is obvious, it is the backend almost everybody uses which targets LLVM. rustc_codegen_gcc targets GCC (GNU Compiler Collection)
@@ -32,9 +32,9 @@ What NVVM IR/libNVVM are has been covered in the [CUDA section](../../cuda/pipel
3232

3333
# rustc_codegen_ssa
3434

35-
rustc_codegen_ssa is the central crate behind every single codegen and does much of the hard work.
36-
It abstracts away the MIR lowering logic so that custom codegens only have to implement some
37-
traits and the SSA codegen does everything else. For example:
35+
rustc_codegen_ssa is the central crate behind every single codegen backend and does much of the
36+
hard work. It abstracts away the MIR lowering logic so that custom codegen backends only have to
37+
implement some traits and the SSA codegen does everything else. For example:
3838
- A trait for getting a type like an integer type.
3939
- A trait for optimizing a module.
4040
- A trait for linking everything.

0 commit comments

Comments
 (0)