|
8 | 8 |
|
9 | 9 | #include "SchedulerTest.hpp" |
10 | 10 | #include "SchedulerTestUtils.hpp" |
11 | | -#include <detail/handler_impl.hpp> |
12 | 11 |
|
13 | 12 | #include <helpers/PiMock.hpp> |
14 | 13 | #include <helpers/ScopedEnvVar.hpp> |
|
19 | 18 | using namespace sycl; |
20 | 19 | using EventImplPtr = std::shared_ptr<detail::event_impl>; |
21 | 20 |
|
22 | | -namespace DependsOnTest { |
23 | | -class MockHandlerCustom : public MockHandler { |
24 | | -public: |
25 | | - MockHandlerCustom(std::shared_ptr<sycl::detail::queue_impl> Queue, |
26 | | - bool IsHost) |
27 | | - : MockHandler(Queue, IsHost) {} |
28 | | - |
29 | | - std::unique_ptr<sycl::detail::CG> finalize() { |
30 | | - std::unique_ptr<sycl::detail::CG> CommandGroup; |
31 | | - switch (getType()) { |
32 | | - case sycl::detail::CG::Kernel: { |
33 | | - CommandGroup.reset(new sycl::detail::CGExecKernel( |
34 | | - getNDRDesc(), std::move(getHostKernel()), getKernel(), |
35 | | - std::move(MImpl->MKernelBundle), getArgsStorage(), getAccStorage(), |
36 | | - getSharedPtrStorage(), getRequirements(), getEvents(), getArgs(), |
37 | | - getKernelName(), getOSModuleHandle(), getStreamStorage(), |
38 | | - MImpl->MAuxiliaryResources, getCGType(), getCodeLoc())); |
39 | | - break; |
40 | | - } |
41 | | - case sycl::detail::CG::CodeplayHostTask: { |
42 | | - CommandGroup.reset(new detail::CGHostTask( |
43 | | - std::move(getHostTask()), getQueue(), getQueue()->getContextImplPtr(), |
44 | | - getArgs(), getArgsStorage(), getAccStorage(), getSharedPtrStorage(), |
45 | | - getRequirements(), getEvents(), getCGType(), getCodeLoc())); |
46 | | - break; |
47 | | - } |
48 | | - default: |
49 | | - throw sycl::runtime_error("Unhandled type of command group", |
50 | | - PI_ERROR_INVALID_OPERATION); |
51 | | - } |
52 | | - |
53 | | - return CommandGroup; |
54 | | - } |
55 | | -}; |
56 | | -} // namespace DependsOnTest |
57 | 21 | detail::Command *AddTaskCG(bool IsHost, MockScheduler &MS, |
58 | 22 | detail::QueueImplPtr DevQueue, |
59 | 23 | const std::vector<EventImplPtr> &Events) { |
60 | 24 | std::vector<detail::Command *> ToEnqueue; |
61 | 25 |
|
62 | 26 | // Emulating processing of command group function |
63 | | - DependsOnTest::MockHandlerCustom MockCGH(DevQueue, false); |
| 27 | + MockHandlerCustomFinalize MockCGH(DevQueue, false); |
64 | 28 |
|
65 | 29 | for (auto EventImpl : Events) |
66 | 30 | MockCGH.depends_on(detail::createSyclObjFromImpl<event>(EventImpl)); |
|
0 commit comments