-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL] Introduce a fully-mocked PI plugin for unit tests #6684
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] Introduce a fully-mocked PI plugin for unit tests #6684
Conversation
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
…all-pi-entry-points
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Newest work changes PiMock to always use the mock plugin. This means the unittests should be fully independent of which plugins and devices are available on the system. Additionally, this means all tests that were previously requiring a specific backend (mostly opencl previously) will no longer skip the tests silently. As the next steps, documentation should be expanded to detail this, then I believe this can be ready for review. |
…eing selected Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
…all-pi-entry-points
…all-pi-entry-points
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
This is ready for review. |
…all-pi-entry-points
@romanovvlad & @kbobrovs & @smaslov-intel - Friendly ping. |
@@ -30,35 +29,22 @@ pi_result redefinedMemBufferCreate(pi_context, pi_mem_flags, size_t size, | |||
|
|||
class EventDestructionTest : public ::testing::Test { | |||
public: | |||
EventDestructionTest() : Plt{default_selector()} {} | |||
EventDestructionTest() : Mock{}, Plt{Mock.getPlatform()} {} |
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.
Maybe for another PR - it seems this a common pattern that we can factor out into a base class MockTest
.
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 think that would be good, but I would prefer that to be a separate that into another patch. This patch is already quite large.
LGTM, but I'll leave SYCL RT approval to Vlad. |
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.
LGTM. Minor comments:
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
4b42464
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
unexpected pass in spec_const/spec_const_double.cpp is known. Merging. |
@AlexeySachkov, Windows post commit broken: https://github.com/intel/llvm/actions/runs/3062525013/jobs/4943601263 |
#6798 should fix the issue. |
The idea behind this PR is to introduce an infrastructure which allows to write unit-tests, which are not dependent on a presence of actual backends (like OpenCL, L0, etc.) or devices (like CPU, GPU, etc.).
Motivation for the patch: host device is going to be removed and we have a number of in-tree LIT tests, which can't pass if there are no devices available, so they are likely to be removed/disabled in short-term (#6683), unless we move them into llvm-test-suite or unit-tests with new infrastructure suggested here.