Skip to content

Commit

Permalink
Remove child fom newCudaAsyncMemoryResource (#12681)
Browse files Browse the repository at this point in the history
Fixes a bug introduced here #12632 where the C++ version of the jni call `Rmm.newCudaAsyncMemoryResource` was taking an extra argument (`child`), causing the `threshold` to be set to a random value since the calling code defined the native method has taking 2 longs, not 3.

The above can affect performance if the threshold is set to 0 for example. The async pool will reduce its footprint by releasing memory, which means we need to go back and reallocate. This is how I found it.

I am starting the build process for this, so it's going to take me a bit to test.

Authors:
  - Alessandro Bellina (https://github.com/abellina)

Approvers:
  - Jason Lowe (https://github.com/jlowe)

URL: #12681
  • Loading branch information
abellina authored Feb 3, 2023
1 parent 182ee2c commit e380331
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions java/src/main/native/src/RmmJni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,10 +549,8 @@ JNIEXPORT void JNICALL Java_ai_rapids_cudf_Rmm_releaseArenaMemoryResource(JNIEnv
}

JNIEXPORT jlong JNICALL Java_ai_rapids_cudf_Rmm_newCudaAsyncMemoryResource(JNIEnv *env,
jclass clazz,
jlong child, jlong init,
jclass clazz, jlong init,
jlong release) {
JNI_NULL_CHECK(env, child, "child is null", 0);
try {
cudf::jni::auto_set_device(env);
auto ret = new rmm::mr::cuda_async_memory_resource(init, release);
Expand Down

0 comments on commit e380331

Please sign in to comment.