-
Notifications
You must be signed in to change notification settings - Fork 769
[draft][HIP][CUDA] Use new UR entry point to get native mem with device param #12199
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
Conversation
You can test this locally with the following command:git-clang-format --diff 413525a469afc7f1593465da2ae45652809b2e19 c0f7b19e816b446757213709d47369c7bd7dcb12 -- sycl/test-e2e/HostInteropTask/interop-task-hip.cpp sycl/include/sycl/detail/pi.h sycl/plugins/cuda/pi_cuda.cpp sycl/plugins/hip/pi_hip.cpp sycl/plugins/level_zero/pi_level_zero.cpp sycl/plugins/native_cpu/pi_native_cpu.cpp sycl/plugins/opencl/pi_opencl.cpp sycl/plugins/unified_runtime/pi2ur.hpp sycl/plugins/unified_runtime/pi_unified_runtime.cpp sycl/source/interop_handle.cpp sycl/unittests/helpers/PiMockPlugin.hpp View the diff from clang-format here.diff --git a/sycl/include/sycl/detail/pi.h b/sycl/include/sycl/detail/pi.h
index 36ea89025e..3ba25d4ff9 100644
--- a/sycl/include/sycl/detail/pi.h
+++ b/sycl/include/sycl/detail/pi.h
@@ -1407,9 +1407,8 @@ __SYCL_EXPORT pi_result piextMemGetNativeHandle(pi_mem mem,
/// \param mem is the PI mem to get the native handle of.
/// \param dev is the PI device that the native allocation will be resident on.
/// \param nativeHandle is the native handle of mem.
-__SYCL_EXPORT pi_result
-piextMemGetNativeHandleExp(pi_mem mem, pi_device dev,
- pi_native_handle *nativeHandle);
+__SYCL_EXPORT pi_result piextMemGetNativeHandleExp(
+ pi_mem mem, pi_device dev, pi_native_handle *nativeHandle);
/// Creates PI mem object from a native handle.
/// NOTE: The created PI object takes ownership of the native handle.
diff --git a/sycl/plugins/unified_runtime/pi_unified_runtime.cpp b/sycl/plugins/unified_runtime/pi_unified_runtime.cpp
index a807a46d46..c27dfe4dad 100644
--- a/sycl/plugins/unified_runtime/pi_unified_runtime.cpp
+++ b/sycl/plugins/unified_runtime/pi_unified_runtime.cpp
@@ -240,9 +240,8 @@ piextMemGetNativeHandle(pi_mem Mem, pi_native_handle *NativeHandle) {
return pi2ur::piextMemGetNativeHandle(Mem, NativeHandle);
}
-__SYCL_EXPORT pi_result
-piextMemGetNativeHandleExp(pi_mem Mem, pi_device Device,
- pi_native_handle *NativeHandle) {
+__SYCL_EXPORT pi_result piextMemGetNativeHandleExp(
+ pi_mem Mem, pi_device Device, pi_native_handle *NativeHandle) {
return pi2ur::piextMemGetNativeHandleExp(Mem, Device, NativeHandle);
}
|
17cce48
to
63efaa8
Compare
@steffenlarsen it seems that either the clang format fails or the "Code formatter" thing fails for |
That is curious! @aelovikov-intel - Do you know if the new formatter check comes from upstream? |
That was intentional - #12085 / #12184, but not yet complete. I have #12240 in progress and we'll need to disable our old format check job. |
Thanks for clarification @steffenlarsen @aelovikov-intel ! This is just a draft for the moment, but will mark as ready for review when I have thumbs up from UR people. Maybe by then the CI linting will be fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
#12297) We want to change the signature of `piMemGetNativeHandle` for reasons explained here oneapi-src/unified-runtime#1199 Corresponding UR PR: oneapi-src/unified-runtime#1226 A previous PR added a new entry point #12199 but it was decided that it is better to modify the existing entry point
Accessor interop broke with the multi device context for HIP (oneapi-src/unified-runtime#999). This fixes it.
Relates to oneapi-src/unified-runtime#1199