-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL][EXT] Define a new device selector that filters based on string input #2163
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
Conversation
Signed-off-by: James Brodman <[email protected]>
Signed-off-by: James Brodman <[email protected]>
Signed-off-by: James Brodman <[email protected]>
Signed-off-by: James Brodman <[email protected]>
Signed-off-by: James Brodman <[email protected]>
int Score = REJECT_DEVICE_SCORE; | ||
|
||
std::string CPU = "cpu"; | ||
std::string GPU = "gpu"; |
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.
Are there plans to support accelerator(s) eventually as well?
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.
Or even FPGA :-), since it is a string and does not need anything predefined in SYCL specification...
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, this can be extended with more types in the future as necessary.
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t1.out | ||
// RUN: %t1.out | ||
|
||
// REQUIRES: cpu, gpu, opencl |
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 checks below are written in quite safe manner, i.e. the test should pass with even only one of CPU or GPU is available.
Can this line be: "// REQUIRES: opencl" ? or be simply removed?
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.
I'd prefer to check that it can do different things in the same program.
int Score = REJECT_DEVICE_SCORE; | ||
|
||
std::string CPU = "cpu"; | ||
std::string GPU = "gpu"; |
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.
Or even FPGA :-), since it is a string and does not need anything predefined in SYCL specification...
Signed-off-by: James Brodman <[email protected]>
Signed-off-by: James Brodman <[email protected]>
@rolandschulz, @Pennycook, any comments? @romanovvlad, please, review and merge if it looks okay to you. |
I expect we're going to need to iterate on the syntax for this string a few times, especially given the existence of #2239. I think users are going to be confused if one string is formatted as I don't feel strongly enough to block this PR, but tagging @jbrodman and @bso-intel to make them aware of both PRs. |
string_selector takes a string that has the format "plat=Plat1,Plat2;type=Type1,Type2"
The platform strings should be something contained in platform.get_infoinfo::platform::name().
The device types atm are only either "cpu" or "gpu"
Valid inputs are:
""
"platform=Intel"
"type=cpu"
"platform=OpenCL;type=gpu,cpu"
and so forth.
Devices that match the supplied filters are then ranked according to the default selector.
Signed-off-by: James Brodman [email protected]