Skip to content

[SYCL][L0] Implement pi_device and pi_platform cache #2227

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

Merged
merged 25 commits into from
Aug 12, 2020

Conversation

bso-intel
Copy link
Contributor

The current implementation piDevicesGet and piPlatformsGet always create new pi_device and pi_platform object even if the low-level ze_handles are the same.
This makes SYCL RT difficult to determine whether sycl::device is the same.
Same issue applies to sycl::platform.
By implementing cache, it can avoid calling expensive L0 RT and return the saved pi_device and pi_platform from the cache.
This should help remove the memory leak and improve the overall performance of plugins.

bso-intel added 11 commits July 20, 2020 16:22
added piPlatformRelease to invalidate platforms when platform_impl is deallocated.

Signed-off-by: Byoungro So <[email protected]>
Signed-off-by: Byoungro So <[email protected]>
added piPlatformRelease to invalidate platforms when platform_impl is deallocated.

Signed-off-by: Byoungro So <[email protected]>
Signed-off-by: Byoungro So <[email protected]>
Signed-off-by: Byoungro So <[email protected]>
Signed-off-by: Byoungro So <[email protected]>
@bso-intel bso-intel requested a review from smaslov-intel as a code owner July 31, 2020 04:32
@bso-intel
Copy link
Contributor Author

@smaslov-intel please review. Thanks.

@bso-intel
Copy link
Contributor Author

@bader @DoyleLi Again the failure in barrier.cpp already occurs in the sycl branch.
@smaslov-intel , please review by tomorrow. Thanks.

@bso-intel
Copy link
Contributor Author

@smaslov-intel , I accommodated your feedback and revised the PR. please review. Thanks

Signed-off-by: Byoungro So <[email protected]>
also, reverted device_imple destructor change because it caused bugs.

Signed-off-by: Byoungro So <[email protected]>
@bso-intel bso-intel requested a review from a team as a code owner August 6, 2020 06:57
@bso-intel
Copy link
Contributor Author

@smaslov-intel I have accommodated your feedback. Please review.
@romanovvlad please review the change in device_impl.cpp. Thanks.

romanovvlad
romanovvlad previously approved these changes Aug 10, 2020
Copy link
Contributor

@romanovvlad romanovvlad left a comment

Choose a reason for hiding this comment

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

Changes in device_impl.cpp looks good.

smaslov-intel
smaslov-intel previously approved these changes Aug 11, 2020
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.

Approved, given the 2 remaining minor things are going to be addressed.

Copy link
Contributor

@romanovvlad romanovvlad left a comment

Choose a reason for hiding this comment

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

I'm still OK with changes in device_impl.cpp

@bader bader merged commit 43ba606 into intel:sycl Aug 12, 2020
@bso-intel bso-intel deleted the device-cache branch August 12, 2020 19:04
Chenyang-L pushed a commit that referenced this pull request Feb 18, 2025
Handle INVALID_VALUE in OCL urPlatformGet
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