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

[SYCL] Add Level-Zero interop with specification of ownership for Queue. #4066

Merged
merged 11 commits into from
Jul 16, 2021

Conversation

rbegam
Copy link
Contributor

@rbegam rbegam commented Jul 6, 2021

The L0 backend interop functions take the ownership of the passed L0 handles. This is problematic for some cases as the users can not use the original handle when they go out of scope and destroyed.
This PR provides a way for users of SYCL - L0 interop to retain the ownership of the L0 handles for the Queue.

Signed-off-by: rehana begam [email protected]

@rbegam rbegam requested review from smaslov-intel and a team as code owners July 6, 2021 21:38
Signed-off-by: rehana begam <[email protected]>
@@ -36,10 +36,11 @@
// 2. A number of types needed to define pi_device_binary_property_set added.
// 3. Added new ownership argument to piextContextCreateWithNativeHandle.
// 4. Add interoperability interfaces for kernel.
// 5. Added new ownership argument to piextQueueCreateWithNativeHandle.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The numbering (5.) is not in sync with PI versions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it match with the major/minor version? I've followed the inst from line#25 above and increased both by 1.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following instructions in line #25 is all fine. Just let's have the comments about the changes tell what was the version where it was made. So, in your case I'd say have "5" changed to "4.6". And, please add a comment about this numbering in the comment above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

sycl/plugins/level_zero/pi_level_zero.cpp Outdated Show resolved Hide resolved
sycl/include/CL/sycl/backend.hpp Show resolved Hide resolved
Signed-off-by: rehana begam <[email protected]>
Signed-off-by: rehana begam <[email protected]>
Signed-off-by: rehana begam <[email protected]>
Signed-off-by: rehana begam <[email protected]>
Signed-off-by: rehana begam <[email protected]>
@rbegam
Copy link
Contributor Author

rbegam commented Jul 9, 2021

ping @smaslov-intel


if (Queue->OwnZeCommandQueue) {
ZE_CALL(zeCommandQueueDestroy, (Queue->ZeComputeCommandQueue));
Queue->ZeComputeCommandQueue = nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should still null-ify these, even if we don't own the handles

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Copy link
Contributor

@smaslov-intel smaslov-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few more comments

Signed-off-by: rehana begam <[email protected]>
Signed-off-by: rehana begam <[email protected]>
Signed-off-by: rehana begam <[email protected]>
@rbegam
Copy link
Contributor Author

rbegam commented Jul 12, 2021

hi @smaslov-intel, could you please review? the pre-commit fail is for a time-out and I've already restarted it. thanks.

Copy link
Contributor

@smaslov-intel smaslov-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rbegam
Copy link
Contributor Author

rbegam commented Jul 13, 2021

@pvchupin pvchupin merged commit 6cf48fa into intel:sycl Jul 16, 2021
npmiller added a commit to npmiller/llvm that referenced this pull request Jul 22, 2021
This parameter was introduced in intel#4066 but apparently didn't make it in
the ROCm plugin.
bader pushed a commit that referenced this pull request Jul 22, 2021
This parameter was introduced in #4066 but apparently didn't make it in
the ROCm plugin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants