-
Notifications
You must be signed in to change notification settings - Fork 745
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][PI/CL] Check device version/extensions rather than platform version/extensions #6795
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dakr
force-pushed
the
pi_cl_plat_to_dev
branch
from
September 15, 2022 16:46
5cb6ca5
to
c0afeea
Compare
romanovvlad
reviewed
Sep 20, 2022
smaslov-intel
suggested changes
Sep 20, 2022
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.
Please do not alter PI API for this
dakr
force-pushed
the
pi_cl_plat_to_dev
branch
from
September 22, 2022 00:56
c0afeea
to
a68d3bd
Compare
dakr
force-pushed
the
pi_cl_plat_to_dev
branch
from
September 22, 2022 13:46
a68d3bd
to
7d553c0
Compare
dakr
requested review from
romanovvlad and
smaslov-intel
and removed request for
smaslov-intel and
romanovvlad
September 22, 2022 13:50
dakr
force-pushed
the
pi_cl_plat_to_dev
branch
4 times, most recently
from
September 23, 2022 02:11
98af518
to
fc5144c
Compare
romanovvlad
reviewed
Sep 23, 2022
dakr
force-pushed
the
pi_cl_plat_to_dev
branch
2 times, most recently
from
September 25, 2022 20:52
ecf2a33
to
e3ca585
Compare
dakr
requested review from
romanovvlad and
smaslov-intel
and removed request for
smaslov-intel and
romanovvlad
September 25, 2022 20:53
romanovvlad
reviewed
Sep 26, 2022
dakr
force-pushed
the
pi_cl_plat_to_dev
branch
from
September 26, 2022 14:43
e3ca585
to
8d69871
Compare
dakr
force-pushed
the
pi_cl_plat_to_dev
branch
2 times, most recently
from
September 27, 2022 01:11
d7062c6
to
78f8344
Compare
romanovvlad
requested changes
Sep 27, 2022
dakr
force-pushed
the
pi_cl_plat_to_dev
branch
from
September 27, 2022 14:35
78f8344
to
6f689c2
Compare
romanovvlad
approved these changes
Sep 27, 2022
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
smaslov-intel
approved these changes
Sep 27, 2022
This commit adds helper functions to query OpenCL device and platform versions as well as device extensions. While this patch is mainly motivated by a subsequent patch that adds some necessary version and extension checks to piProgramCreate() it also cleans up a few other places doing such queries. While at it, fix the missing error handling querying device extensions in piDeviceGetInfo(). Signed-off-by: Danilo Krummrich <dakr@redhat.com>
There might be platforms where the supported device version is lower than the platform version or where not all devices do support the same extensions and hence some extensions supported by particular devices are not reported in the platform extensions. In particular for CL_PLATFORM_EXTENSIONS the OpenCL specification says: "[...] Each extension that is supported by all devices associated with this platform must be reported here." In "3.4.1 Mixed Version Support" the specification also says: "[...] The version returned corresponds to the highest version of the OpenCL specification for which the device is conformant, but is not higher than the platform version." Hence, check for the device version and extensions rather than the platform version and extensions in piProgramCreate(). Signed-off-by: Danilo Krummrich <dakr@redhat.com>
dakr
force-pushed
the
pi_cl_plat_to_dev
branch
from
September 27, 2022 19:07
6f689c2
to
5524e9f
Compare
bader
changed the title
[SYCL][PI/CL] check device version/extensions rather than platform version/extensions
[SYCL][PI/CL] Check device version/extensions rather than platform version/extensions
Sep 28, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For OpenCL backends currently piProgramCreate() queries the platform version (CL_PLATFORM_VERSION) and platform extensions (CL_PLATFORM_EXTENSIONS) to check whether we're capable of running on top of a particular OpenCL backend.
However, there might be platforms where the supported device version is lower than the platform version or where not all devices do support the same extensions and hence some extensions supported by a particular device are not reported in the platform extensions.
In particular for CL_PLATFORM_EXTENSIONS the OpenCL specification says: "[...] Each extension that is supported by all devices associated with this platform must be reported here."
In 3.4.1 Mixed Version Support the specification also says: "[...] The version returned corresponds to the highest version of the OpenCL specification for which the device is conformant, but is not higher than the platform version."
Hence, check for the device version and extensions rather than the platform version and extensions in piProgramCreate().