diff --git a/cpp/benchmarks/fixture/benchmark_fixture.hpp b/cpp/benchmarks/fixture/benchmark_fixture.hpp index bc6c2e52da8..36370560727 100644 --- a/cpp/benchmarks/fixture/benchmark_fixture.hpp +++ b/cpp/benchmarks/fixture/benchmark_fixture.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ #pragma once #include +#include #include #include #include @@ -33,7 +34,8 @@ inline auto make_pool_instance() { static rmm::mr::cuda_memory_resource cuda_mr; static auto pool_mr = - std::make_shared>(&cuda_mr); + std::make_shared>( + &cuda_mr, rmm::percent_of_free_device_memory(50)); return pool_mr; } } // namespace diff --git a/cpp/benchmarks/fixture/nvbench_fixture.hpp b/cpp/benchmarks/fixture/nvbench_fixture.hpp index e08f9101522..701ed67e666 100644 --- a/cpp/benchmarks/fixture/nvbench_fixture.hpp +++ b/cpp/benchmarks/fixture/nvbench_fixture.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ #include +#include #include #include #include @@ -42,7 +43,8 @@ struct nvbench_base_fixture { inline auto make_pool() { - return rmm::mr::make_owning_wrapper(make_cuda()); + return rmm::mr::make_owning_wrapper( + make_cuda(), rmm::percent_of_free_device_memory(50)); } inline auto make_async() { return std::make_shared(); } @@ -56,7 +58,8 @@ struct nvbench_base_fixture { inline auto make_managed_pool() { - return rmm::mr::make_owning_wrapper(make_managed()); + return rmm::mr::make_owning_wrapper( + make_managed(), rmm::percent_of_free_device_memory(50)); } inline std::shared_ptr create_memory_resource( diff --git a/cpp/examples/basic/src/process_csv.cpp b/cpp/examples/basic/src/process_csv.cpp index edd14d9ee5f..0d2b6b099ac 100644 --- a/cpp/examples/basic/src/process_csv.cpp +++ b/cpp/examples/basic/src/process_csv.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -82,7 +83,7 @@ int main(int argc, char** argv) // Construct a memory pool using the CUDA memory resource // Using a memory pool for device memory allocations is important for good performance in libcudf. // The pool defaults to allocating half of the available GPU memory. - rmm::mr::pool_memory_resource mr{&cuda_mr}; + rmm::mr::pool_memory_resource mr{&cuda_mr, rmm::percent_of_free_device_memory(50)}; // Set the pool resource to be used by default for all device memory allocations // Note: It is the user's responsibility to ensure the `mr` object stays alive for the duration of diff --git a/cpp/examples/nested_types/deduplication.cpp b/cpp/examples/nested_types/deduplication.cpp index 5969985cc72..c7c54592b70 100644 --- a/cpp/examples/nested_types/deduplication.cpp +++ b/cpp/examples/nested_types/deduplication.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, NVIDIA CORPORATION. + * Copyright (c) 2023-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -57,7 +58,10 @@ std::shared_ptr create_memory_resource(bool pool) { auto cuda_mr = std::make_shared(); - if (pool) { return rmm::mr::make_owning_wrapper(cuda_mr); } + if (pool) { + return rmm::mr::make_owning_wrapper( + cuda_mr, rmm::percent_of_free_device_memory(50)); + } return cuda_mr; } diff --git a/cpp/examples/strings/common.hpp b/cpp/examples/strings/common.hpp index 2fd9daf9339..0dbe6fe2b7b 100644 --- a/cpp/examples/strings/common.hpp +++ b/cpp/examples/strings/common.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -60,7 +61,8 @@ auto make_cuda_mr() { return std::make_shared(); */ auto make_pool_mr() { - return rmm::mr::make_owning_wrapper(make_cuda_mr()); + return rmm::mr::make_owning_wrapper( + make_cuda_mr(), rmm::percent_of_free_device_memory(50)); } /** diff --git a/cpp/include/cudf_test/testing_main.hpp b/cpp/include/cudf_test/testing_main.hpp index 12dbb4c7851..88e3088d794 100644 --- a/cpp/include/cudf_test/testing_main.hpp +++ b/cpp/include/cudf_test/testing_main.hpp @@ -21,6 +21,7 @@ #include +#include #include #include #include @@ -43,9 +44,9 @@ inline auto make_managed() { return std::make_shared(make_cuda(), min_alloc); }