Skip to content

Commit

Permalink
Update JNI to use new arena mr constructor (#10027)
Browse files Browse the repository at this point in the history
And fix a failing test.

Authors:
  - Rong Ou (https://github.com/rongou)

Approvers:
  - Jason Lowe (https://github.com/jlowe)
  - Robert (Bobby) Evans (https://github.com/revans2)
  - Nghia Truong (https://github.com/ttnghia)

URL: #10027
  • Loading branch information
rongou authored Jan 12, 2022
1 parent 093b0ad commit 76f89db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions java/src/main/native/src/RmmJni.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -348,10 +348,10 @@ JNIEXPORT void JNICALL Java_ai_rapids_cudf_Rmm_initializeInternal(JNIEnv *env, j
} else if (use_arena_alloc) {
if (use_managed_mem) {
Initialized_resource = rmm::mr::make_owning_wrapper<rmm::mr::arena_memory_resource>(
std::make_shared<rmm::mr::managed_memory_resource>(), pool_size, pool_size);
std::make_shared<rmm::mr::managed_memory_resource>(), pool_size);
} else {
Initialized_resource = rmm::mr::make_owning_wrapper<rmm::mr::arena_memory_resource>(
std::make_shared<rmm::mr::cuda_memory_resource>(), pool_size, pool_size);
std::make_shared<rmm::mr::cuda_memory_resource>(), pool_size);
}
} else if (use_cuda_async_alloc) {
// Use `limiting_resource_adaptor` to set a hard limit on the max pool size since
Expand Down
4 changes: 2 additions & 2 deletions java/src/test/java/ai/rapids/cudf/RmmTest.java
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 76f89db

Please sign in to comment.