-
Notifications
You must be signed in to change notification settings - Fork 130
[SYCL] new tests for SYCL 2020 callable device selector interfaces #1119
[SYCL] new tests for SYCL 2020 callable device selector interfaces #1119
Conversation
Signed-off-by: Chris Perkins <[email protected]>
Signed-off-by: Chris Perkins <[email protected]>
/verify with intel/llvm#6486 |
SYCL/Basic/device-selectors.cpp
Outdated
assert(lastQueueWithHandler.get_device() == lastDevice && | ||
"queue created by selecting a device should have that same device"); | ||
|
||
context ctx = lastQueue.get_context(); |
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.
What are the devices in the ctx
at this point? Everything from last device's platform?
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.
who knows? It's most likely a context of one device, but it could be every device in the platform, or the main device plus a bunch of sub-devices. At least in theory.
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 it's one device only, then we're not testing much here...
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 rather do
{
context ctx(platform.get_all_devices()); // or whatever.
queue q(ctx, ...);
}
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. It's a bit more complicated than that, but I agree that it's best to try to make the test not-so-trivial.
SYCL/Basic/device-selectors.cpp
Outdated
queue lastQueueViaContext(ctx, select_last_device); | ||
assert(lastQueueWithHandler.get_device() == lastDevice && | ||
"queue created by selecting a device should have that same device"); |
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 don't think we really "test" that only ctx
'devices are processed here.
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.
Correct. We are just testing that it a) compiles correctly, and b) gets the device for the queue from the context.
Are |
Signed-off-by: Chris Perkins <[email protected]>
/verify with intel/llvm#6486 |
@aelovikov-intel - yeah aspect selectors will be something else. This is just for the new SYCL2020 Callable device selectors. Also, the standalone |
SYCL/Basic/device-selectors.cpp
Outdated
assert(lastQueueWithHandler.get_device() == lastDevice && | ||
"queue created by selecting a device should have that same device"); | ||
|
||
context ctx = lastQueue.get_context(); |
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 rather do
{
context ctx(platform.get_all_devices()); // or whatever.
queue q(ctx, ...);
}
|
||
// Check exceptions and failures. | ||
try { | ||
platform refusedPlatform(refuse_any_device_lambda); |
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 the above suggestion is implemented, then we can use p
/q
/d
as the variables' names.
Signed-off-by: Chris Perkins <[email protected]>
/verify with intel/llvm#6486 |
Signed-off-by: Chris Perkins <[email protected]>
/verify with intel/llvm#6486 |
intel/llvm#6486 introduces new callable device selectors. This PR adds new testing for them.
Signed-off-by: Chris Perkins [email protected]