From d058a2b31c00c02141a059ddd6ce985482ae4fa5 Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Mon, 22 Nov 2021 08:54:32 -0800 Subject: [PATCH 1/3] Update JNI to use new arena mr constructor --- java/src/main/native/src/RmmJni.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/java/src/main/native/src/RmmJni.cpp b/java/src/main/native/src/RmmJni.cpp index d07b754c8db..a034f54eeee 100644 --- a/java/src/main/native/src/RmmJni.cpp +++ b/java/src/main/native/src/RmmJni.cpp @@ -346,12 +346,13 @@ JNIEXPORT void JNICALL Java_ai_rapids_cudf_Rmm_initializeInternal(JNIEnv *env, j std::make_shared(), pool_size, pool_size); } } else if (use_arena_alloc) { + auto const dump_log_on_failure = log_to != 0; if (use_managed_mem) { Initialized_resource = rmm::mr::make_owning_wrapper( - std::make_shared(), pool_size, pool_size); + std::make_shared(), pool_size, dump_log_on_failure); } else { Initialized_resource = rmm::mr::make_owning_wrapper( - std::make_shared(), pool_size, pool_size); + std::make_shared(), pool_size, dump_log_on_failure); } } else if (use_cuda_async_alloc) { // Use `limiting_resource_adaptor` to set a hard limit on the max pool size since From aaa735ea543a1e42f2a6029def1af958d9fec254 Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Wed, 12 Jan 2022 11:03:32 -0800 Subject: [PATCH 2/3] fix tests --- java/src/main/native/src/RmmJni.cpp | 5 ++--- java/src/test/java/ai/rapids/cudf/RmmTest.java | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/java/src/main/native/src/RmmJni.cpp b/java/src/main/native/src/RmmJni.cpp index a034f54eeee..58c274d7f02 100644 --- a/java/src/main/native/src/RmmJni.cpp +++ b/java/src/main/native/src/RmmJni.cpp @@ -346,13 +346,12 @@ JNIEXPORT void JNICALL Java_ai_rapids_cudf_Rmm_initializeInternal(JNIEnv *env, j std::make_shared(), pool_size, pool_size); } } else if (use_arena_alloc) { - auto const dump_log_on_failure = log_to != 0; if (use_managed_mem) { Initialized_resource = rmm::mr::make_owning_wrapper( - std::make_shared(), pool_size, dump_log_on_failure); + std::make_shared(), pool_size); } else { Initialized_resource = rmm::mr::make_owning_wrapper( - std::make_shared(), pool_size, dump_log_on_failure); + std::make_shared(), pool_size); } } else if (use_cuda_async_alloc) { // Use `limiting_resource_adaptor` to set a hard limit on the max pool size since diff --git a/java/src/test/java/ai/rapids/cudf/RmmTest.java b/java/src/test/java/ai/rapids/cudf/RmmTest.java index f9d097158b6..aaf3683688f 100644 --- a/java/src/test/java/ai/rapids/cudf/RmmTest.java +++ b/java/src/test/java/ai/rapids/cudf/RmmTest.java @@ -414,7 +414,7 @@ public void testCudaAsyncIsIncompatibleWithManaged() { @Test public void testCudaMemoryBuffer() { - Rmm.initialize(RmmAllocationMode.ARENA, Rmm.logToStderr(), 1024); + Rmm.initialize(RmmAllocationMode.ARENA, Rmm.logToStderr(), 8 * 1024 * 1024); try (CudaMemoryBuffer one = CudaMemoryBuffer.allocate(512); CudaMemoryBuffer two = CudaMemoryBuffer.allocate(1024)) { assertEquals(512, one.length); From 4210c7a3bc9ac21fc0cd1b2cb5d4d318f688372f Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Wed, 12 Jan 2022 11:18:23 -0800 Subject: [PATCH 3/3] update copyright year --- java/src/main/native/src/RmmJni.cpp | 2 +- java/src/test/java/ai/rapids/cudf/RmmTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java/src/main/native/src/RmmJni.cpp b/java/src/main/native/src/RmmJni.cpp index 58c274d7f02..769e8d2f356 100644 --- a/java/src/main/native/src/RmmJni.cpp +++ b/java/src/main/native/src/RmmJni.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/java/src/test/java/ai/rapids/cudf/RmmTest.java b/java/src/test/java/ai/rapids/cudf/RmmTest.java index aaf3683688f..c56b131de86 100644 --- a/java/src/test/java/ai/rapids/cudf/RmmTest.java +++ b/java/src/test/java/ai/rapids/cudf/RmmTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. + * Copyright (c) 2020-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.