-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Add support for platform name and platform version in device w… #890
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] Add support for platform name and platform version in device w… #890
Conversation
sycl/source/detail/platform_impl.cpp
Outdated
@@ -58,16 +58,26 @@ struct DevDescT { | |||
|
|||
const char *devDriverVer = nullptr; | |||
int devDriverVerSize = 0; | |||
|
|||
const char *pltName = nullptr; | |||
int pltNameSize = 0; |
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 you replace "plt" with "platform" everywhere? Unlike "dev" it is not really obvious.
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.
Done.
sycl/source/detail/platform_impl.cpp
Outdated
@@ -140,8 +166,17 @@ static void filterWhiteList(vector_class<RT::PiDevice> &pi_devices) { | |||
info::device::driver_version>::get(dev); | |||
|
|||
for (const DevDescT &desc : whiteList) { | |||
// At least device name is required field to consider the filter so far | |||
if (nullptr == desc.devName || | |||
if (nullptr != desc.pltName && |
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.
Since we get only one platform, can you move this check out of the "foreach devices" loop? And if the check for a platform failed, you can skip the rest.
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.
If I do it the filter
"PlatformName:{{ptl1}},DeviceName:{{dev1}}|PlatformName{{plt2}},DeviceName{{dev2}}
will match:
PlatformName = "plt2"
DeviceName = "dev1"
that is incorrect.
sycl/source/detail/platform_impl.cpp
Outdated
if (nullptr == desc.devName || | ||
if (nullptr != desc.pltName && | ||
!std::regex_match( | ||
pltName, std::regex(std::string(desc.pltName, desc.pltNameSize)))) |
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.
Not for this patch: you can replace std::regex(std::string) constructor with std::regex(const char*, size_t) constructor.
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.
Of course, already have it in the "refactor patch" I'm preparing.
sycl/test/config/white_list.cpp
Outdated
@@ -12,25 +17,49 @@ | |||
|
|||
using namespace cl; | |||
|
|||
static void replaceEscapeCharacters(std::string &Str) { | |||
// As a stringwill be used as regexp pattern, we need to get rid of symbols |
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.
stringwill -> string will
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.
Done.
…hitelist PlatformName and PlatformVersion are now supported keys. Also all fields are optional now, so SYCL_DEVICE_WHITE_LIST="" matches any device Signed-off-by: Vlad Romanov <[email protected]>
Signed-off-by: Vlad Romanov <[email protected]>
ce3da4f
to
64d1380
Compare
Signed-off-by: Vlad Romanov <[email protected]>
Signed-off-by: Vlad Romanov <[email protected]>
…hitelist
PlatformName and PlatformVersion are now supported keys. Also all fields
are optional now, so SYCL_DEVICE_WHITE_LIST="" matches any device
Signed-off-by: Vlad Romanov [email protected]