diff --git a/doxygen/Doxyfile b/doxygen/Doxyfile index 9dc1520d7..d03f38b54 100644 --- a/doxygen/Doxyfile +++ b/doxygen/Doxyfile @@ -259,7 +259,11 @@ TAB_SIZE = 4 # commands \{ and \} for these it is advised to use the version @{ and @} or use # a double escape (\\{ and \\}) -ALIASES = +ALIASES += "briefreturn{1}=@brief \1 @return \1" +ALIASES += "default_copy_constructor=Default copy constructor" +ALIASES += "default_move_constructor=Default move constructor" +ALIASES += "default_copy_assignment{1}=@brief Default copy assignment operator @return \1& Reference to the assigned object" +ALIASES += "default_move_assignment{1}=@brief Default move assignment operator @return \1& Reference to the assigned object" # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -898,7 +902,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = */detail/* # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the diff --git a/include/rmm/cuda_device.hpp b/include/rmm/cuda_device.hpp index ab225490e..81d35dc3c 100644 --- a/include/rmm/cuda_device.hpp +++ b/include/rmm/cuda_device.hpp @@ -26,16 +26,16 @@ namespace rmm { * */ struct cuda_device_id { - using value_type = int; + using value_type = int; ///< Integer type used for device identifier /** * @brief Construct a `cuda_device_id` from the specified integer value * - * @param id The device's integer identifier + * @param dev_id The device's integer identifier */ explicit constexpr cuda_device_id(value_type dev_id) noexcept : id_{dev_id} {} - /// Returns the wrapped integer value + /// @briefreturn{The wrapped integer value} [[nodiscard]] constexpr value_type value() const noexcept { return id_; } private: diff --git a/include/rmm/cuda_stream.hpp b/include/rmm/cuda_stream.hpp index 9d2dab4f0..b778cf7bd 100644 --- a/include/rmm/cuda_stream.hpp +++ b/include/rmm/cuda_stream.hpp @@ -46,6 +46,8 @@ class cuda_stream { * * A moved-from cuda_stream is invalid and it is Undefined Behavior to call methods that access * the owned stream. + * + * @return A reference to this cuda_stream */ cuda_stream& operator=(cuda_stream&&) = default; ~cuda_stream() = default; diff --git a/include/rmm/cuda_stream_view.hpp b/include/rmm/cuda_stream_view.hpp index bc30f26d8..150fe3957 100644 --- a/include/rmm/cuda_stream_view.hpp +++ b/include/rmm/cuda_stream_view.hpp @@ -33,41 +33,47 @@ namespace rmm { */ class cuda_stream_view { public: - constexpr cuda_stream_view() = default; - constexpr cuda_stream_view(cuda_stream_view const&) = default; - constexpr cuda_stream_view(cuda_stream_view&&) = default; - constexpr cuda_stream_view& operator=(cuda_stream_view const&) = default; - constexpr cuda_stream_view& operator=(cuda_stream_view&&) = default; - ~cuda_stream_view() = default; + constexpr cuda_stream_view() = default; + ~cuda_stream_view() = default; + constexpr cuda_stream_view(cuda_stream_view const&) = default; ///< @default_copy_constructor + constexpr cuda_stream_view(cuda_stream_view&&) = default; ///< @default_move_constructor + constexpr cuda_stream_view& operator=(cuda_stream_view const&) = + default; ///< @default_copy_assignment{cuda_stream_view} + constexpr cuda_stream_view& operator=(cuda_stream_view&&) = + default; ///< @default_move_assignment{cuda_stream_view} // Disable construction from literal 0 constexpr cuda_stream_view(int) = delete; //< Prevent cast from 0 constexpr cuda_stream_view(std::nullptr_t) = delete; //< Prevent cast from nullptr /** - * @brief Implicit conversion from cudaStream_t. + * @brief Constructor from a cudaStream_t + * + * @param stream The underlying stream for this view */ constexpr cuda_stream_view(cudaStream_t stream) noexcept : stream_{stream} {} /** * @brief Get the wrapped stream. * - * @return cudaStream_t The wrapped stream. + * @return cudaStream_t The underlying stream referenced by this cuda_stream_view */ [[nodiscard]] constexpr cudaStream_t value() const noexcept { return stream_; } /** * @brief Implicit conversion to cudaStream_t. + * + * @return cudaStream_t The underlying stream referenced by this cuda_stream_view */ constexpr operator cudaStream_t() const noexcept { return value(); } /** - * @brief Return true if the wrapped stream is the CUDA per-thread default stream. + * @briefreturn{true if the wrapped stream is the CUDA per-thread default stream} */ [[nodiscard]] inline bool is_per_thread_default() const noexcept; /** - * @brief Return true if the wrapped stream is explicitly the CUDA legacy default stream. + * @briefreturn{true if the wrapped stream is explicitly the CUDA legacy default stream} */ [[nodiscard]] inline bool is_default() const noexcept; diff --git a/include/rmm/device_buffer.hpp b/include/rmm/device_buffer.hpp index bd8a8211a..145fbf891 100644 --- a/include/rmm/device_buffer.hpp +++ b/include/rmm/device_buffer.hpp @@ -29,7 +29,6 @@ namespace rmm { /** - * @file device_buffer.hpp * @brief RAII construct for device memory allocation * * This class allocates untyped and *uninitialized* device memory using a @@ -202,6 +201,8 @@ class device_buffer { * replaced by the `other.stream()`. * * @param other The `device_buffer` whose contents will be moved. + * + * @return A reference to this `device_buffer` */ device_buffer& operator=(device_buffer&& other) noexcept { @@ -331,22 +332,22 @@ class device_buffer { } /** - * @brief Returns raw pointer to underlying device memory allocation + * @briefreturn{Const pointer to the device memory allocation} */ [[nodiscard]] void const* data() const noexcept { return _data; } /** - * @brief Returns raw pointer to underlying device memory allocation + * @briefreturn{Pointer to the device memory allocation} */ void* data() noexcept { return _data; } /** - * @brief Returns the number of bytes. + * @briefreturn{The number of bytes} */ [[nodiscard]] std::size_t size() const noexcept { return _size; } /** - * @brief Returns the signed number of bytes. + * @briefreturn{The signed number of bytes} */ [[nodiscard]] std::int64_t ssize() const noexcept { @@ -356,11 +357,10 @@ class device_buffer { } /** - * @brief returns the number of bytes that can be held in currently allocated storage. + * @briefreturn{Whether or not the buffer currently holds any data} * * If `is_empty() == true`, the `device_buffer` may still hold an allocation * if `capacity() > 0`. - * */ [[nodiscard]] bool is_empty() const noexcept { return 0 == size(); } @@ -368,11 +368,13 @@ class device_buffer { * @brief Returns actual size in bytes of device memory allocation. * * The invariant `size() <= capacity()` holds. + * + * @return The actual size in bytes of the device memory allocation */ [[nodiscard]] std::size_t capacity() const noexcept { return _capacity; } /** - * @brief Returns stream most recently specified for allocation/deallocation + * @briefreturn{The stream most recently specified for allocation/deallocation} */ [[nodiscard]] cuda_stream_view stream() const noexcept { return _stream; } @@ -384,12 +386,13 @@ class device_buffer { * will be used for deallocation in the `rmm::device_uvector` destructor. * However, if either of `resize()` or `shrink_to_fit()` is called after this, * the later stream parameter will be stored and used in the destructor. + * + * @param stream The stream to use for deallocation */ void set_stream(cuda_stream_view stream) noexcept { _stream = stream; } /** - * @brief Returns pointer to the memory resource used to allocate and - * deallocate the device memory + * @briefreturn{Pointer to the memory resource used to allocate and deallocate} */ [[nodiscard]] mr::device_memory_resource* memory_resource() const noexcept { return _mr; } diff --git a/include/rmm/device_scalar.hpp b/include/rmm/device_scalar.hpp index e476b2d87..83fcdda09 100644 --- a/include/rmm/device_scalar.hpp +++ b/include/rmm/device_scalar.hpp @@ -37,18 +37,25 @@ class device_scalar { public: static_assert(std::is_trivially_copyable::value, "Scalar type must be trivially copyable"); - using value_type = typename device_uvector::value_type; - using reference = typename device_uvector::reference; - using const_reference = typename device_uvector::const_reference; - using pointer = typename device_uvector::pointer; - using const_pointer = typename device_uvector::const_pointer; + using value_type = typename device_uvector::value_type; ///< T, the type of the scalar element + using reference = typename device_uvector::reference; ///< value_type& + using const_reference = typename device_uvector::const_reference; ///< const value_type& + using pointer = + typename device_uvector::pointer; ///< The type of the pointer returned by data() + using const_pointer = typename device_uvector::const_pointer; ///< The type of the iterator + ///< returned by data() const RMM_EXEC_CHECK_DISABLE ~device_scalar() = default; RMM_EXEC_CHECK_DISABLE - device_scalar(device_scalar&&) noexcept = default; + device_scalar(device_scalar&&) noexcept = default; ///< Default move constructor + /** + * @brief Default move assignment operator + * + * @return device_scalar& A reference to the assigned-to object + */ device_scalar& operator=(device_scalar&&) noexcept = default; /** @@ -224,6 +231,8 @@ class device_scalar { * specified to the constructor, then appropriate dependencies must be inserted between the * streams (e.g. using `cudaStreamWaitEvent()` or `cudaStreamSynchronize()`), otherwise there may * be a race condition. + * + * @return Pointer to underlying device memory */ [[nodiscard]] pointer data() noexcept { return static_cast(_storage.data()); } @@ -234,6 +243,8 @@ class device_scalar { * specified to the constructor, then appropriate dependencies must be inserted between the * streams (e.g. using `cudaStreamWaitEvent()` or `cudaStreamSynchronize()`), otherwise there may * be a race condition. + * + * @return Const pointer to underlying device memory */ [[nodiscard]] const_pointer data() const noexcept { @@ -241,12 +252,14 @@ class device_scalar { } /** - * @brief Returns stream most recently specified for allocation/deallocation + * @briefreturn{Stream associated with the device memory allocation} */ [[nodiscard]] cuda_stream_view stream() const noexcept { return _storage.stream(); } /** * @brief Sets the stream to be used for deallocation + * + * @param stream Stream to be used for deallocation */ void set_stream(cuda_stream_view stream) noexcept { _storage.set_stream(stream); } diff --git a/include/rmm/device_uvector.hpp b/include/rmm/device_uvector.hpp index 40f5d8c5d..47ed1adff 100644 --- a/include/rmm/device_uvector.hpp +++ b/include/rmm/device_uvector.hpp @@ -71,22 +71,24 @@ class device_uvector { "device_uvector only supports types that are trivially copyable."); public: - using value_type = T; - using size_type = std::size_t; - using reference = value_type&; - using const_reference = value_type const&; - using pointer = value_type*; - using const_pointer = value_type const*; - using iterator = pointer; - using const_iterator = const_pointer; + using value_type = T; ///< T; stored value type + using size_type = std::size_t; ///< The type used for the size of the vector + using reference = value_type&; ///< value_type&; reference type returned by operator[](size_type) + using const_reference = value_type const&; ///< value_type const&; constant reference type + ///< returned by operator[](size_type) const + using pointer = value_type*; ///< The type of the pointer returned by data() + using const_pointer = value_type const*; ///< The type of the pointer returned by data() const + using iterator = pointer; ///< The type of the iterator returned by begin() + using const_iterator = const_pointer; ///< The type of the const iterator returned by cbegin() RMM_EXEC_CHECK_DISABLE ~device_uvector() = default; RMM_EXEC_CHECK_DISABLE - device_uvector(device_uvector&&) noexcept = default; + device_uvector(device_uvector&&) noexcept = default; ///< @default_move_constructor - device_uvector& operator=(device_uvector&&) noexcept = default; + device_uvector& operator=(device_uvector&&) noexcept = + default; ///< @default_move_assignment{device_uvector} /** * @brief Copy ctor is deleted as it doesn't allow a stream argument @@ -497,12 +499,12 @@ class device_uvector { [[nodiscard]] const_iterator end() const noexcept { return cend(); } /** - * @brief Returns the number of elements. + * @briefreturn{The number of elements in the vector} */ [[nodiscard]] std::size_t size() const noexcept { return bytes_to_elements(_storage.size()); } /** - * @brief Returns the signed number of elements. + * @briefreturn{The signed number of elements in the vector} */ [[nodiscard]] std::int64_t ssize() const noexcept { @@ -512,17 +514,12 @@ class device_uvector { } /** - * @brief Returns true if the vector contains no elements, i.e., `size() == 0`. - * - * @return true The vector is empty - * @return false The vector is not empty + * @briefreturn{true if the vector contains no elements, i.e. `size() == 0`} */ [[nodiscard]] bool is_empty() const noexcept { return size() == 0; } /** - * @brief Returns pointer to the resource used to allocate and deallocate the device storage. - * - * @return Pointer to underlying resource + * @briefreturn{Pointer to underlying resource used to allocate and deallocate the device storage} */ [[nodiscard]] mr::device_memory_resource* memory_resource() const noexcept { @@ -530,7 +527,7 @@ class device_uvector { } /** - * @brief Returns stream most recently specified for allocation/deallocation + * @briefreturn{Stream most recently specified for allocation/deallocation} */ [[nodiscard]] cuda_stream_view stream() const noexcept { return _storage.stream(); } @@ -542,6 +539,8 @@ class device_uvector { * will be used for deallocation in the `rmm::device_uvector destructor. * However, if either of `resize()` or `shrink_to_fit()` is called after this, * the later stream parameter will be stored and used in the destructor. + * + * @param stream The stream to use for deallocation */ void set_stream(cuda_stream_view stream) noexcept { _storage.set_stream(stream); } diff --git a/include/rmm/exec_policy.hpp b/include/rmm/exec_policy.hpp index 015c3646d..2af332971 100644 --- a/include/rmm/exec_policy.hpp +++ b/include/rmm/exec_policy.hpp @@ -30,6 +30,9 @@ namespace rmm { +/** + * @brief Synchronous execution policy for allocations using thrust + */ using thrust_exec_policy_t = thrust::detail::execute_with_allocator, thrust::cuda_cub::execute_on_stream_base>; @@ -40,6 +43,12 @@ using thrust_exec_policy_t = */ class exec_policy : public thrust_exec_policy_t { public: + /** + * @brief Construct a new execution policy object + * + * @param stream The stream on which to allocate temporary memory + * @param mr The resource to use for allocating temporary memory + */ explicit exec_policy(cuda_stream_view stream = cuda_stream_default, rmm::mr::device_memory_resource* mr = mr::get_current_device_resource()) : thrust_exec_policy_t( @@ -50,6 +59,9 @@ class exec_policy : public thrust_exec_policy_t { #if THRUST_VERSION >= 101600 +/** + * @brief Asynchronous execution policy for allocations using thrust + */ using thrust_exec_policy_nosync_t = thrust::detail::execute_with_allocator, thrust::cuda_cub::execute_on_stream_nosync_base>; @@ -72,9 +84,11 @@ class exec_policy_nosync : public thrust_exec_policy_nosync_t { #else -using thrust_exec_policy_nosync_t = thrust_exec_policy_t; -using exec_policy_nosync = exec_policy; - +using thrust_exec_policy_nosync_t = + thrust_exec_policy_t; ///< When used with Thrust < 1.16.0, thrust_exec_policy_nosync_t is an + ///< alias for thrust_exec_policy_t +using exec_policy_nosync = + exec_policy; ///< When used with Thrust < 1.16.0, exec_policy_nosync is an alias for exec_policy #endif } // namespace rmm diff --git a/include/rmm/logger.hpp b/include/rmm/logger.hpp index d0d6f8fa4..f8fbd4c92 100644 --- a/include/rmm/logger.hpp +++ b/include/rmm/logger.hpp @@ -43,9 +43,11 @@ inline std::string default_log_filename() return (filename == nullptr) ? std::string{"rmm_log.txt"} : std::string{filename}; } -// Simple wrapper around a spdlog::logger that performs RMM-specific initialization +/** + * @brief Simple wrapper around a spdlog::logger that performs RMM-specific initialization + */ struct logger_wrapper { - spdlog::logger logger_; + spdlog::logger logger_; ///< The underlying logger logger_wrapper() : logger_{"RMM", @@ -70,8 +72,14 @@ struct logger_wrapper { * @brief Represent a size in number of bytes. */ struct bytes { - std::size_t value; - + std::size_t value; ///< The size in bytes + + /** + * @brief Construct a new bytes object + * + * @param os The output stream + * @param value The size in bytes + */ friend std::ostream& operator<<(std::ostream& os, bytes const& value) { static std::array units{"B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"}; diff --git a/include/rmm/mr/device/callback_memory_resource.hpp b/include/rmm/mr/device/callback_memory_resource.hpp index 1937e7ef0..2d9695be2 100644 --- a/include/rmm/mr/device/callback_memory_resource.hpp +++ b/include/rmm/mr/device/callback_memory_resource.hpp @@ -90,12 +90,14 @@ class callback_memory_resource final : public device_memory_resource { { } - callback_memory_resource() = delete; - ~callback_memory_resource() override = default; - callback_memory_resource(callback_memory_resource const&) = delete; - callback_memory_resource& operator=(callback_memory_resource const&) = delete; - callback_memory_resource(callback_memory_resource&&) noexcept = default; - callback_memory_resource& operator=(callback_memory_resource&&) noexcept = default; + callback_memory_resource() = delete; + ~callback_memory_resource() override = default; + callback_memory_resource(callback_memory_resource const&) = delete; + callback_memory_resource& operator=(callback_memory_resource const&) = delete; + callback_memory_resource(callback_memory_resource&&) noexcept = + default; ///< @default_move_constructor + callback_memory_resource& operator=(callback_memory_resource&&) noexcept = + default; ///< @default_move_assignment{callback_memory_resource} private: void* do_allocate(std::size_t bytes, cuda_stream_view stream) override diff --git a/include/rmm/mr/device/cuda_async_view_memory_resource.hpp b/include/rmm/mr/device/cuda_async_view_memory_resource.hpp index 191e4741d..806ace807 100644 --- a/include/rmm/mr/device/cuda_async_view_memory_resource.hpp +++ b/include/rmm/mr/device/cuda_async_view_memory_resource.hpp @@ -77,11 +77,15 @@ class cuda_async_view_memory_resource final : public device_memory_resource { [[nodiscard]] cudaMemPool_t pool_handle() const noexcept { return cuda_pool_handle_; } #endif - cuda_async_view_memory_resource() = default; - cuda_async_view_memory_resource(cuda_async_view_memory_resource const&) = default; - cuda_async_view_memory_resource(cuda_async_view_memory_resource&&) = default; - cuda_async_view_memory_resource& operator=(cuda_async_view_memory_resource const&) = default; - cuda_async_view_memory_resource& operator=(cuda_async_view_memory_resource&&) = default; + cuda_async_view_memory_resource() = default; + cuda_async_view_memory_resource(cuda_async_view_memory_resource const&) = + default; ///< @default_copy_constructor + cuda_async_view_memory_resource(cuda_async_view_memory_resource&&) = + default; ///< @default_move_constructor + cuda_async_view_memory_resource& operator=(cuda_async_view_memory_resource const&) = + default; ///< @default_copy_assignment{cuda_async_view_memory_resource} + cuda_async_view_memory_resource& operator=(cuda_async_view_memory_resource&&) = + default; ///< @default_move_assignment{cuda_async_view_memory_resource} /** * @brief Query whether the resource supports use of non-null CUDA streams for diff --git a/include/rmm/mr/device/cuda_memory_resource.hpp b/include/rmm/mr/device/cuda_memory_resource.hpp index 7a5385f4e..b0bf9ae09 100644 --- a/include/rmm/mr/device/cuda_memory_resource.hpp +++ b/include/rmm/mr/device/cuda_memory_resource.hpp @@ -29,12 +29,14 @@ namespace rmm::mr { */ class cuda_memory_resource final : public device_memory_resource { public: - cuda_memory_resource() = default; - ~cuda_memory_resource() override = default; - cuda_memory_resource(cuda_memory_resource const&) = default; - cuda_memory_resource(cuda_memory_resource&&) = default; - cuda_memory_resource& operator=(cuda_memory_resource const&) = default; - cuda_memory_resource& operator=(cuda_memory_resource&&) = default; + cuda_memory_resource() = default; + ~cuda_memory_resource() override = default; + cuda_memory_resource(cuda_memory_resource const&) = default; ///< @default_copy_constructor + cuda_memory_resource(cuda_memory_resource&&) = default; ///< @default_move_constructor + cuda_memory_resource& operator=(cuda_memory_resource const&) = + default; ///< @default_copy_assignment{cuda_memory_resource} + cuda_memory_resource& operator=(cuda_memory_resource&&) = + default; ///< @default_move_assignment{cuda_memory_resource} /** * @brief Query whether the resource supports use of non-null CUDA streams for diff --git a/include/rmm/mr/device/device_memory_resource.hpp b/include/rmm/mr/device/device_memory_resource.hpp index 4778d9bda..6f3bd943a 100644 --- a/include/rmm/mr/device/device_memory_resource.hpp +++ b/include/rmm/mr/device/device_memory_resource.hpp @@ -81,12 +81,15 @@ namespace rmm::mr { */ class device_memory_resource { public: - device_memory_resource() = default; - virtual ~device_memory_resource() = default; - device_memory_resource(device_memory_resource const&) = default; - device_memory_resource& operator=(device_memory_resource const&) = default; - device_memory_resource(device_memory_resource&&) noexcept = default; - device_memory_resource& operator=(device_memory_resource&&) noexcept = default; + device_memory_resource() = default; + virtual ~device_memory_resource() = default; + device_memory_resource(device_memory_resource const&) = default; ///< @default_copy_constructor + device_memory_resource(device_memory_resource&&) noexcept = + default; ///< @default_move_constructor + device_memory_resource& operator=(device_memory_resource const&) = + default; ///< @default_copy_assignment{device_memory_resource} + device_memory_resource& operator=(device_memory_resource&&) noexcept = + default; ///< @default_move_assignment{device_memory_resource} /** * @brief Allocates memory of size at least \p bytes. @@ -121,7 +124,7 @@ class device_memory_resource { * * @throws Nothing. * - * @param p Pointer to be deallocated + * @param ptr Pointer to be deallocated * @param bytes The size in bytes of the allocation. This must be equal to the * value of `bytes` that was passed to the `allocate` call that returned `p`. * @param stream Stream on which to perform deallocation diff --git a/include/rmm/mr/device/failure_callback_resource_adaptor.hpp b/include/rmm/mr/device/failure_callback_resource_adaptor.hpp index 4a46cb660..48f0513d8 100644 --- a/include/rmm/mr/device/failure_callback_resource_adaptor.hpp +++ b/include/rmm/mr/device/failure_callback_resource_adaptor.hpp @@ -109,14 +109,13 @@ class failure_callback_resource_adaptor final : public device_memory_resource { ~failure_callback_resource_adaptor() override = default; failure_callback_resource_adaptor(failure_callback_resource_adaptor const&) = delete; failure_callback_resource_adaptor& operator=(failure_callback_resource_adaptor const&) = delete; - failure_callback_resource_adaptor(failure_callback_resource_adaptor&&) noexcept = default; + failure_callback_resource_adaptor(failure_callback_resource_adaptor&&) noexcept = + default; ///< @default_move_constructor failure_callback_resource_adaptor& operator=(failure_callback_resource_adaptor&&) noexcept = - default; + default; ///< @default_move_assignment{failure_callback_resource_adaptor} /** - * @brief Return pointer to the upstream resource. - * - * @return Upstream* Pointer to the upstream resource. + * @briefreturn{Pointer to the upstream resource} */ Upstream* get_upstream() const noexcept { return upstream_; } diff --git a/include/rmm/mr/device/fixed_size_memory_resource.hpp b/include/rmm/mr/device/fixed_size_memory_resource.hpp index 4954415c3..173c23a0c 100644 --- a/include/rmm/mr/device/fixed_size_memory_resource.hpp +++ b/include/rmm/mr/device/fixed_size_memory_resource.hpp @@ -50,10 +50,10 @@ class fixed_size_memory_resource friend class detail::stream_ordered_memory_resource, detail::fixed_size_free_list>; - // A block is the fixed size this resource alloates - static constexpr std::size_t default_block_size = 1 << 20; // 1 MiB - // This is the number of blocks that the pool starts out with, and also the number of - // blocks by which the pool grows when all of its current blocks are allocated + static constexpr std::size_t default_block_size = 1 << 20; ///< Default allocation block size + + /// The number of blocks that the pool starts out with, and also the number of + /// blocks by which the pool grows when all of its current blocks are allocated static constexpr std::size_t default_blocks_to_preallocate = 128; /** @@ -121,11 +121,11 @@ class fixed_size_memory_resource [[nodiscard]] std::size_t get_block_size() const noexcept { return block_size_; } protected: - using free_list = detail::fixed_size_free_list; - using block_type = free_list::block_type; + using free_list = detail::fixed_size_free_list; ///< The free list type + using block_type = free_list::block_type; ///< The type of block managed by the free list using typename detail::stream_ordered_memory_resource, detail::fixed_size_free_list>::split_block; - using lock_guard = std::lock_guard; + using lock_guard = std::lock_guard; ///< Type of lock used to synchronize access /** * @brief Get the (fixed) size of allocations supported by this memory resource @@ -142,6 +142,7 @@ class fixed_size_memory_resource * strategy (see `size_to_grow()`). * * @param size The minimum size to allocate + * @param blocks The set of blocks from which to allocate * @param stream The stream on which the memory is to be used. * @return block_type The allocated block */ @@ -154,7 +155,6 @@ class fixed_size_memory_resource /** * @brief Allocate blocks from upstream to expand the suballocation pool. * - * @param size The minimum size to allocate * @param stream The stream on which the memory is to be used. * @return block_type The allocated block */ @@ -182,7 +182,6 @@ class fixed_size_memory_resource * * @param block The block to allocate from. * @param size The size in bytes of the requested allocation. - * @param stream_event The stream and associated event on which the allocation will be used. * @return A pair comprising the allocated pointer and any unallocated remainder of the input * block. */ @@ -196,7 +195,6 @@ class fixed_size_memory_resource * * @param ptr The pointer to the memory to free. * @param size The size of the memory to free. Must be equal to the original allocation size. - * @param stream The stream-event pair for the stream on which the memory was last used. * @return The (now freed) block associated with `p`. The caller is expected to return the block * to the pool. */ @@ -217,7 +215,8 @@ class fixed_size_memory_resource * @param stream the stream being executed on * @return std::pair with available and free memory for resource */ - [[nodiscard]] std::pair do_get_mem_info(cuda_stream_view) const override + [[nodiscard]] std::pair do_get_mem_info( + [[maybe_unused]] cuda_stream_view stream) const override { return std::make_pair(0, 0); } diff --git a/include/rmm/mr/device/limiting_resource_adaptor.hpp b/include/rmm/mr/device/limiting_resource_adaptor.hpp index 6d1843e82..895c404b0 100644 --- a/include/rmm/mr/device/limiting_resource_adaptor.hpp +++ b/include/rmm/mr/device/limiting_resource_adaptor.hpp @@ -44,7 +44,8 @@ class limiting_resource_adaptor final : public device_memory_resource { * @throws `rmm::logic_error` if `upstream == nullptr` * * @param upstream The resource used for allocating/deallocating device memory - * @param allocation_limit Maximum memory allowed for this allocator. + * @param allocation_limit Maximum memory allowed for this allocator + * @param alignment Alignment in bytes for the start of each allocated buffer */ limiting_resource_adaptor(Upstream* upstream, std::size_t allocation_limit, @@ -57,17 +58,17 @@ class limiting_resource_adaptor final : public device_memory_resource { RMM_EXPECTS(nullptr != upstream, "Unexpected null upstream resource pointer."); } - limiting_resource_adaptor() = delete; - ~limiting_resource_adaptor() override = default; - limiting_resource_adaptor(limiting_resource_adaptor const&) = delete; - limiting_resource_adaptor(limiting_resource_adaptor&&) noexcept = default; - limiting_resource_adaptor& operator=(limiting_resource_adaptor const&) = delete; - limiting_resource_adaptor& operator=(limiting_resource_adaptor&&) noexcept = default; + limiting_resource_adaptor() = delete; + ~limiting_resource_adaptor() override = default; + limiting_resource_adaptor(limiting_resource_adaptor const&) = delete; + limiting_resource_adaptor(limiting_resource_adaptor&&) noexcept = + default; ///< @default_move_constructor + limiting_resource_adaptor& operator=(limiting_resource_adaptor const&) = delete; + limiting_resource_adaptor& operator=(limiting_resource_adaptor&&) noexcept = + default; ///< @default_move_assignment{limiting_resource_adaptor} /** - * @brief Return pointer to the upstream resource. - * - * @return Upstream* Pointer to the upstream resource. + * @briefreturn{Pointer to the upstream resource} */ [[nodiscard]] Upstream* get_upstream() const noexcept { return upstream_; } diff --git a/include/rmm/mr/device/logging_resource_adaptor.hpp b/include/rmm/mr/device/logging_resource_adaptor.hpp index 71487705a..cdb527405 100644 --- a/include/rmm/mr/device/logging_resource_adaptor.hpp +++ b/include/rmm/mr/device/logging_resource_adaptor.hpp @@ -98,6 +98,20 @@ class logging_resource_adaptor final : public device_memory_resource { init_logger(auto_flush); } + /** + * @brief Construct a new logging resource adaptor using `upstream` to satisfy + * allocation requests and logging information about each allocation/free to + * the ostream specified by `stream`. + * + * The logfile will be written using CSV formatting. + * + * @throws `rmm::logic_error` if `upstream == nullptr` + * + * @param upstream The resource used for allocating/deallocating device memory + * @param sinks A list of logging sinks to which log output will be written. + * @param auto_flush If true, flushes the log for every (de)allocation. Warning, this will degrade + * performance. + */ logging_resource_adaptor(Upstream* upstream, spdlog::sinks_init_list sinks, bool auto_flush = false) @@ -108,12 +122,14 @@ class logging_resource_adaptor final : public device_memory_resource { init_logger(auto_flush); } - logging_resource_adaptor() = delete; - ~logging_resource_adaptor() override = default; - logging_resource_adaptor(logging_resource_adaptor const&) = delete; - logging_resource_adaptor& operator=(logging_resource_adaptor const&) = delete; - logging_resource_adaptor(logging_resource_adaptor&&) noexcept = default; - logging_resource_adaptor& operator=(logging_resource_adaptor&&) noexcept = default; + logging_resource_adaptor() = delete; + ~logging_resource_adaptor() override = default; + logging_resource_adaptor(logging_resource_adaptor const&) = delete; + logging_resource_adaptor& operator=(logging_resource_adaptor const&) = delete; + logging_resource_adaptor(logging_resource_adaptor&&) noexcept = + default; ///< @default_move_constructor + logging_resource_adaptor& operator=(logging_resource_adaptor&&) noexcept = + default; ///< @default_move_assignment{logging_resource_adaptor} /** * @brief Return pointer to the upstream resource. diff --git a/include/rmm/mr/device/managed_memory_resource.hpp b/include/rmm/mr/device/managed_memory_resource.hpp index 50317720a..4a0f7701a 100644 --- a/include/rmm/mr/device/managed_memory_resource.hpp +++ b/include/rmm/mr/device/managed_memory_resource.hpp @@ -29,12 +29,14 @@ namespace rmm::mr { */ class managed_memory_resource final : public device_memory_resource { public: - managed_memory_resource() = default; - ~managed_memory_resource() override = default; - managed_memory_resource(managed_memory_resource const&) = default; - managed_memory_resource(managed_memory_resource&&) = default; - managed_memory_resource& operator=(managed_memory_resource const&) = default; - managed_memory_resource& operator=(managed_memory_resource&&) = default; + managed_memory_resource() = default; + ~managed_memory_resource() override = default; + managed_memory_resource(managed_memory_resource const&) = default; ///< @default_copy_constructor + managed_memory_resource(managed_memory_resource&&) = default; ///< @default_move_constructor + managed_memory_resource& operator=(managed_memory_resource const&) = + default; ///< @default_copy_assignment{managed_memory_resource} + managed_memory_resource& operator=(managed_memory_resource&&) = + default; ///< @default_move_assignment{managed_memory_resource} /** * @brief Query whether the resource supports use of non-null streams for diff --git a/include/rmm/mr/device/owning_wrapper.hpp b/include/rmm/mr/device/owning_wrapper.hpp index d7c7b8c46..eca0b3207 100644 --- a/include/rmm/mr/device/owning_wrapper.hpp +++ b/include/rmm/mr/device/owning_wrapper.hpp @@ -73,7 +73,8 @@ auto make_resource(std::tuple...> const& upstreams, A template class owning_wrapper : public device_memory_resource { public: - using upstream_tuple = std::tuple...>; + using upstream_tuple = + std::tuple...>; ///< Tuple of upstream memory resources /** * @brief Constructs the wrapped resource using the provided upstreams and any additional @@ -116,14 +117,12 @@ class owning_wrapper : public device_memory_resource { } /** - * @brief Returns a constant reference to the wrapped resource. - * + * @briefreturn{A constant reference to the wrapped resource} */ [[nodiscard]] Resource const& wrapped() const noexcept { return *wrapped_; } /** - * @brief Returns reference to the wrapped resource. - * + * @briefreturn{A reference to the wrapped resource} */ [[nodiscard]] Resource& wrapped() noexcept { return *wrapped_; } @@ -136,9 +135,7 @@ class owning_wrapper : public device_memory_resource { } /** - * @brief Query whether the resource supports the get_mem_info API. - * - * @return true if the wrapped resource supports get_mem_info, false otherwise. + * @briefreturn{true if the wrapped resource supports get_mem_info, false otherwise} */ [[nodiscard]] bool supports_get_mem_info() const noexcept override { diff --git a/include/rmm/mr/device/per_device_resource.hpp b/include/rmm/mr/device/per_device_resource.hpp index 4ddbd874a..371c97fdf 100644 --- a/include/rmm/mr/device/per_device_resource.hpp +++ b/include/rmm/mr/device/per_device_resource.hpp @@ -88,13 +88,19 @@ inline device_memory_resource* initial_resource() return &mr; } +/** + * @briefreturn{Reference to the lock} + */ inline std::mutex& map_lock() { static std::mutex map_lock; return map_lock; } -// Must have default visibility, see: https://github.com/rapidsai/rmm/issues/826 +// This symbol must have default visibility, see: https://github.com/rapidsai/rmm/issues/826 +/** + * @briefreturn{Reference to the map from device id -> resource} + */ RMM_EXPORT inline auto& get_map() { static std::map device_id_to_resource; @@ -121,7 +127,7 @@ RMM_EXPORT inline auto& get_map() * undefined if used while the active CUDA device is a different device from the one that was active * when the device_memory_resource was created. * - * @param id The id of the target device + * @param device_id The id of the target device * @return Pointer to the current `device_memory_resource` for device `id` */ inline device_memory_resource* get_per_device_resource(cuda_device_id device_id) @@ -156,7 +162,7 @@ inline device_memory_resource* get_per_device_resource(cuda_device_id device_id) * undefined if used while the active CUDA device is a different device from the one that was active * when the device_memory_resource was created. * - * @param id The id of the target device + * @param device_id The id of the target device * @param new_mr If not `nullptr`, pointer to new `device_memory_resource` to use as new resource * for `id` * @return Pointer to the previous memory resource for `id` diff --git a/include/rmm/mr/device/polymorphic_allocator.hpp b/include/rmm/mr/device/polymorphic_allocator.hpp index 5c87ef7f7..a52ec14d1 100644 --- a/include/rmm/mr/device/polymorphic_allocator.hpp +++ b/include/rmm/mr/device/polymorphic_allocator.hpp @@ -43,7 +43,7 @@ namespace rmm::mr { template class polymorphic_allocator { public: - using value_type = T; + using value_type = T; ///< T, the value type of objects allocated by this allocator /** * @brief Construct a `polymorphic_allocator` using the return value of * `rmm::mr::get_current_device_resource()` as the underlying memory resource. @@ -148,7 +148,9 @@ bool operator!=(polymorphic_allocator const& lhs, polymorphic_allocator co template class stream_allocator_adaptor { public: - using value_type = typename std::allocator_traits::value_type; + using value_type = + typename std::allocator_traits::value_type; ///< The value type of objects allocated + ///< by this allocator stream_allocator_adaptor() = delete; @@ -187,8 +189,8 @@ class stream_allocator_adaptor { */ template struct rebind { - using other = - stream_allocator_adaptor::template rebind_alloc>; + using other = stream_allocator_adaptor::template rebind_alloc>; ///< The type to bind to }; /** @@ -212,14 +214,12 @@ class stream_allocator_adaptor { void deallocate(value_type* ptr, std::size_t num) { alloc_.deallocate(ptr, num, stream()); } /** - * @brief Returns the underlying stream on which calls to the underlying allocator are made. - * + * @briefreturn{The stream on which calls to the underlying allocator are made} */ [[nodiscard]] cuda_stream_view stream() const noexcept { return stream_; } /** - * @brief Returns the underlying stream-ordered allocator - * + * @briefreturn{The underlying allocator} */ [[nodiscard]] Allocator underlying_allocator() const noexcept { return alloc_; } diff --git a/include/rmm/mr/device/pool_memory_resource.hpp b/include/rmm/mr/device/pool_memory_resource.hpp index 8955fd958..703ce8ea7 100644 --- a/include/rmm/mr/device/pool_memory_resource.hpp +++ b/include/rmm/mr/device/pool_memory_resource.hpp @@ -143,11 +143,11 @@ class pool_memory_resource final [[nodiscard]] std::size_t pool_size() const noexcept { return current_pool_size_; } protected: - using free_list = detail::coalescing_free_list; - using block_type = free_list::block_type; + using free_list = detail::coalescing_free_list; ///< The free list implementation + using block_type = free_list::block_type; ///< The type of block returned by the free list using typename detail::stream_ordered_memory_resource, detail::coalescing_free_list>::split_block; - using lock_guard = std::lock_guard; + using lock_guard = std::lock_guard; ///< Type of lock used to synchronize access /** * @brief Get the maximum size of allocations supported by this memory resource @@ -306,7 +306,6 @@ class pool_memory_resource final * * @param block The block to allocate from. * @param size The size in bytes of the requested allocation. - * @param stream_event The stream and associated event on which the allocation will be used. * @return A pair comprising the allocated pointer and any unallocated remainder of the input * block. */ @@ -329,7 +328,6 @@ class pool_memory_resource final * * @param ptr The pointer to the memory to free. * @param size The size of the memory to free. Must be equal to the original allocation size. - * @param stream The stream-event pair for the stream on which the memory was last used. * @return The (now freed) block associated with `p`. The caller is expected to return the block * to the pool. */ diff --git a/include/rmm/mr/device/statistics_resource_adaptor.hpp b/include/rmm/mr/device/statistics_resource_adaptor.hpp index c3fe3010f..7af75593d 100644 --- a/include/rmm/mr/device/statistics_resource_adaptor.hpp +++ b/include/rmm/mr/device/statistics_resource_adaptor.hpp @@ -40,17 +40,24 @@ template class statistics_resource_adaptor final : public device_memory_resource { public: // can be a std::shared_mutex once C++17 is adopted - using read_lock_t = std::shared_lock; - using write_lock_t = std::unique_lock; - + using read_lock_t = + std::shared_lock; ///< Type of lock used to synchronize read access + using write_lock_t = + std::unique_lock; ///< Type of lock used to synchronize write access /** * @brief Utility struct for counting the current, peak, and total value of a number */ struct counter { - int64_t value{0}; // Current value - int64_t peak{0}; // Max value of `value` - int64_t total{0}; // Sum of all added values + int64_t value{0}; ///< Current value + int64_t peak{0}; ///< Max value of `value` + int64_t total{0}; ///< Sum of all added values + /** + * @brief Add `val` to the current value and update the peak value if necessary + * + * @param val Value to add + * @return Reference to this object + */ counter& operator+=(int64_t val) { value += val; @@ -59,6 +66,12 @@ class statistics_resource_adaptor final : public device_memory_resource { return *this; } + /** + * @brief Subtract `val` from the current value and update the peak value if necessary + * + * @param val Value to subtract + * @return Reference to this object + */ counter& operator-=(int64_t val) { value -= val; @@ -79,17 +92,17 @@ class statistics_resource_adaptor final : public device_memory_resource { RMM_EXPECTS(nullptr != upstream, "Unexpected null upstream resource pointer."); } - statistics_resource_adaptor() = delete; - ~statistics_resource_adaptor() override = default; - statistics_resource_adaptor(statistics_resource_adaptor const&) = delete; - statistics_resource_adaptor& operator=(statistics_resource_adaptor const&) = delete; - statistics_resource_adaptor(statistics_resource_adaptor&&) noexcept = default; - statistics_resource_adaptor& operator=(statistics_resource_adaptor&&) noexcept = default; + statistics_resource_adaptor() = delete; + ~statistics_resource_adaptor() override = default; + statistics_resource_adaptor(statistics_resource_adaptor const&) = delete; + statistics_resource_adaptor& operator=(statistics_resource_adaptor const&) = delete; + statistics_resource_adaptor(statistics_resource_adaptor&&) noexcept = + default; ///< @default_move_constructor + statistics_resource_adaptor& operator=(statistics_resource_adaptor&&) noexcept = + default; ///< @default_move_assignment{statistics_resource_adaptor} /** - * @brief Return pointer to the upstream resource. - * - * @return Upstream* Pointer to the upstream resource. + * @briefreturn{Pointer to the upstream resource} */ Upstream* get_upstream() const noexcept { return upstream_; } diff --git a/include/rmm/mr/device/thread_safe_resource_adaptor.hpp b/include/rmm/mr/device/thread_safe_resource_adaptor.hpp index 37053cd07..0b8570985 100644 --- a/include/rmm/mr/device/thread_safe_resource_adaptor.hpp +++ b/include/rmm/mr/device/thread_safe_resource_adaptor.hpp @@ -35,7 +35,7 @@ namespace rmm::mr { template class thread_safe_resource_adaptor final : public device_memory_resource { public: - using lock_t = std::lock_guard; + using lock_t = std::lock_guard; ///< Type of lock used to synchronize access /** * @brief Construct a new thread safe resource adaptor using `upstream` to satisfy diff --git a/include/rmm/mr/device/thrust_allocator_adaptor.hpp b/include/rmm/mr/device/thrust_allocator_adaptor.hpp index 2b2aee0dd..de2f25043 100644 --- a/include/rmm/mr/device/thrust_allocator_adaptor.hpp +++ b/include/rmm/mr/device/thrust_allocator_adaptor.hpp @@ -38,9 +38,9 @@ namespace rmm::mr { template class thrust_allocator : public thrust::device_malloc_allocator { public: - using Base = thrust::device_malloc_allocator; - using pointer = typename Base::pointer; - using size_type = typename Base::size_type; + using Base = thrust::device_malloc_allocator; ///< The base type of this allocator + using pointer = typename Base::pointer; ///< The pointer type + using size_type = typename Base::size_type; ///< The size type /** * @brief Provides the type of a `thrust_allocator` instantiated with another @@ -50,7 +50,7 @@ class thrust_allocator : public thrust::device_malloc_allocator { */ template struct rebind { - using other = thrust_allocator; + using other = thrust_allocator; ///< The type to bind to }; /** @@ -113,12 +113,12 @@ class thrust_allocator : public thrust::device_malloc_allocator { } /** - * @brief Returns the device memory resource used by this allocator. + * @briefreturn{The device memory resource used by this} */ [[nodiscard]] device_memory_resource* resource() const noexcept { return _mr; } /** - * @brief Returns the stream used by this allocator. + * @briefreturn{The stream used by this allocator} */ [[nodiscard]] cuda_stream_view stream() const noexcept { return _stream; } diff --git a/include/rmm/mr/device/tracking_resource_adaptor.hpp b/include/rmm/mr/device/tracking_resource_adaptor.hpp index 0bbdc7468..b87218d12 100644 --- a/include/rmm/mr/device/tracking_resource_adaptor.hpp +++ b/include/rmm/mr/device/tracking_resource_adaptor.hpp @@ -48,9 +48,10 @@ template class tracking_resource_adaptor final : public device_memory_resource { public: // can be a std::shared_mutex once C++17 is adopted - using read_lock_t = std::shared_lock; - using write_lock_t = std::unique_lock; - + using read_lock_t = + std::shared_lock; ///< Type of lock used to synchronize read access + using write_lock_t = + std::unique_lock; ///< Type of lock used to synchronize write access /** * @brief Information stored about an allocation. Includes the size * and a stack trace if the `tracking_resource_adaptor` was initialized @@ -58,10 +59,16 @@ class tracking_resource_adaptor final : public device_memory_resource { * */ struct allocation_info { - std::unique_ptr strace; - std::size_t allocation_size; + std::unique_ptr strace; ///< Stack trace of the allocation + std::size_t allocation_size; ///< Size of the allocation allocation_info() = delete; + /** + * @brief Construct a new allocation info object + * + * @param size Size of the allocation + * @param capture_stack If true, capture the stack trace for the allocation + */ allocation_info(std::size_t size, bool capture_stack) : strace{[&]() { return capture_stack ? std::make_unique() : nullptr; @@ -84,17 +91,17 @@ class tracking_resource_adaptor final : public device_memory_resource { RMM_EXPECTS(nullptr != upstream, "Unexpected null upstream resource pointer."); } - tracking_resource_adaptor() = delete; - ~tracking_resource_adaptor() override = default; - tracking_resource_adaptor(tracking_resource_adaptor const&) = delete; - tracking_resource_adaptor& operator=(tracking_resource_adaptor const&) = delete; - tracking_resource_adaptor(tracking_resource_adaptor&&) noexcept = default; - tracking_resource_adaptor& operator=(tracking_resource_adaptor&&) noexcept = default; + tracking_resource_adaptor() = delete; + ~tracking_resource_adaptor() override = default; + tracking_resource_adaptor(tracking_resource_adaptor const&) = delete; + tracking_resource_adaptor(tracking_resource_adaptor&&) noexcept = + default; ///< @default_move_constructor + tracking_resource_adaptor& operator=(tracking_resource_adaptor const&) = delete; + tracking_resource_adaptor& operator=(tracking_resource_adaptor&&) noexcept = + default; ///< @default_move_assignment{tracking_resource_adaptor} /** - * @brief Return pointer to the upstream resource. - * - * @return Upstream* Pointer to the upstream resource. + * @briefreturn{Pointer to the upstream resource} */ Upstream* get_upstream() const noexcept { return upstream_; } diff --git a/include/rmm/mr/host/host_memory_resource.hpp b/include/rmm/mr/host/host_memory_resource.hpp index c0fe85594..3279bfb3f 100644 --- a/include/rmm/mr/host/host_memory_resource.hpp +++ b/include/rmm/mr/host/host_memory_resource.hpp @@ -46,12 +46,14 @@ namespace rmm::mr { */ class host_memory_resource { public: - host_memory_resource() = default; - virtual ~host_memory_resource() = default; - host_memory_resource(host_memory_resource const&) = default; - host_memory_resource& operator=(host_memory_resource const&) = default; - host_memory_resource(host_memory_resource&&) noexcept = default; - host_memory_resource& operator=(host_memory_resource&&) noexcept = default; + host_memory_resource() = default; + virtual ~host_memory_resource() = default; + host_memory_resource(host_memory_resource const&) = default; ///< @default_copy_constructor + host_memory_resource(host_memory_resource&&) noexcept = default; ///< @default_move_constructor + host_memory_resource& operator=(host_memory_resource const&) = + default; ///< @default_copy_assignment{host_memory_resource} + host_memory_resource& operator=(host_memory_resource&&) noexcept = + default; ///< @default_move_assignment{host_memory_resource} /** * @brief Allocates memory on the host of size at least `bytes` bytes. @@ -84,7 +86,6 @@ class host_memory_resource { * that was passed to the `allocate` call that returned `ptr`. * @param alignment Alignment of the allocation. This must be equal to the value of `alignment` * that was passed to the `allocate` call that returned `ptr`. - * @param stream Stream on which to perform deallocation */ void deallocate(void* ptr, std::size_t bytes, std::size_t alignment = alignof(std::max_align_t)) { diff --git a/include/rmm/mr/host/new_delete_resource.hpp b/include/rmm/mr/host/new_delete_resource.hpp index ffd3345bb..68cccc320 100644 --- a/include/rmm/mr/host/new_delete_resource.hpp +++ b/include/rmm/mr/host/new_delete_resource.hpp @@ -30,12 +30,14 @@ namespace rmm::mr { */ class new_delete_resource final : public host_memory_resource { public: - new_delete_resource() = default; - ~new_delete_resource() override = default; - new_delete_resource(new_delete_resource const&) = default; - new_delete_resource(new_delete_resource&&) = default; - new_delete_resource& operator=(new_delete_resource const&) = default; - new_delete_resource& operator=(new_delete_resource&&) = default; + new_delete_resource() = default; + ~new_delete_resource() override = default; + new_delete_resource(new_delete_resource const&) = default; ///< @default_copy_constructor + new_delete_resource(new_delete_resource&&) = default; ///< @default_move_constructor + new_delete_resource& operator=(new_delete_resource const&) = + default; ///< @default_copy_assignment{new_delete_resource} + new_delete_resource& operator=(new_delete_resource&&) = + default; ///< @default_move_assignment{new_delete_resource} private: /** diff --git a/include/rmm/mr/host/pinned_memory_resource.hpp b/include/rmm/mr/host/pinned_memory_resource.hpp index 3e0c5e3e6..fb28ebfb7 100644 --- a/include/rmm/mr/host/pinned_memory_resource.hpp +++ b/include/rmm/mr/host/pinned_memory_resource.hpp @@ -24,7 +24,7 @@ namespace rmm::mr { -/* +/** * @brief A `host_memory_resource` that uses `cudaMallocHost` to allocate * pinned/page-locked host memory. * @@ -32,12 +32,14 @@ namespace rmm::mr { */ class pinned_memory_resource final : public host_memory_resource { public: - pinned_memory_resource() = default; - ~pinned_memory_resource() override = default; - pinned_memory_resource(pinned_memory_resource const&) = default; - pinned_memory_resource(pinned_memory_resource&&) = default; - pinned_memory_resource& operator=(pinned_memory_resource const&) = default; - pinned_memory_resource& operator=(pinned_memory_resource&&) = default; + pinned_memory_resource() = default; + ~pinned_memory_resource() override = default; + pinned_memory_resource(pinned_memory_resource const&) = default; ///< @default_copy_constructor + pinned_memory_resource(pinned_memory_resource&&) = default; ///< @default_move_constructor + pinned_memory_resource& operator=(pinned_memory_resource const&) = + default; ///< @default_copy_assignment{pinned_memory_resource} + pinned_memory_resource& operator=(pinned_memory_resource&&) = + default; ///< @default_move_assignment{pinned_memory_resource} private: /**