From b1d629684534f8f2a89ab03129c9adf22ef598d1 Mon Sep 17 00:00:00 2001 From: Felix Kallenborn Date: Tue, 9 Aug 2022 09:40:23 +0200 Subject: [PATCH 1/3] Avoid unused parameter warnings in do_get_mem_info --- include/rmm/mr/device/arena_memory_resource.hpp | 2 +- include/rmm/mr/device/binning_memory_resource.hpp | 2 +- include/rmm/mr/device/fixed_size_memory_resource.hpp | 2 +- include/rmm/mr/device/limiting_resource_adaptor.hpp | 2 +- include/rmm/mr/device/managed_memory_resource.hpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/rmm/mr/device/arena_memory_resource.hpp b/include/rmm/mr/device/arena_memory_resource.hpp index f1b4e40c4..1b1043b4a 100644 --- a/include/rmm/mr/device/arena_memory_resource.hpp +++ b/include/rmm/mr/device/arena_memory_resource.hpp @@ -293,7 +293,7 @@ class arena_memory_resource final : public device_memory_resource { * @param stream to execute on. * @return std::pair containing free_size and total_size of memory. */ - std::pair do_get_mem_info(cuda_stream_view stream) const override + std::pair do_get_mem_info(cuda_stream_view) const override { return std::make_pair(0, 0); } diff --git a/include/rmm/mr/device/binning_memory_resource.hpp b/include/rmm/mr/device/binning_memory_resource.hpp index fa8a9aa7c..4930ab2cd 100644 --- a/include/rmm/mr/device/binning_memory_resource.hpp +++ b/include/rmm/mr/device/binning_memory_resource.hpp @@ -202,7 +202,7 @@ class binning_memory_resource final : public device_memory_resource { * @return std::pair with available and free memory for resource */ [[nodiscard]] std::pair do_get_mem_info( - cuda_stream_view stream) const override + cuda_stream_view) const override { return std::make_pair(0, 0); } diff --git a/include/rmm/mr/device/fixed_size_memory_resource.hpp b/include/rmm/mr/device/fixed_size_memory_resource.hpp index 59b0b59b8..fc1405d12 100644 --- a/include/rmm/mr/device/fixed_size_memory_resource.hpp +++ b/include/rmm/mr/device/fixed_size_memory_resource.hpp @@ -216,7 +216,7 @@ class fixed_size_memory_resource * @return std::pair with available and free memory for resource */ [[nodiscard]] std::pair do_get_mem_info( - cuda_stream_view stream) const override + cuda_stream_view) 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 cdcee0857..30426dd56 100644 --- a/include/rmm/mr/device/limiting_resource_adaptor.hpp +++ b/include/rmm/mr/device/limiting_resource_adaptor.hpp @@ -185,7 +185,7 @@ class limiting_resource_adaptor final : public device_memory_resource { * @return std::pair contaiing free_size and total_size of memory */ [[nodiscard]] std::pair do_get_mem_info( - cuda_stream_view stream) const override + cuda_stream_view) const override { return {allocation_limit_ - allocated_bytes_, allocation_limit_}; } diff --git a/include/rmm/mr/device/managed_memory_resource.hpp b/include/rmm/mr/device/managed_memory_resource.hpp index 1bc917e0e..68a40f9a7 100644 --- a/include/rmm/mr/device/managed_memory_resource.hpp +++ b/include/rmm/mr/device/managed_memory_resource.hpp @@ -115,7 +115,7 @@ class managed_memory_resource final : public device_memory_resource { * @return std::pair contaiing free_size and total_size of memory */ [[nodiscard]] std::pair do_get_mem_info( - cuda_stream_view stream) const override + cuda_stream_view) const override { std::size_t free_size{}; std::size_t total_size{}; From 74440e68aa87141a83e8386bc950e6cc70db6d8e Mon Sep 17 00:00:00 2001 From: Felix Kallenborn Date: Tue, 20 Sep 2022 08:43:02 +0200 Subject: [PATCH 2/3] Formatting --- include/rmm/mr/device/arena_memory_resource.hpp | 6 +++--- include/rmm/mr/device/binning_memory_resource.hpp | 11 +++++------ .../rmm/mr/device/fixed_size_memory_resource.hpp | 11 +++++------ include/rmm/mr/device/limiting_resource_adaptor.hpp | 13 ++++++------- include/rmm/mr/device/managed_memory_resource.hpp | 13 ++++++------- 5 files changed, 25 insertions(+), 29 deletions(-) diff --git a/include/rmm/mr/device/arena_memory_resource.hpp b/include/rmm/mr/device/arena_memory_resource.hpp index 1b1043b4a..2935d0a77 100644 --- a/include/rmm/mr/device/arena_memory_resource.hpp +++ b/include/rmm/mr/device/arena_memory_resource.hpp @@ -99,9 +99,9 @@ class arena_memory_resource final : public device_memory_resource { ~arena_memory_resource() override = default; // Disable copy (and move) semantics. - arena_memory_resource(arena_memory_resource const&) = delete; - arena_memory_resource& operator=(arena_memory_resource const&) = delete; - arena_memory_resource(arena_memory_resource&&) noexcept = delete; + arena_memory_resource(arena_memory_resource const&) = delete; + arena_memory_resource& operator=(arena_memory_resource const&) = delete; + arena_memory_resource(arena_memory_resource&&) noexcept = delete; arena_memory_resource& operator=(arena_memory_resource&&) noexcept = delete; /** diff --git a/include/rmm/mr/device/binning_memory_resource.hpp b/include/rmm/mr/device/binning_memory_resource.hpp index 4930ab2cd..705df63c6 100644 --- a/include/rmm/mr/device/binning_memory_resource.hpp +++ b/include/rmm/mr/device/binning_memory_resource.hpp @@ -87,11 +87,11 @@ class binning_memory_resource final : public device_memory_resource { */ ~binning_memory_resource() override = default; - binning_memory_resource() = delete; - binning_memory_resource(binning_memory_resource const&) = delete; - binning_memory_resource(binning_memory_resource&&) = delete; + binning_memory_resource() = delete; + binning_memory_resource(binning_memory_resource const&) = delete; + binning_memory_resource(binning_memory_resource&&) = delete; binning_memory_resource& operator=(binning_memory_resource const&) = delete; - binning_memory_resource& operator=(binning_memory_resource&&) = delete; + binning_memory_resource& operator=(binning_memory_resource&&) = delete; /** * @brief Query whether the resource supports use of non-null streams for @@ -201,8 +201,7 @@ class binning_memory_resource final : public device_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(cuda_stream_view) const override { return std::make_pair(0, 0); } diff --git a/include/rmm/mr/device/fixed_size_memory_resource.hpp b/include/rmm/mr/device/fixed_size_memory_resource.hpp index fc1405d12..24c49aa40 100644 --- a/include/rmm/mr/device/fixed_size_memory_resource.hpp +++ b/include/rmm/mr/device/fixed_size_memory_resource.hpp @@ -83,11 +83,11 @@ class fixed_size_memory_resource */ ~fixed_size_memory_resource() override { release(); } - fixed_size_memory_resource() = delete; - fixed_size_memory_resource(fixed_size_memory_resource const&) = delete; - fixed_size_memory_resource(fixed_size_memory_resource&&) = delete; + fixed_size_memory_resource() = delete; + fixed_size_memory_resource(fixed_size_memory_resource const&) = delete; + fixed_size_memory_resource(fixed_size_memory_resource&&) = delete; fixed_size_memory_resource& operator=(fixed_size_memory_resource const&) = delete; - fixed_size_memory_resource& operator=(fixed_size_memory_resource&&) = delete; + fixed_size_memory_resource& operator=(fixed_size_memory_resource&&) = delete; /** * @brief Query whether the resource supports use of non-null streams for @@ -215,8 +215,7 @@ 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(cuda_stream_view) 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 30426dd56..6d1843e82 100644 --- a/include/rmm/mr/device/limiting_resource_adaptor.hpp +++ b/include/rmm/mr/device/limiting_resource_adaptor.hpp @@ -57,11 +57,11 @@ 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() = 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; /** @@ -184,8 +184,7 @@ class limiting_resource_adaptor final : public device_memory_resource { * @param stream Stream on which to get the mem info. * @return std::pair contaiing free_size and total_size of memory */ - [[nodiscard]] std::pair do_get_mem_info( - cuda_stream_view) const override + [[nodiscard]] std::pair do_get_mem_info(cuda_stream_view) const override { return {allocation_limit_ - allocated_bytes_, allocation_limit_}; } diff --git a/include/rmm/mr/device/managed_memory_resource.hpp b/include/rmm/mr/device/managed_memory_resource.hpp index 68a40f9a7..50317720a 100644 --- a/include/rmm/mr/device/managed_memory_resource.hpp +++ b/include/rmm/mr/device/managed_memory_resource.hpp @@ -29,12 +29,12 @@ 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() = 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& operator=(managed_memory_resource&&) = default; /** * @brief Query whether the resource supports use of non-null streams for @@ -114,8 +114,7 @@ class managed_memory_resource final : public device_memory_resource { * @param stream to execute on * @return std::pair contaiing free_size and total_size of memory */ - [[nodiscard]] std::pair do_get_mem_info( - cuda_stream_view) const override + [[nodiscard]] std::pair do_get_mem_info(cuda_stream_view) const override { std::size_t free_size{}; std::size_t total_size{}; From 4a08e6924af609cfebc8fb3582a7b85606c2f38a Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Wed, 28 Sep 2022 14:33:17 +1000 Subject: [PATCH 3/3] style --- include/rmm/mr/device/arena_memory_resource.hpp | 6 +++--- include/rmm/mr/device/binning_memory_resource.hpp | 8 ++++---- include/rmm/mr/device/fixed_size_memory_resource.hpp | 8 ++++---- include/rmm/mr/device/limiting_resource_adaptor.hpp | 10 +++++----- include/rmm/mr/device/managed_memory_resource.hpp | 10 +++++----- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/include/rmm/mr/device/arena_memory_resource.hpp b/include/rmm/mr/device/arena_memory_resource.hpp index 2935d0a77..1b1043b4a 100644 --- a/include/rmm/mr/device/arena_memory_resource.hpp +++ b/include/rmm/mr/device/arena_memory_resource.hpp @@ -99,9 +99,9 @@ class arena_memory_resource final : public device_memory_resource { ~arena_memory_resource() override = default; // Disable copy (and move) semantics. - arena_memory_resource(arena_memory_resource const&) = delete; - arena_memory_resource& operator=(arena_memory_resource const&) = delete; - arena_memory_resource(arena_memory_resource&&) noexcept = delete; + arena_memory_resource(arena_memory_resource const&) = delete; + arena_memory_resource& operator=(arena_memory_resource const&) = delete; + arena_memory_resource(arena_memory_resource&&) noexcept = delete; arena_memory_resource& operator=(arena_memory_resource&&) noexcept = delete; /** diff --git a/include/rmm/mr/device/binning_memory_resource.hpp b/include/rmm/mr/device/binning_memory_resource.hpp index 705df63c6..e8f9be4c4 100644 --- a/include/rmm/mr/device/binning_memory_resource.hpp +++ b/include/rmm/mr/device/binning_memory_resource.hpp @@ -87,11 +87,11 @@ class binning_memory_resource final : public device_memory_resource { */ ~binning_memory_resource() override = default; - binning_memory_resource() = delete; - binning_memory_resource(binning_memory_resource const&) = delete; - binning_memory_resource(binning_memory_resource&&) = delete; + binning_memory_resource() = delete; + binning_memory_resource(binning_memory_resource const&) = delete; + binning_memory_resource(binning_memory_resource&&) = delete; binning_memory_resource& operator=(binning_memory_resource const&) = delete; - binning_memory_resource& operator=(binning_memory_resource&&) = delete; + binning_memory_resource& operator=(binning_memory_resource&&) = delete; /** * @brief Query whether the resource supports use of non-null streams for diff --git a/include/rmm/mr/device/fixed_size_memory_resource.hpp b/include/rmm/mr/device/fixed_size_memory_resource.hpp index 24c49aa40..dbfb103c6 100644 --- a/include/rmm/mr/device/fixed_size_memory_resource.hpp +++ b/include/rmm/mr/device/fixed_size_memory_resource.hpp @@ -83,11 +83,11 @@ class fixed_size_memory_resource */ ~fixed_size_memory_resource() override { release(); } - fixed_size_memory_resource() = delete; - fixed_size_memory_resource(fixed_size_memory_resource const&) = delete; - fixed_size_memory_resource(fixed_size_memory_resource&&) = delete; + fixed_size_memory_resource() = delete; + fixed_size_memory_resource(fixed_size_memory_resource const&) = delete; + fixed_size_memory_resource(fixed_size_memory_resource&&) = delete; fixed_size_memory_resource& operator=(fixed_size_memory_resource const&) = delete; - fixed_size_memory_resource& operator=(fixed_size_memory_resource&&) = delete; + fixed_size_memory_resource& operator=(fixed_size_memory_resource&&) = delete; /** * @brief Query whether the resource supports use of non-null streams for diff --git a/include/rmm/mr/device/limiting_resource_adaptor.hpp b/include/rmm/mr/device/limiting_resource_adaptor.hpp index 6d1843e82..ba21cbb51 100644 --- a/include/rmm/mr/device/limiting_resource_adaptor.hpp +++ b/include/rmm/mr/device/limiting_resource_adaptor.hpp @@ -57,11 +57,11 @@ 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() = 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; /** diff --git a/include/rmm/mr/device/managed_memory_resource.hpp b/include/rmm/mr/device/managed_memory_resource.hpp index 50317720a..d36b43e7d 100644 --- a/include/rmm/mr/device/managed_memory_resource.hpp +++ b/include/rmm/mr/device/managed_memory_resource.hpp @@ -29,12 +29,12 @@ 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() = 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& operator=(managed_memory_resource&&) = default; /** * @brief Query whether the resource supports use of non-null streams for