From 3852898234712444535420284013d390263b1cef Mon Sep 17 00:00:00 2001 From: Jake Hemstad Date: Wed, 29 Jan 2020 11:46:49 -0600 Subject: [PATCH 1/4] Moved device memory resource files to mr/device folder. --- include/rmm/detail/memory_manager.hpp | 2 +- include/rmm/device_buffer.hpp | 4 ++-- include/rmm/device_scalar.hpp | 4 ++-- .../{ => device}/cnmem_managed_memory_resource.hpp | 0 .../rmm/mr/{ => device}/cnmem_memory_resource.hpp | 0 .../rmm/mr/{ => device}/cuda_memory_resource.hpp | 0 .../mr/{ => device}/default_memory_resource.hpp | 0 .../rmm/mr/{ => device}/device_memory_resource.hpp | 0 .../mr/{ => device}/managed_memory_resource.hpp | 0 .../mr/{ => device}/thrust_allocator_adaptor.hpp | 0 include/rmm/rmm.hpp | 2 +- src/memory_manager.cpp | 10 +++++----- src/mr/default_memory_resource.cpp | 12 ++++++------ src/rmm.cpp | 8 ++++---- tests/device_buffer_tests.cpp | 12 ++++++------ tests/device_scalar_tests.cpp | 4 ++-- tests/mr/mr_tests.cpp | 12 ++++++------ tests/mr/thrust_allocator_tests.cpp | 14 +++++++------- 18 files changed, 42 insertions(+), 42 deletions(-) rename include/rmm/mr/{ => device}/cnmem_managed_memory_resource.hpp (100%) rename include/rmm/mr/{ => device}/cnmem_memory_resource.hpp (100%) rename include/rmm/mr/{ => device}/cuda_memory_resource.hpp (100%) rename include/rmm/mr/{ => device}/default_memory_resource.hpp (100%) rename include/rmm/mr/{ => device}/device_memory_resource.hpp (100%) rename include/rmm/mr/{ => device}/managed_memory_resource.hpp (100%) rename include/rmm/mr/{ => device}/thrust_allocator_adaptor.hpp (100%) diff --git a/include/rmm/detail/memory_manager.hpp b/include/rmm/detail/memory_manager.hpp index a14fee262..309741c25 100644 --- a/include/rmm/detail/memory_manager.hpp +++ b/include/rmm/detail/memory_manager.hpp @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include diff --git a/include/rmm/device_buffer.hpp b/include/rmm/device_buffer.hpp index 410edc1e2..37a338a86 100644 --- a/include/rmm/device_buffer.hpp +++ b/include/rmm/device_buffer.hpp @@ -15,8 +15,8 @@ */ #pragma once -#include -#include +#include +#include #include #include diff --git a/include/rmm/device_scalar.hpp b/include/rmm/device_scalar.hpp index ceae5e16e..3dcce0eb6 100644 --- a/include/rmm/device_scalar.hpp +++ b/include/rmm/device_scalar.hpp @@ -17,8 +17,8 @@ #pragma once #include -#include -#include +#include +#include namespace rmm { diff --git a/include/rmm/mr/cnmem_managed_memory_resource.hpp b/include/rmm/mr/device/cnmem_managed_memory_resource.hpp similarity index 100% rename from include/rmm/mr/cnmem_managed_memory_resource.hpp rename to include/rmm/mr/device/cnmem_managed_memory_resource.hpp diff --git a/include/rmm/mr/cnmem_memory_resource.hpp b/include/rmm/mr/device/cnmem_memory_resource.hpp similarity index 100% rename from include/rmm/mr/cnmem_memory_resource.hpp rename to include/rmm/mr/device/cnmem_memory_resource.hpp diff --git a/include/rmm/mr/cuda_memory_resource.hpp b/include/rmm/mr/device/cuda_memory_resource.hpp similarity index 100% rename from include/rmm/mr/cuda_memory_resource.hpp rename to include/rmm/mr/device/cuda_memory_resource.hpp diff --git a/include/rmm/mr/default_memory_resource.hpp b/include/rmm/mr/device/default_memory_resource.hpp similarity index 100% rename from include/rmm/mr/default_memory_resource.hpp rename to include/rmm/mr/device/default_memory_resource.hpp diff --git a/include/rmm/mr/device_memory_resource.hpp b/include/rmm/mr/device/device_memory_resource.hpp similarity index 100% rename from include/rmm/mr/device_memory_resource.hpp rename to include/rmm/mr/device/device_memory_resource.hpp diff --git a/include/rmm/mr/managed_memory_resource.hpp b/include/rmm/mr/device/managed_memory_resource.hpp similarity index 100% rename from include/rmm/mr/managed_memory_resource.hpp rename to include/rmm/mr/device/managed_memory_resource.hpp diff --git a/include/rmm/mr/thrust_allocator_adaptor.hpp b/include/rmm/mr/device/thrust_allocator_adaptor.hpp similarity index 100% rename from include/rmm/mr/thrust_allocator_adaptor.hpp rename to include/rmm/mr/device/thrust_allocator_adaptor.hpp diff --git a/include/rmm/rmm.hpp b/include/rmm/rmm.hpp index f51b2f646..e82285c51 100644 --- a/include/rmm/rmm.hpp +++ b/include/rmm/rmm.hpp @@ -24,7 +24,7 @@ #define MEMORY_HPP #include "rmm/rmm_api.h" #include "rmm/detail/memory_manager.hpp" -#include "rmm/mr/default_memory_resource.hpp" +#include "rmm/mr/device/default_memory_resource.hpp" /** ---------------------------------------------------------------------------* * @brief Macro wrapper to check for error in RMM API calls. diff --git a/src/memory_manager.cpp b/src/memory_manager.cpp index 9740b219c..a8e2afa96 100644 --- a/src/memory_manager.cpp +++ b/src/memory_manager.cpp @@ -15,11 +15,11 @@ */ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include namespace rmm { /** -------------------------------------------------------------------------* diff --git a/src/mr/default_memory_resource.cpp b/src/mr/default_memory_resource.cpp index 3342b8017..1af4c6e95 100644 --- a/src/mr/default_memory_resource.cpp +++ b/src/mr/default_memory_resource.cpp @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include diff --git a/src/rmm.cpp b/src/rmm.cpp index 3bcf22a92..999498dae 100644 --- a/src/rmm.cpp +++ b/src/rmm.cpp @@ -23,10 +23,10 @@ #include "rmm/rmm.h" #include "rmm/detail/memory_manager.hpp" -#include "rmm/mr/cnmem_memory_resource.hpp" -#include "rmm/mr/cnmem_managed_memory_resource.hpp" -#include "rmm/mr/managed_memory_resource.hpp" -#include "rmm/mr/cuda_memory_resource.hpp" +#include "rmm/mr/device/cnmem_memory_resource.hpp" +#include "rmm/mr/device/cnmem_managed_memory_resource.hpp" +#include "rmm/mr/device/managed_memory_resource.hpp" +#include "rmm/mr/device/cuda_memory_resource.hpp" diff --git a/tests/device_buffer_tests.cpp b/tests/device_buffer_tests.cpp index 0b32e70c0..1fe5e159c 100644 --- a/tests/device_buffer_tests.cpp +++ b/tests/device_buffer_tests.cpp @@ -17,12 +17,12 @@ #include "gtest/gtest.h" #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/tests/device_scalar_tests.cpp b/tests/device_scalar_tests.cpp index 4f2256159..95d91df4c 100644 --- a/tests/device_scalar_tests.cpp +++ b/tests/device_scalar_tests.cpp @@ -17,8 +17,8 @@ #include "gtest/gtest.h" #include -#include -#include +#include +#include #include #include diff --git a/tests/mr/mr_tests.cpp b/tests/mr/mr_tests.cpp index f6d62c7ae..895d23f15 100644 --- a/tests/mr/mr_tests.cpp +++ b/tests/mr/mr_tests.cpp @@ -16,12 +16,12 @@ #include "gtest/gtest.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/tests/mr/thrust_allocator_tests.cpp b/tests/mr/thrust_allocator_tests.cpp index f07faa2c5..f74a47b72 100644 --- a/tests/mr/thrust_allocator_tests.cpp +++ b/tests/mr/thrust_allocator_tests.cpp @@ -14,13 +14,13 @@ * limitations under the License. */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include From dc2fdb5271e9b56218b5af0b92e79234a5216ce7 Mon Sep 17 00:00:00 2001 From: Jake Hemstad Date: Wed, 29 Jan 2020 12:06:44 -0600 Subject: [PATCH 2/4] CHANGELOG. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c00209c00..8e57c99d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - PR #252 Add `__sizeof__` method to `DeviceBuffer` - PR #258 Define pickling behavior for `DeviceBuffer` - PR #261 Add `__bytes__` method to `DeviceBuffer` +- PR #262 Moved device memory resource files to `mr/device` directory ## Improvements From f1d978a07fce324b612790c3610126486e6fd4fd Mon Sep 17 00:00:00 2001 From: Jake Hemstad Date: Wed, 29 Jan 2020 13:27:28 -0600 Subject: [PATCH 3/4] Add src/mr/device folder. --- src/mr/{ => device}/default_memory_resource.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/mr/{ => device}/default_memory_resource.cpp (100%) diff --git a/src/mr/default_memory_resource.cpp b/src/mr/device/default_memory_resource.cpp similarity index 100% rename from src/mr/default_memory_resource.cpp rename to src/mr/device/default_memory_resource.cpp From c4105f88728821031665288135cf04d609ddfaab Mon Sep 17 00:00:00 2001 From: Jake Hemstad Date: Wed, 29 Jan 2020 13:28:26 -0600 Subject: [PATCH 4/4] Update cmakelists for src/mr/device. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ff74dc40..6a3ee22d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,7 +112,7 @@ add_library(rmm SHARED src/device_buffer.cpp src/memory_manager.cpp thirdparty/cnmem/src/cnmem.cpp - src/mr/default_memory_resource.cpp) + src/mr/device/default_memory_resource.cpp) # override rpath for rmm SET_TARGET_PROPERTIES(rmm PROPERTIES BUILD_RPATH "\$ORIGIN")