Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JNI] remove rmm argument to set rw access for fabric handles #17553

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions java/src/main/native/src/RmmJni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -778,17 +778,11 @@ JNIEXPORT jlong JNICALL Java_ai_rapids_cudf_Rmm_newCudaAsyncMemoryResource(
try {
cudf::jni::auto_set_device(env);

// When we are using fabric, we need to set the memory access to be
// read_write, in order for peer GPUs to have access to this memory.
// Otherwise, choose default parameters (optional set to nullopt).
auto [handle_type, prot_flag] =
fabric
? std::pair{std::optional{
rmm::mr::cuda_async_memory_resource::allocation_handle_type::fabric},
std::optional{rmm::mr::cuda_async_memory_resource::access_flags::read_write}}
: std::pair{std::nullopt, std::nullopt};

auto ret = new rmm::mr::cuda_async_memory_resource(init, release, handle_type, prot_flag);
auto handle_type =
fabric ? std::optional{rmm::mr::cuda_async_memory_resource::allocation_handle_type::fabric}
: std::nullopt;

auto ret = new rmm::mr::cuda_async_memory_resource(init, release, handle_type);

return reinterpret_cast<jlong>(ret);
}
Expand Down
Loading