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

Adds the JNI call for Cuda.deviceSynchronize #10839

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions java/src/main/java/ai/rapids/cudf/Cuda.java
Original file line number Diff line number Diff line change
Expand Up @@ -596,4 +596,10 @@ public static void multiBufferCopyAsync(long [] destAddrs,
* no effect.
*/
public static native void profilerStop();

/**
* Synchronizes the whole device using cudaDeviceSynchronize.
* @note this is very expensive and should almost never be used
*/
public static native void deviceSynchronize();
}
7 changes: 7 additions & 0 deletions java/src/main/native/src/CudaJni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,4 +390,11 @@ JNIEXPORT void JNICALL Java_ai_rapids_cudf_Cuda_profilerStop(JNIEnv *env, jclass
CATCH_STD(env, );
}

JNIEXPORT void JNICALL Java_ai_rapids_cudf_Cuda_deviceSynchronize(JNIEnv *env, jclass clazz) {
try {
abellina marked this conversation as resolved.
Show resolved Hide resolved
CUDF_CUDA_TRY(cudaDeviceSynchronize());
}
CATCH_STD(env, );
}

} // extern "C"