Skip to content

Commit 713088a

Browse files
authored
Improve C++ docs (#2138)
This PR improves a few small issues in the C++ documentation. Split off from #2087. Authors: - Bradley Dice (https://github.com/bdice) Approvers: - David Wendt (https://github.com/davidwendt) - Nghia Truong (https://github.com/ttnghia) URL: #2138
1 parent a32ca26 commit 713088a

19 files changed

+45
-48
lines changed

cpp/examples/basic/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 3.30.4)
77

88
include(../set_cuda_architecture.cmake)
99

10-
# initialize cuda architecture
10+
# initialize CUDA architectures
1111
rapids_cuda_init_architectures(basic_example)
1212

1313
project(

cpp/include/doxygen_groups.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
* @defgroup cuda_streams CUDA Streams
4949
* @defgroup data_containers Data Containers
5050
* @defgroup errors Errors
51-
* @defgroup logging Logging
5251
* @defgroup thrust_integrations Thrust Integrations
5352
* @defgroup utilities Utilities
5453
*/

cpp/include/rmm/cuda_stream.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class cuda_stream {
5656
cuda_stream& operator=(cuda_stream&) = delete;
5757

5858
/**
59-
* @brief Construct a new cuda stream object
59+
* @brief Construct a new CUDA stream object
6060
*
6161
* @param flags Stream creation flags.
6262
*

cpp/include/rmm/cuda_stream_pool.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class cuda_stream_pool {
3333
static constexpr std::size_t default_size{16}; ///< Default stream pool size
3434

3535
/**
36-
* @brief Construct a new cuda stream pool object of the given non-zero size
36+
* @brief Construct a new CUDA stream pool object of the given non-zero size
3737
*
3838
* @throws logic_error if `pool_size` is zero
3939
* @param pool_size The number of streams in the pool

cpp/include/rmm/detail/error.hpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
* specified.
2727
*
2828
* Example usage:
29-
* ```
30-
* // throws rmm::logic_error
29+
* ```cpp
30+
* // Throws rmm::logic_error
3131
* RMM_EXPECTS(p != nullptr, "Unexpected null pointer");
3232
*
33-
* // throws std::runtime_error
33+
* // Throws std::runtime_error
3434
* RMM_EXPECTS(p != nullptr, "Unexpected nullptr", std::runtime_error);
3535
* ```
3636
* @param ... This macro accepts either two or three arguments:
@@ -60,7 +60,7 @@
6060
* @brief Indicates that an erroneous code path has been taken.
6161
*
6262
* Example usage:
63-
* ```c++
63+
* ```cpp
6464
* // Throws rmm::logic_error
6565
* RMM_FAIL("Unsupported code path");
6666
*
@@ -91,8 +91,7 @@
9191
* specified.
9292
*
9393
* Example:
94-
* ```c++
95-
*
94+
* ```cpp
9695
* // Throws rmm::cuda_error if `cudaMalloc` fails
9796
* RMM_CUDA_TRY(cudaMalloc(&p, 100));
9897
*
@@ -176,14 +175,14 @@
176175
* equal to `cudaSuccess`.
177176
*
178177
*
179-
* Replaces usecases such as:
180-
* ```
178+
* Replaces use cases such as:
179+
* ```cpp
181180
* auto status = cudaRuntimeApi(...);
182181
* assert(status == cudaSuccess);
183182
* ```
184183
*
185184
* Example:
186-
* ```
185+
* ```cpp
187186
* RMM_ASSERT_CUDA_SUCCESS(cudaRuntimeApi(...));
188187
* ```
189188
*

cpp/include/rmm/detail/nvtx/ranges.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ struct librmm_domain {
2222
* Customizes an NVTX range with the given input.
2323
*
2424
* Example:
25-
* ```
25+
* ```cpp
2626
* void some_function(){
2727
* rmm::scoped_range rng{"custom_name"}; // Customizes range name
2828
* ...
@@ -41,7 +41,7 @@ using scoped_range = ::nvtx3::scoped_range_in<librmm_domain>;
4141
* name the range.
4242
*
4343
* Example:
44-
* ```
44+
* ```cpp
4545
* void some_function(){
4646
* RMM_FUNC_RANGE();
4747
* ...

cpp/include/rmm/device_buffer.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,28 @@ namespace RMM_NAMESPACE {
3434
* behavior to read the contents of `data()` before first initializing it.
3535
*
3636
* Examples:
37-
* ```
38-
* //Allocates at least 100 bytes of device memory using the default memory
39-
* //resource and default stream.
37+
* ```cpp
38+
* // Allocates at least 100 bytes of device memory using the default memory
39+
* // resource and default stream.
4040
* device_buffer buff(100);
4141
*
42-
* // allocates at least 100 bytes using the custom memory resource and
42+
* // Allocates at least 100 bytes using the custom memory resource and
4343
* // specified stream
4444
* custom_memory_resource mr;
4545
* cuda_stream_view stream = cuda_stream_view{};
4646
* device_buffer custom_buff(100, stream, &mr);
4747
*
48-
* // deep copies `buff` into a new device buffer using the specified stream
48+
* // Deep copies `buff` into a new device buffer using the specified stream
4949
* device_buffer buff_copy(buff, stream);
5050
*
51-
* // moves the memory in `from_buff` to `to_buff`. Deallocates previously allocated
51+
* // Moves the memory in `from_buff` to `to_buff`. Deallocates previously allocated
5252
* // to_buff memory on `to_buff.stream()`.
5353
* device_buffer to_buff(std::move(from_buff));
5454
*
55-
* // deep copies `buff` into a new device buffer using the specified stream
55+
* // Deep copies `buff` into a new device buffer using the specified stream
5656
* device_buffer buff_copy(buff, stream);
5757
*
58-
* // shallow copies `buff` into a new device_buffer, `buff` is now empty
58+
* // Shallow copies `buff` into a new device_buffer, `buff` is now empty
5959
* device_buffer buff_move(std::move(buff));
6060
*
6161
* // Default construction. Buffer is empty
@@ -65,7 +65,7 @@ namespace RMM_NAMESPACE {
6565
* // deep copies any previous contents. Otherwise, simply updates the value of `size()` to the
6666
* // newly requested size without any allocations or copies. Uses the specified stream.
6767
* buff_default.resize(100, stream);
68-
*```
68+
* ```
6969
*/
7070
class device_buffer {
7171
public:

cpp/include/rmm/device_scalar.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class device_scalar {
168168
* referenced by `v` should not be destroyed or modified until `stream` has been
169169
* synchronized. Otherwise, behavior is undefined.
170170
*
171-
* @note: This function incurs a host to device memcpy or device memset and should be used
171+
* @note This function incurs a host to device memcpy or device memset and should be used
172172
* carefully.
173173
*
174174
* Example:
@@ -209,7 +209,7 @@ class device_scalar {
209209
*
210210
* This function does not synchronize `stream` before returning.
211211
*
212-
* @note: This function incurs a device memset and should be used carefully.
212+
* @note This function incurs a device memset and should be used carefully.
213213
*
214214
* @param stream CUDA stream on which to perform the copy
215215
*/

cpp/include/rmm/device_uvector.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ class device_uvector {
7070
"device_uvector only supports types that are trivially copyable.");
7171

7272
public:
73-
using value_type = T; ///< T; stored value type
73+
using value_type = T; ///< Stored value type
7474
using size_type = std::size_t; ///< The type used for the size of the vector
75-
using reference = value_type&; ///< value_type&; reference type returned by operator[](size_type)
76-
using const_reference = value_type const&; ///< value_type const&; constant reference type
77-
///< returned by operator[](size_type) const
78-
using pointer = value_type*; ///< The type of the pointer returned by data()
79-
using const_pointer = value_type const*; ///< The type of the pointer returned by data() const
80-
using iterator = pointer; ///< The type of the iterator returned by begin()
75+
using reference = value_type&; ///< Reference type returned by operator[](size_type)
76+
using const_reference =
77+
value_type const&; ///< Constant reference type returned by operator[](size_type) const
78+
using pointer = value_type*; ///< The type of the pointer returned by data()
79+
using const_pointer = value_type const*; ///< The type of the pointer returned by data() const
80+
using iterator = pointer; ///< The type of the iterator returned by begin()
8181
using const_iterator = const_pointer; ///< The type of the const iterator returned by cbegin()
8282
using reverse_iterator =
8383
thrust::reverse_iterator<iterator>; ///< The type of the iterator returned by rbegin()

cpp/include/rmm/mr/device/callback_memory_resource.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace mr {
2323
* @brief Callback function type used by callback memory resource for allocation.
2424
*
2525
* The signature of the callback function is:
26-
* `void* allocate_callback_t(std::size_t bytes, cuda_stream_view stream, void* arg);
26+
* `void* allocate_callback_t(std::size_t bytes, cuda_stream_view stream, void* arg);`
2727
*
2828
* * Returns a pointer to an allocation of at least `bytes` usable immediately on
2929
* `stream`. The stream-ordered behavior requirements are identical to
@@ -40,7 +40,7 @@ using allocate_callback_t = std::function<void*(std::size_t, cuda_stream_view, v
4040
* @brief Callback function type used by callback_memory_resource for deallocation.
4141
*
4242
* The signature of the callback function is:
43-
* `void deallocate_callback_t(void* ptr, std::size_t bytes, cuda_stream_view stream, void* arg);
43+
* `void deallocate_callback_t(void* ptr, std::size_t bytes, cuda_stream_view stream, void* arg);`
4444
*
4545
* * Deallocates memory pointed to by `ptr`. `bytes` specifies the size of the allocation
4646
* in bytes, and must equal the value of `bytes` that was passed to the allocate callback

0 commit comments

Comments
 (0)