-
Notifications
You must be signed in to change notification settings - Fork 214
Improve the Guide's consistency of style #308
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
base: main
Are you sure you want to change the base?
Conversation
dab15bd to
f1df692
Compare
|
I fixed one more inconsistent capitalization case (nvidia/NVidia -> NVIDIA). |
LegNeato
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just need to decide if we use code backtics for crate names. I think that is common practice and looks better but open for discussion.
guide/src/cuda/gpu_computing.md
Outdated
| A couple of particular rust features make writing CUDA code much easier: RAII and Results. | ||
| In `cust` everything uses RAII (through `Drop` impls) to manage freeing memory and returning handles, which | ||
| A couple of particular Rust features make writing CUDA code much easier: RAII and Results. | ||
| In cust everything uses RAII (through `Drop` impls) to manage freeing memory and returning handles, which |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| In cust everything uses RAII (through `Drop` impls) to manage freeing memory and returning handles, which | |
| In `cust` everything uses RAII (through `Drop` impls) to manage freeing memory and returning handles, which |
This should probably be code due to being a crate name? Not sure. Woul be good to link it too.
|
|
||
| Instead of an unreliable system of macros, we can leverage rust results for this. In cust we return special `CudaResult<T>` | ||
| results that can be bubbled up using rust's `?` operator, or, similar to `CUDA_SAFE_CALL` can be unwrapped or expected if | ||
| Instead of an unreliable system of macros, we can leverage Rust results for this. In cust we return special `CudaResult<T>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Instead of an unreliable system of macros, we can leverage Rust results for this. In cust we return special `CudaResult<T>` | |
| Instead of an unreliable system of macros, we can leverage Rust results for this. In `cust` we return special `CudaResult<T>` |
guide/src/guide/getting_started.md
Outdated
| # Getting started | ||
|
|
||
| This section covers how to get started writing GPU crates with `cuda_std` and `cuda_builder`. | ||
| This section covers how to get started writing GPU crates with cuda_std and cuda_builder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, these are crate names which are usually marked as code?
| This section covers how to get started writing GPU crates with cuda_std and cuda_builder. | |
| This section covers how to get started writing GPU crates with `cuda_std` and `cuda_builder`. |
guide/src/guide/getting_started.md
Outdated
| ``` | ||
|
|
||
| Where `XX` is the latest version of `cuda_std`. | ||
| Where `XX` is the latest version of cuda_std. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Where `XX` is the latest version of cuda_std. | |
| Where `XX` is the latest version of `cuda_std`. |
guide/src/guide/getting_started.md
Outdated
| ``` | ||
|
|
||
| Finally, if you would like to use types such as slices or arrays inside of GPU kernels you must allow `improper_cytypes_definitions` either on the whole crate or the individual GPU kernels. This is because on the CPU, such types are not guaranteed to be passed a certain way, so they should not be used in `extern "C"` functions (which is what kernels are implicitly declared as). However, `rustc_codegen_nvvm` guarantees the way in which things like structs, slices, and arrays are passed. See [Kernel ABI](./kernel_abi.md). | ||
| Finally, if you would like to use types such as slices or arrays inside of GPU kernels you must allow `improper_cytypes_definitions` either on the whole crate or the individual GPU kernels. This is because on the CPU, such types are not guaranteed to be passed a certain way, so they should not be used in `extern "C"` functions (which is what kernels are implicitly declared as). However, rustc_codegen_nvvm guarantees the way in which things like structs, slices, and arrays are passed. See [Kernel ABI](./kernel_abi.md). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Finally, if you would like to use types such as slices or arrays inside of GPU kernels you must allow `improper_cytypes_definitions` either on the whole crate or the individual GPU kernels. This is because on the CPU, such types are not guaranteed to be passed a certain way, so they should not be used in `extern "C"` functions (which is what kernels are implicitly declared as). However, rustc_codegen_nvvm guarantees the way in which things like structs, slices, and arrays are passed. See [Kernel ABI](./kernel_abi.md). | |
| Finally, if you would like to use types such as slices or arrays inside of GPU kernels you must allow `improper_cytypes_definitions` either on the whole crate or the individual GPU kernels. This is because on the CPU, such types are not guaranteed to be passed a certain way, so they should not be used in `extern "C"` functions (which is what kernels are implicitly declared as). However, `rustc_codegen_nvvm` guarantees the way in which things like structs, slices, and arrays are passed. See [Kernel ABI](./kernel_abi.md). |
A little shorter and clearer.
The Guide is currently very inconsistent with capitalization of abbreviations. The general trend is towards lower-case for informal English, but for formal English (such as documentation) I think upper-case is still preferable. - gpu -> GPU - cuda/Cuda -> CUDA - rustacuda -> RustaCUDA - llvm -> LLVM - nvvm -> NVVM - ir -> IR - ptx -> PTX - libnvvm -> libNVVM - Optix/optix -> OptiX - SPIRV -> SPIR-V - cuBlas/cuRand -> cuBLAS/cuRAND - i (the pronoun!) -> I - TLDR -> TL;DR
A lot of names are used sometimes with backticks, sometimes without. This commit removes backticks where necessary for these: - rustc - rust-gpu (which will become "Rust GPU" in a subsequent commit) And adds backticks where necessary for these: - rustc_codegen_* - cuda_builder - cuda_std - lib.rs
- Rustc -> rustc (truly!) - rust -> Rust - NVidia/nvidia -> NVIDIA
[I accidentally squashed two commits, and can't be bothered separating
them.]
The existing text uses "codegen" frequently as a shorthand for "codegen
backend". I found this confusing and distracting. ("Codegens" is even
worse.) This commit replaces these uses with "codegen backend" (or
occasionally something else more appropriate).
The commit preserves the use of "codegen" for the act of code generation,
e.g. "during codegen we do XYZ", because that's more standard.
Also, 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.
f1df692 to
8bc37a6
Compare
|
Ok, I have updated to use backticks on crate names like |
The Guide is very inconsistent on some matters of style: capitalization, use of backticks, and some word choices. Like a fine layer of grit over all the surfaces of a workshop, these low-level irritants get in the way of larger, more important changes. Let's fix them all now.