Skip to content

Commit 5c54a42

Browse files
[SYCL][NFC] Fix kernel release test when only host device is available (#1835)
PIMock should only be constructed from a non-host platform, make the test check for a non-host platform prior to constructing PIMock. Signed-off-by: Sergey Semenov <[email protected]>
1 parent 03dd60d commit 5c54a42

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sycl/unittests/program/KernelRelease.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ pi_result redefinedKernelGetInfo(pi_kernel kernel, pi_kernel_info param_name,
6969
}
7070

7171
TEST(KernelReleaseTest, GetKernelRelease) {
72-
unittest::PiMock Mock;
73-
platform Plt = Mock.getPlatform();
72+
platform Plt{default_selector()};
7473
if (Plt.is_host()) {
75-
std::cerr << "The program/kernel methods are mostly no-op on the host "
74+
std::cout << "The program/kernel methods are mostly no-op on the host "
7675
"device, the test is not run."
7776
<< std::endl;
7877
return;
7978
}
8079

80+
unittest::PiMock Mock{Plt};
8181
Mock.redefine<detail::PiApiKind::piclProgramCreateWithSource>(
8282
redefinedProgramCreateWithSource);
8383
Mock.redefine<detail::PiApiKind::piProgramBuild>(redefinedProgramBuild);

0 commit comments

Comments
 (0)