Skip to content

Commit 5db7091

Browse files
committed
Use consistent capitalization, part 2.
- Rustc -> rustc (truly!) - rust -> Rust - NVidia/nvidia -> NVIDIA
1 parent a9de355 commit 5db7091

File tree

10 files changed

+29
-29
lines changed

10 files changed

+29
-29
lines changed

guide/src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
- [GPU Computing](cuda/gpu_computing.md)
1414
- [The CUDA Pipeline](cuda/pipeline.md)
1515
- [rustc_codegen_nvvm](nvvm/README.md)
16-
- [Custom Rustc Backends](nvvm/backends.md)
16+
- [Custom rustc Backends](nvvm/backends.md)
1717
- [rustc_codegen_nvvm](nvvm/nvvm.md)
1818
- [Types](nvvm/types.md)
1919
- [PTX Generation](nvvm/ptxgen.md)

guide/src/cuda/gpu_computing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ as (but not limited to):
3636
- Forgetting to free memory, using uninitialized memory, etc.
3737

3838
Not to mention the standardized tooling that makes the building, documentation, sharing, and linting of GPU kernel libraries easily possible.
39-
Most of the reasons for using rust on the CPU apply to using Rust for the GPU, these reasons have been stated countless times so
39+
Most of the reasons for using Rust on the CPU apply to using Rust for the GPU, these reasons have been stated countless times so
4040
I will not repeat them here.
4141

42-
A couple of particular rust features make writing CUDA code much easier: RAII and Results.
42+
A couple of particular Rust features make writing CUDA code much easier: RAII and Results.
4343
In cust everything uses RAII (through `Drop` impls) to manage freeing memory and returning handles, which
4444
frees users from having to think about that, which yields safer, more reliable code.
4545

@@ -48,6 +48,6 @@ Ignoring these statuses is very dangerous and can often lead to random segfaults
4848
both the CUDA SDK, and other libraries provide macros to handle such statuses. This handling is not very reliable and causes
4949
dependency issues down the line.
5050

51-
Instead of an unreliable system of macros, we can leverage rust results for this. In cust we return special `CudaResult<T>`
52-
results that can be bubbled up using rust's `?` operator, or, similar to `CUDA_SAFE_CALL` can be unwrapped or expected if
51+
Instead of an unreliable system of macros, we can leverage Rust results for this. In cust we return special `CudaResult<T>`
52+
results that can be bubbled up using Rust's `?` operator, or, similar to `CUDA_SAFE_CALL` can be unwrapped or expected if
5353
proper error handling is not needed.

guide/src/faq.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ seamlessly implement features which would have been impossible or very difficult
2121
- Stripping away everything we do not need, no complex ABI handling, no shared lib handling, control over how function calls are generated, etc.
2222

2323
So overall, the LLVM PTX backend is fit for smaller kernels/projects/proofs of concept.
24-
It is however not fit for compiling an entire language (core is __very__ big) with dependencies and more. The end goal is for rust to be able to be used
24+
It is however not fit for compiling an entire language (core is __very__ big) with dependencies and more. The end goal is for Rust to be able to be used
2525
over CUDA C/C++ with the same (or better!) performance and features, therefore, we must take advantage of all optimizations NVCC has over us.
2626

2727
## If NVVM IR is a subset of LLVM IR, can we not give rustc-generated LLVM IR to NVVM?
@@ -117,22 +117,22 @@ no control over it and no 100% reliable way to fix it, therefore we must shift t
117117
118118
Moreover, the CUDA GPU kernel model is entirely based on trust, trusting each thread to index into the correct place in buffers,
119119
trusting the caller of the kernel to uphold some dimension invariants, etc. This is once again, completely incompatible with how
120-
rust does things. We can provide wrappers to calculate an index that always works, and macros to index a buffer automatically, but
120+
Rust does things. We can provide wrappers to calculate an index that always works, and macros to index a buffer automatically, but
121121
indexing in complex ways is a core operation in CUDA and it is impossible for us to prove that whatever the developer is doing is correct.
122122
123123
Finally, We would love to be able to use mut refs in kernel parameters, but this is would be unsound. Because
124124
each kernel function is *technically* called multiple times in parallel with the same parameters, we would be
125-
aliasing the mutable ref, which Rustc declares as unsound (aliasing mechanics). So raw pointers or slightly-less-unsafe
125+
aliasing the mutable ref, which rustc declares as unsound (aliasing mechanics). So raw pointers or slightly-less-unsafe
126126
need to be used. However, they are usually only used for the initial buffer indexing, after which you can turn them into a
127127
mutable reference just fine (because you indexed in a way where no other thread will index that element). Also note
128128
that shared refs can be used as parameters just fine.
129129
130-
Now that we outlined why this is a thing, why is using rust a benefit if we still need to use unsafe?
130+
Now that we outlined why this is a thing, why is using Rust a benefit if we still need to use unsafe?
131131
132132
Well it's simple, eliminating most of the things that a developer needs to think about to have a safe program
133133
is still exponentially safer than leaving __everything__ to the developer to think about.
134134
135-
By using rust, we eliminate:
135+
By using Rust, we eliminate:
136136
- The forgotten/unhandled CUDA errors problem (yay results!).
137137
- The uninitialized memory problem.
138138
- The forgetting to dealloc memory problem.
@@ -156,15 +156,15 @@ The reasoning for this is the same reasoning as to why you would use CUDA over o
156156
- rust-gpu does not perform many optimizations, and with rustc_codegen_ssa's less than ideal codegen, the optimizations by LLVM and libNVVM are needed.
157157
- SPIR-V is arguably still not suitable for serious GPU kernel codegen, it is underspecced, complex, and does not mention many things which are needed.
158158
While libNVVM (which uses a well documented subset of LLVM IR) and the PTX ISA are very thoroughly documented/specified.
159-
- rust-gpu is primarily focused on graphical shaders, compute shaders are secondary, which the rust ecosystem needs, but it also
159+
- rust-gpu is primarily focused on graphical shaders, compute shaders are secondary, which the Rust ecosystem needs, but it also
160160
needs a project 100% focused on computing, and computing only.
161161
- SPIR-V cannot access many useful CUDA libraries such as OptiX, cuDNN, cuBLAS, etc.
162162
- SPIR-V debug info is still very young and rust-gpu cannot generate it. While rustc_codegen_nvvm does, which can be used
163163
for profiling kernels in something like nsight compute.
164164
165165
Moreover, CUDA is the primary tool used in big computing industries such as VFX and scientific computing. Therefore
166-
it is much easier for CUDA C++ users to use rust for GPU computing if most of the concepts are still the same. Plus,
167-
we can interface with existing CUDA code by compiling it to PTX then linking it with our rust code using the CUDA linker
166+
it is much easier for CUDA C++ users to use Rust for GPU computing if most of the concepts are still the same. Plus,
167+
we can interface with existing CUDA code by compiling it to PTX then linking it with our Rust code using the CUDA linker
168168
API (which is exposed in a high level wrapper in cust).
169169
170170
## Why use the CUDA Driver API over the Runtime API?
@@ -289,5 +289,5 @@ Changes that are currently in progress but not done/experimental:
289289
Just like RustaCUDA, cust makes no assumptions of what language was used to generate the PTX/cubin. It could be
290290
C, C++, futhark, or best of all, Rust!
291291
292-
Cust's name is literally just rust + CUDA mashed together in a horrible way.
292+
Cust's name is literally just Rust + CUDA mashed together in a horrible way.
293293
Or you can pretend it stands for custard if you really like custard.

guide/src/features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,4 @@ on things used by the wide majority of users.
105105
| Stream Ordered Memory | ✔️ |
106106
| Graph Memory Nodes ||
107107
| Unified Memory | ✔️ |
108-
| `__restrict__` || Not needed, you get that performance boost automatically through rust's noalias :) |
108+
| `__restrict__` || Not needed, you get that performance boost automatically through Rust's noalias :) |

guide/src/guide/getting_started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,4 +232,4 @@ You can use it as follows (assuming your clone of Rust CUDA is at the absolute p
232232
2. despite using Docker, your machine will still need to be running a compatible driver, in this case for CUDA 11.4.1 it is >=470.57.02
233233
3. if you have issues within the container, it can help to start ensuring your GPU is recognized
234234
- ensure `nvidia-smi` provides meaningful output in the container
235-
- NVidia provides a number of samples https://github.com/NVIDIA/cuda-samples. In particular, you may want to try `make`ing and running the [`deviceQuery`](https://github.com/NVIDIA/cuda-samples/tree/ba04faaf7328dbcc87bfc9acaf17f951ee5ddcf3/Samples/deviceQuery) sample. If all is well you should see many details about your GPU
235+
- NVIDIA provides a number of samples https://github.com/NVIDIA/cuda-samples. In particular, you may want to try `make`ing and running the [`deviceQuery`](https://github.com/NVIDIA/cuda-samples/tree/ba04faaf7328dbcc87bfc9acaf17f951ee5ddcf3/Samples/deviceQuery) sample. If all is well you should see many details about your GPU

guide/src/guide/kernel_abi.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ In other words, how the codegen expects you to pass different types to GPU kerne
77

88
## Preface
99

10-
Please note that the following __only__ applies to non-rust call conventions, we make zero guarantees
11-
about the rust call convention, just like rustc.
10+
Please note that the following __only__ applies to non-Rust call conventions, we make zero guarantees
11+
about the Rust call convention, just like rustc.
1212

13-
While we currently override every ABI except rust, you should generally only use `"C"`, any
13+
While we currently override every ABI except Rust, you should generally only use `"C"`, any
1414
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

guide/src/nvvm/backends.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Custom Rustc Backends
1+
# Custom rustc Backends
22

33
Before we get into the details of rustc_codegen_nvvm, we obviously need to explain what a codegen 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 codegens 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

@@ -11,23 +11,23 @@ This is great if you just want to support LLVM, but LLVM is not perfect, and ine
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.
15-
Rustc instead uses a system of codegen backends that implement traits and then get loaded as dynamically linked libraries.
16-
This allows rust to compile to virtually anything with a surprisingly small amount of work. At the time of writing, there are
14+
Nowadays, rustc is almost fully decoupled from LLVM and it is instead generic over the "codegen" backend used.
15+
rustc instead uses a system of codegen backends that implement traits and then get loaded as dynamically linked libraries.
16+
This allows Rust to compile to virtually anything with a surprisingly small amount of work. At the time of writing, there are
1717
five publicly known codegens that exist:
1818
- rustc_codegen_cranelift
1919
- rustc_codegen_llvm
2020
- rustc_codegen_gcc
2121
- rustc_codegen_spirv
2222
- rustc_codegen_nvvm, obviously the best codegen ;)
2323

24-
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
24+
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)
2626
which is able to target more exotic targets than LLVM, especially for embedded. rustc_codegen_spirv targets the SPIR-V (Standard Portable Intermediate Representation 5)
2727
format, which is a format mostly used for compiling shader languages such as GLSL or WGSL to a standard representation that Vulkan/OpenGL can use, the reasons
2828
why SPIR-V is not an alternative to CUDA/rustc_codegen_nvvm have been covered in the [FAQ](../../faq.md).
2929

30-
Finally, we come to the star of the show, rustc_codegen_nvvm. This backend targets NVVM IR for compiling rust to GPU kernels that can be run by CUDA.
30+
Finally, we come to the star of the show, rustc_codegen_nvvm. This backend targets NVVM IR for compiling Rust to GPU kernels that can be run by CUDA.
3131
What NVVM IR/libNVVM are has been covered in the [CUDA section](../../cuda/pipeline.md).
3232

3333
# rustc_codegen_ssa

guide/src/nvvm/debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ If that doesn't work, then it might be a bug inside of CUDA itself, but that sho
4747
is to set up the crate for debug (and see if it still happens in debug). Then you can run your executable under NSight Compute, go to the source tab, and
4848
examine the SASS (basically an assembly lower than PTX) to see if ptxas miscompiled it.
4949

50-
If you set up the codegen for debug, it should give you a mapping from rust code to SASS which should hopefully help to see what exactly is breaking.
50+
If you set up the codegen for debug, it should give you a mapping from Rust code to SASS which should hopefully help to see what exactly is breaking.
5151

5252
Here is an example of the screen you should see:
5353

guide/src/nvvm/nvvm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Source code -> Typechecking -> MIR -> SSA Codegen -> LLVM IR (NVVM IR) -> PTX ->
88
| | libNVVM +------+ |
99
| | |
1010
| rustc_codegen_nvvm +------------------------------------------------------------|
11-
Rustc +---------------------------------------------------------------------------------------------------
11+
rustc +---------------------------------------------------------------------------------------------------
1212
```
1313

1414
Before we do anything, rustc does its normal job, it typechecks, converts everything to MIR, etc. Then,

guide/src/nvvm/ptxgen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ into the module if they are used, doing so using dependency graphs.
5858

5959
There are a couple of special modules we need to load before we are done, `libdevice` and `libintrinsics`. The first and most
6060
important one is libdevice, libdevice is essentially a bitcode module containing hyper-optimized math intrinsics
61-
that nvidia provides for us. You can find it as a `.bc` file in the libdevice folder inside your NVVM install location.
61+
that NVIDIA provides for us. You can find it as a `.bc` file in the libdevice folder inside your NVVM install location.
6262
Every function inside of it is prefixed with `__nv_`, you can find docs for it [here](https://docs.nvidia.com/cuda/libdevice-users-guide/index.html).
6363

6464
We declare these intrinsics inside of `ctx_intrinsics.rs` and link to them inside cuda_std. We also use them to codegen

0 commit comments

Comments
 (0)