diff --git a/conda/recipes/librmm/meta.yaml b/conda/recipes/librmm/meta.yaml index 8263e0f3d..0d3bd0add 100644 --- a/conda/recipes/librmm/meta.yaml +++ b/conda/recipes/librmm/meta.yaml @@ -81,7 +81,6 @@ outputs: - spdlog {{ spdlog_version }} test: commands: - - test -f $PREFIX/include/rmm/thrust_rmm_allocator.h - test -f $PREFIX/include/rmm/logger.hpp - test -f $PREFIX/include/rmm/cuda_stream.hpp - test -f $PREFIX/include/rmm/cuda_stream_view.hpp diff --git a/include/rmm/detail/aligned.hpp b/include/rmm/detail/aligned.hpp index eb31658e9..1206a1983 100644 --- a/include/rmm/detail/aligned.hpp +++ b/include/rmm/detail/aligned.hpp @@ -26,87 +26,6 @@ namespace rmm::detail { -/** - * @brief Default alignment used for host memory allocated by RMM. - * - */ -[[deprecated("Use rmm::RMM_DEFAULT_HOST_ALIGNMENT instead.")]] static constexpr std::size_t - RMM_DEFAULT_HOST_ALIGNMENT{rmm::RMM_DEFAULT_HOST_ALIGNMENT}; - -/** - * @brief Default alignment used for CUDA memory allocation. - * - */ -[[deprecated("Use rmm::CUDA_ALLOCATION_ALIGNMENT instead.")]] static constexpr std::size_t - CUDA_ALLOCATION_ALIGNMENT{rmm::CUDA_ALLOCATION_ALIGNMENT}; - -/** - * @brief Returns whether or not `n` is a power of 2. - * - */ -[[deprecated("Use rmm::is_pow2 instead.")]] constexpr bool is_pow2(std::size_t value) noexcept -{ - return rmm::is_pow2(value); -} - -/** - * @brief Returns whether or not `alignment` is a valid memory alignment. - * - */ -[[deprecated("Use rmm::is_supported_alignment instead.")]] constexpr bool is_supported_alignment( - std::size_t alignment) noexcept -{ - return rmm::is_pow2(alignment); -} - -/** - * @brief Align up to nearest multiple of specified power of 2 - * - * @param[in] value value to align - * @param[in] alignment amount, in bytes, must be a power of 2 - * - * @return Return the aligned value, as one would expect - */ -[[deprecated("Use rmm::align_up instead.")]] constexpr std::size_t align_up( - std::size_t value, std::size_t alignment) noexcept -{ - return rmm::align_up(value, alignment); -} - -/** - * @brief Align down to the nearest multiple of specified power of 2 - * - * @param[in] value value to align - * @param[in] alignment amount, in bytes, must be a power of 2 - * - * @return Return the aligned value, as one would expect - */ -[[deprecated("Use rmm::align_down instead.")]] constexpr std::size_t align_down( - std::size_t value, std::size_t alignment) noexcept -{ - return rmm::align_down(value, alignment); -} - -/** - * @brief Checks whether a value is aligned to a multiple of a specified power of 2 - * - * @param[in] value value to check for alignment - * @param[in] alignment amount, in bytes, must be a power of 2 - * - * @return true if aligned - */ -[[deprecated("Use rmm::is_aligned instead.")]] constexpr bool is_aligned( - std::size_t value, std::size_t alignment) noexcept -{ - return rmm::is_aligned(value, alignment); -} - -[[deprecated("Use rmm::is_pointer_aligned instead.")]] inline bool is_pointer_aligned( - void* ptr, std::size_t alignment = rmm::CUDA_ALLOCATION_ALIGNMENT) -{ - return rmm::is_pointer_aligned(ptr, alignment); -} - /** * @brief Allocates sufficient host-accessible memory to satisfy the requested size `bytes` with * alignment `alignment` using the unary callable `alloc` to allocate memory. diff --git a/include/rmm/mr/device/pool_memory_resource.hpp b/include/rmm/mr/device/pool_memory_resource.hpp index 4cbdeef4a..5c0b9a29f 100644 --- a/include/rmm/mr/device/pool_memory_resource.hpp +++ b/include/rmm/mr/device/pool_memory_resource.hpp @@ -111,147 +111,6 @@ class pool_memory_resource final friend class detail::stream_ordered_memory_resource, detail::coalescing_free_list>; - /** - * @brief Construct a `pool_memory_resource` and allocate the initial device memory - * pool using `upstream_mr`. - * - * @deprecated Use the constructor that takes an explicit initial pool size instead. - * - * @throws rmm::logic_error if `upstream_mr == nullptr` - * @throws rmm::logic_error if `initial_pool_size` is neither the default nor aligned to a - * multiple of pool_memory_resource::allocation_alignment bytes. - * @throws rmm::logic_error if `maximum_pool_size` is neither the default nor aligned to a - * multiple of pool_memory_resource::allocation_alignment bytes. - * - * @param upstream_mr The memory_resource from which to allocate blocks for the pool. - * @param initial_pool_size Minimum size, in bytes, of the initial pool. Defaults to zero. - * @param maximum_pool_size Maximum size, in bytes, that the pool can grow to. Defaults to all - * of the available memory from the upstream resource. - */ - template , - thrust::optional>, - int> = 0> - [[deprecated( - "Must specify initial_pool_size and use std::optional instead of thrust::optional.")]] // - explicit pool_memory_resource(Upstream* upstream_mr, - Optional initial_pool_size, - Optional maximum_pool_size = thrust::nullopt) - : pool_memory_resource( - upstream_mr, initial_pool_size.value_or(0), maximum_pool_size.value_or(std::nullopt)) - { - } - - /** - * @brief Construct a `pool_memory_resource` and allocate the initial device memory - * pool using `upstream_mr`. - * - * @deprecated Use the constructor that takes an explicit initial pool size instead. - * - * @throws rmm::logic_error if `upstream_mr == nullptr` - * @throws rmm::logic_error if `initial_pool_size` is neither the default nor aligned to a - * multiple of pool_memory_resource::allocation_alignment bytes. - * @throws rmm::logic_error if `maximum_pool_size` is neither the default nor aligned to a - * multiple of pool_memory_resource::allocation_alignment bytes. - * - * @param upstream_mr The memory_resource from which to allocate blocks for the pool. - * @param initial_pool_size Minimum size, in bytes, of the initial pool. Defaults to zero. - * @param maximum_pool_size Maximum size, in bytes, that the pool can grow to. Defaults to all - * of the available memory from the upstream resource. - */ - [[deprecated("Must specify initial_pool_size")]] // - explicit pool_memory_resource(Upstream* upstream_mr, - std::optional initial_pool_size = std::nullopt, - std::optional maximum_pool_size = std::nullopt) - : pool_memory_resource(upstream_mr, initial_pool_size.value_or(0), maximum_pool_size) - { - } - - /** - * @brief Construct a `pool_memory_resource` and allocate the initial device memory pool using - * `upstream_mr`. - * - * @deprecated Use the constructor that takes an explicit initial pool size instead. - * - * @throws rmm::logic_error if `upstream_mr == nullptr` - * @throws rmm::logic_error if `initial_pool_size` is neither the default nor aligned to a - * multiple of pool_memory_resource::allocation_alignment bytes. - * @throws rmm::logic_error if `maximum_pool_size` is neither the default nor aligned to a - * multiple of pool_memory_resource::allocation_alignment bytes. - * - * @param upstream_mr The memory_resource from which to allocate blocks for the pool. - * @param initial_pool_size Minimum size, in bytes, of the initial pool. Defaults to zero. - * @param maximum_pool_size Maximum size, in bytes, that the pool can grow to. Defaults to all - * of the available memory from the upstream resource. - */ - template , - thrust::optional>, - int> = 0> - [[deprecated( - "Must specify initial_pool_size and use std::optional instead of thrust::optional.")]] // - explicit pool_memory_resource(Upstream& upstream_mr, - Optional initial_pool_size, - Optional maximum_pool_size = thrust::nullopt) - : pool_memory_resource( - upstream_mr, initial_pool_size.value_or(0), maximum_pool_size.value_or(std::nullopt)) - { - } - - /** - * @brief Construct a `pool_memory_resource` and allocate the initial device memory pool using - * `upstream_mr`. - * - * @deprecated Use the constructor that takes an explicit initial pool size instead. - * - * @throws rmm::logic_error if `upstream_mr == nullptr` - * @throws rmm::logic_error if `initial_pool_size` is neither the default nor aligned to a - * multiple of pool_memory_resource::allocation_alignment bytes. - * @throws rmm::logic_error if `maximum_pool_size` is neither the default nor aligned to a - * multiple of pool_memory_resource::allocation_alignment bytes. - * - * @param upstream_mr The memory_resource from which to allocate blocks for the pool. - * @param initial_pool_size Minimum size, in bytes, of the initial pool. Defaults to zero. - * @param maximum_pool_size Maximum size, in bytes, that the pool can grow to. Defaults to all - * of the available memory from the upstream resource. - */ - template , int> = 0> - [[deprecated("Must specify initial_pool_size")]] // - explicit pool_memory_resource(Upstream2& upstream_mr, - std::optional initial_pool_size = std::nullopt, - std::optional maximum_pool_size = std::nullopt) - : pool_memory_resource(upstream_mr, initial_pool_size.value_or(0), maximum_pool_size) - { - } - - /** - * @brief Construct a `pool_memory_resource` and allocate the initial device memory pool using - * `upstream_mr`. - * - * @throws rmm::logic_error if `upstream_mr == nullptr` - * @throws rmm::logic_error if `initial_pool_size` is not aligned to a multiple of - * pool_memory_resource::allocation_alignment bytes. - * @throws rmm::logic_error if `maximum_pool_size` is neither the default nor aligned to a - * multiple of pool_memory_resource::allocation_alignment bytes. - * - * @param upstream_mr The memory_resource from which to allocate blocks for the pool. - * @param initial_pool_size Minimum size, in bytes, of the initial pool. - * @param maximum_pool_size Maximum size, in bytes, that the pool can grow to. Defaults to all - * of the available from the upstream resource. - */ - template , - thrust::optional>, - int> = 0> - [[deprecated("Use std::optional instead of thrust::optional.")]] // - explicit pool_memory_resource(Upstream* upstream_mr, - std::size_t initial_pool_size, - Optional maximum_pool_size) - : pool_memory_resource(upstream_mr, initial_pool_size, maximum_pool_size.value_or(std::nullopt)) - { - } - /** * @brief Construct a `pool_memory_resource` and allocate the initial device memory pool using * `upstream_mr`. @@ -283,35 +142,6 @@ class pool_memory_resource final initialize_pool(initial_pool_size, maximum_pool_size); } - /** - * @brief Construct a `pool_memory_resource` and allocate the initial device memory pool using - * `upstream_mr`. - * - * @throws rmm::logic_error if `upstream_mr == nullptr` - * @throws rmm::logic_error if `initial_pool_size` is not aligned to a multiple of - * pool_memory_resource::allocation_alignment bytes. - * @throws rmm::logic_error if `maximum_pool_size` is neither the default nor aligned to a - * multiple of pool_memory_resource::allocation_alignment bytes. - * - * @param upstream_mr The memory_resource from which to allocate blocks for the pool. - * @param initial_pool_size Minimum size, in bytes, of the initial pool. - * @param maximum_pool_size Maximum size, in bytes, that the pool can grow to. Defaults to all - * of the available memory from the upstream resource. - */ - template , - thrust::optional>, - int> = 0> - [[deprecated("Use std::optional instead of thrust::optional.")]] // - explicit pool_memory_resource(Upstream& upstream_mr, - std::size_t initial_pool_size, - Optional maximum_pool_size) - : pool_memory_resource(cuda::std::addressof(upstream_mr), - initial_pool_size, - maximum_pool_size.value_or(std::nullopt)) - { - } - /** * @brief Construct a `pool_memory_resource` and allocate the initial device memory pool using * `upstream_mr`. diff --git a/include/rmm/thrust_rmm_allocator.h b/include/rmm/thrust_rmm_allocator.h deleted file mode 100644 index ad71e107a..000000000 --- a/include/rmm/thrust_rmm_allocator.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2018-2021, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include -#include -#include - -#include - -namespace rmm { - -using par_t = decltype(thrust::cuda::par(*(new rmm::mr::thrust_allocator()))); -using deleter_t = std::function; -using exec_policy_t = std::unique_ptr; - -/** - * @brief Returns a unique_ptr to a Thrust CUDA execution policy that uses RMM - * for temporary memory allocation. - * - * @param stream The stream that the allocator will use - * - * @return A Thrust execution policy that will use RMM for temporary memory - * allocation. - */ -[[deprecated("Use new exec_policy in rmm/exec_policy.hpp")]] inline exec_policy_t exec_policy( - cudaStream_t stream = nullptr) -{ - // NOLINTNEXTLINE(cppcoreguidelines-owning-memory) - auto* alloc = new rmm::mr::thrust_allocator(cuda_stream_view{stream}); - auto deleter = [alloc](par_t* pointer) { - delete alloc; // NOLINT(cppcoreguidelines-owning-memory) - delete pointer; // NOLINT(cppcoreguidelines-owning-memory) - }; - - exec_policy_t policy{new par_t(*alloc), deleter}; - return policy; -} - -} // namespace rmm diff --git a/python/rmm/docs/conf.py b/python/rmm/docs/conf.py index 0140c84b2..6ed770151 100644 --- a/python/rmm/docs/conf.py +++ b/python/rmm/docs/conf.py @@ -89,6 +89,18 @@ # This patterns also effect to html_static_path and html_extra_path exclude_patterns = [] +# List of warnings to suppress +suppress_warnings = [] + +# if the file deprecated.xml does not exist in the doxygen xml output, +# breathe will fail to build the docs, so we conditionally add +# "deprecated.rst" to the exclude_patterns list +if not os.path.exists( + os.path.join(breathe_projects["librmm"], "deprecated.xml") +): + exclude_patterns.append("librmm_docs/deprecated.rst") + suppress_warnings.append("toc.excluded") + # The name of the Pygments (syntax highlighting) style to use. pygments_style = "sphinx"