-
Notifications
You must be signed in to change notification settings - Fork 744
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] Align get_info<info::device::version>() with the SYCL spec #2507
[SYCL] Align get_info<info::device::version>() with the SYCL spec #2507
Conversation
According to the SYCL spec, cl::sycl::info::device::version should be returned in a form: `<major_version>.<minor_version>` This patch trims the string returned from the piDeviceGetInfo call. For example, for the string "OpenCL 2.1 (Build 0)", it will return "2.1".
fe4a8d8
to
e39575e
Compare
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 update basic_tests/parallel_for_range, sub_group/broadcast and sub_group/broadcast_fp64 tests, and add test cases for L0, CUDA, OpenCL CPU, OpenCL ACC and host device.
e9b312a
to
1b40b9f
Compare
leftPos++; | ||
|
||
auto rightPos = result.find(' ', dotPos); | ||
return result.substr(leftPos, rightPos - leftPos); |
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.
the function is not robust. If version string contains "bla X.Y.Z bla" it will report X.Y.Z which also violates spec.
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.
Yes, I know. It will also violate the spec if the plugin call returns the string without a dot, like 'XYZ'. What we should do in this case? Throwing an exception seems too strict, isn't it?
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.
can we make sure that if format of the version returned by BE does not fit our requirements (e.g. no dot, X.Y.Z, X.Y at the end of string) the user friendly string will be displayed (e.g. the whole string returned by BE, X.Y(.Z is ignored), X.Y).
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.
Ok. This is what I'm doing if the string doesn't have the dot. E.g. For string "bla XdotY bla" I return "bla XdotY bla".
I'm not sure how you define "user friendly string".
you updated info::device::version but spec contains also info::platform::version with the same wording. Could you please ensure that is follows the spec as well. |
Sure, I can do that. Don't you mind I do it in a separate patch? |
ok for me to do that in separate patch |
@DenisBakhvalov could you please put this change on hold until question below is resolved? @bader I see that in SYCL 2020 spec there is no requirement for info::platform::version format (major_number.minor_number). |
leftPos++; | ||
|
||
auto rightPos = result.find(' ', dotPos); | ||
return result.substr(leftPos, rightPos - leftPos); |
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.
can we make sure that if format of the version returned by BE does not fit our requirements (e.g. no dot, X.Y.Z, X.Y at the end of string) the user friendly string will be displayed (e.g. the whole string returned by BE, X.Y(.Z is ignored), X.Y).
Good question. @intel/dpcpp-specification-reviewers, what do you think? |
pinging @intel/dpcpp-specification-reviewers. |
@vladimirlaz, SYCL-2020 defines |
* sycl: (566 commits) [SYCL] Fix explicit copy operation for host device (intel#2627) [SYCL] Fix initialization issue on Windows (intel#2632) [SYCL][CUDA] Disable image_write test on CUDA devices (intel#2630) [SYCL] Removes any knowledge of specific memory advices from PI API. (intel#2607) [BuildBot] Uplift GPU RT version for Linux to 20.40.18075 (intel#2626) [SYCL] Wrap complex global objects to control lifetime (intel#2516) [SYCL][CUDA] Image Basic Test (intel#1970) [SYCL] Align get_info<info::device::version>() with the SYCL spec (intel#2507) [Driver][SYCL] Correct optimization disabling option for gen (intel#2622) [SYCL][LIT] Add deleter func for test in buffer.cpp to avoid potential SegFault (intel#2616) [SYCL] Remove half type alias causing name conflicts (intel#2624) [BuildBot] OpenCL CPU/FPGAEMU driver uplift (intel#2620) [SYCL][Doc] Add overview of kernel-program caching (intel#2514) [SYCL] Remove two-input sub-group shuffles (intel#2614) [SYCL] Add support for new spelling of FPGA kernel attribute scheduler_target_fmax_mhz (intel#2618) [SYCL] Align image class constructors with the SYCL spec (intel#2603) [SYCL] Remove tests migrated to llvm-test-suite (intel#2611) [SYCL][NFC] Fix dependency for SYCL add_sycl_executable macro (intel#2613) [SYCL][PI][L0] Update environment variables from LEVEL0 to LEVEL_ZERO (intel#2612) [SYCL] Add KernelNameTypeVisitor validation check (intel#2596) ...
-This reduces the number of required type casts.- This unifies all the version methods used in translator. Original commit: KhronosGroup/SPIRV-LLVM-Translator@a3d840ec247c5cb
According to the SYCL spec, cl::sycl::info::device::version
should be returned in a form:
<major_version>.<minor_version>
This patch trims the string returned from the piDeviceGetInfo call.
For example, for the string "OpenCL 2.1 (Build 0)",
it will return "2.1".