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][PI][OPENCL] Testing for eliminate usage of regex in opencl #11204

Conversation

omarahmed1111
Copy link
Contributor

@omarahmed1111 omarahmed1111 commented Sep 18, 2023

DO NOT MERGE

bool haveOCLPrefix =
std::equal(prefix.begin(), prefix.end(), version.begin());

if (haveOCLPrefix && versionBegin != std::string::npos &&
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if there is any situation where this is expected to fail at runtime? If not, we could maybe turn this if condition into an assertion

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From what I found of how this function was used. Is that if an invalid string version was passed, it will keep the ocl_major - ocl_minor with a 0 value, which isValid function will return false in that case. and how I saw this propagating up. Is that it will return a relevant cl error code associated with the called function like CL_INVALID_PLATFORM in getPlatformVersion. I think the current way will give more information of where the faulty version string was passed from, but asserting will bail out the program without giving this information. however, I think this is more still of an assertion situation, but not sure if the assertion way could make some resources not being deleted appropriately or this cl error code are more of expected thing in the source code in another code place that depend on it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I forgot to answer this. What you say makes sense. I think it's fine to keep it as is 👍

@omarahmed1111 omarahmed1111 force-pushed the eliminate-usage-of-regex-in-opencl branch 3 times, most recently from e250134 to 59d5409 Compare October 23, 2023 10:15
@omarahmed1111 omarahmed1111 force-pushed the eliminate-usage-of-regex-in-opencl branch from 59d5409 to 291b945 Compare October 23, 2023 15:03
@omarahmed1111 omarahmed1111 force-pushed the eliminate-usage-of-regex-in-opencl branch from 291b945 to 47bf07d Compare November 3, 2023 15:11
@omarahmed1111
Copy link
Contributor Author

Moved the functionality to UR repo here

@omarahmed1111 omarahmed1111 force-pushed the eliminate-usage-of-regex-in-opencl branch from 47bf07d to b293909 Compare November 7, 2023 15:49
@omarahmed1111 omarahmed1111 changed the title [SYCL][PI][OPENCL] eliminate usage of regex in opencl [SYCL][PI][OPENCL] Testing for eliminate usage of regex in opencl Nov 8, 2023
@omarahmed1111 omarahmed1111 force-pushed the eliminate-usage-of-regex-in-opencl branch from b293909 to d325624 Compare November 8, 2023 12:34
@omarahmed1111 omarahmed1111 force-pushed the eliminate-usage-of-regex-in-opencl branch from d325624 to f579f35 Compare November 8, 2023 12:40
@kbenzie
Copy link
Contributor

kbenzie commented Nov 24, 2023

I'll be combining this change with some others from UR in a separate PR, closing.

@kbenzie kbenzie closed this Nov 24, 2023
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.

3 participants