Skip to content

[NFCI][SYCL] Refactor device selection in platform_impl.cpp #12288

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 10 commits into from
Jan 5, 2024

Conversation

aelovikov-intel
Copy link
Contributor

Mostly "early continue" and use the same idioms for similar things.

@aelovikov-intel aelovikov-intel changed the title [NFCI][SYCL] Refactor amendDeviceAndSubDevices in platform_impl.cpp [NFCI][SYCL] Refactor device selection in platform_impl.cpp Jan 3, 2024
@aelovikov-intel aelovikov-intel marked this pull request as ready for review January 3, 2024 21:17
@aelovikov-intel aelovikov-intel requested a review from a team as a code owner January 3, 2024 21:17
(target.DeviceType.value() != info::device_type::all))) {
// This device was specifically requested and yet is not
// partitionable.
std::cout << "device is not partitionable: " << target << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

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

I understand these and other prints are actually diagnosing errors (e.g. trying to partition a device that is not partitionable). Is my understanding correct? If so, I wonder if just printing and keep going as if nothing happened is good enough as a diagnostic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They were here before me, any changes in the behavior should go into a separate PR :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I saw they were already there in the old version, and I agree that it should be a separate PR if we change that, but I wanted to bring up the debate. What do you think? Should we keep diagnostics as they are now? Or should we stop if we find an error?

I'm approving this PR since we agreed this should go into a separate PR, if we do anything about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I honestly would expect an exception thrown, but maybe @cperkinsintel had his reasons to implement it this way (I assume it was added as part of his major work in this area).

Copy link
Contributor

@maarquitos14 maarquitos14 left a comment

Choose a reason for hiding this comment

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

LGTM.

@aelovikov-intel aelovikov-intel merged commit ca0ec76 into intel:sycl Jan 5, 2024
@aelovikov-intel aelovikov-intel deleted the refactor-amend-dev branch January 5, 2024 16:33
aelovikov-intel added a commit to aelovikov-intel/llvm that referenced this pull request Jan 9, 2024
The very last commit in that PR
(intel@f9a1377)
accidentally removed one condition needed to add the device into allowed
devices list. Restore it here.
aelovikov-intel added a commit that referenced this pull request Jan 9, 2024
The very last commit in #12288

(f9a1377)
accidentally removed one condition needed to add the device into allowed
devices list. Restore it here.
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.

2 participants