Skip to content

Commit f8da779

Browse files
committed
Added skips for host, CUDA and HIP
1 parent 9079626 commit f8da779

File tree

1 file changed

+65
-1
lines changed

1 file changed

+65
-1
lines changed

sycl/unittests/program_manager/passing_link_and_compile_options.cpp

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
//==---- passing_link_and_compile_options.cpp --- Pass link and compile options
2+
// for online linker and compiler ---------==//
3+
//
4+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5+
// See https://llvm.org/LICENSE.txt for license information.
6+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7+
//
8+
//===----------------------------------------------------------------------===//
19
#include <CL/sycl.hpp>
210

311
#include <helpers/CommonRedefinitions.hpp>
@@ -81,6 +89,20 @@ inline pi_result redefinedProgramCompile(pi_program, pi_uint32,
8189

8290
TEST(Link_Compile_Options, compile_link_Options_Test_empty) {
8391
sycl::platform Plt{sycl::default_selector()};
92+
if (Plt.is_host()) {
93+
std::cerr << "Test is not supported on host, skipping\n";
94+
return; // test is not supported on host.
95+
}
96+
97+
if (Plt.get_backend() == sycl::backend::ext_oneapi_cuda) {
98+
std::cerr << "Test is not supported on CUDA platform, skipping\n";
99+
return;
100+
}
101+
102+
if (Plt.get_backend() == sycl::backend::ext_oneapi_hip) {
103+
std::cerr << "Test is not supported on HIP platform, skipping\n";
104+
return;
105+
}
84106
sycl::unittest::PiMock Mock{Plt};
85107
setupDefaultMockAPIs(Mock);
86108
Mock.redefine<sycl::detail::PiApiKind::piProgramCompile>(
@@ -114,6 +136,20 @@ TEST(Link_Compile_Options, compile_link_Options_Test_empty) {
114136

115137
TEST(Link_Compile_Options, one_link_option_Test) {
116138
sycl::platform Plt{sycl::default_selector()};
139+
if (Plt.is_host()) {
140+
std::cerr << "Test is not supported on host, skipping\n";
141+
return; // test is not supported on host.
142+
}
143+
144+
if (Plt.get_backend() == sycl::backend::ext_oneapi_cuda) {
145+
std::cerr << "Test is not supported on CUDA platform, skipping\n";
146+
return;
147+
}
148+
149+
if (Plt.get_backend() == sycl::backend::ext_oneapi_hip) {
150+
std::cerr << "Test is not supported on HIP platform, skipping\n";
151+
return;
152+
}
117153
sycl::unittest::PiMock Mock{Plt};
118154
setupDefaultMockAPIs(Mock);
119155
Mock.redefine<sycl::detail::PiApiKind::piProgramCompile>(
@@ -147,6 +183,20 @@ TEST(Link_Compile_Options, one_link_option_Test) {
147183

148184
TEST(Link_Compile_Options, one_compile_option_Test) {
149185
sycl::platform Plt{sycl::default_selector()};
186+
if (Plt.is_host()) {
187+
std::cerr << "Test is not supported on host, skipping\n";
188+
return; // test is not supported on host.
189+
}
190+
191+
if (Plt.get_backend() == sycl::backend::ext_oneapi_cuda) {
192+
std::cerr << "Test is not supported on CUDA platform, skipping\n";
193+
return;
194+
}
195+
196+
if (Plt.get_backend() == sycl::backend::ext_oneapi_hip) {
197+
std::cerr << "Test is not supported on HIP platform, skipping\n";
198+
return;
199+
}
150200
sycl::unittest::PiMock Mock{Plt};
151201
setupDefaultMockAPIs(Mock);
152202
Mock.redefine<sycl::detail::PiApiKind::piProgramCompile>(
@@ -180,6 +230,20 @@ TEST(Link_Compile_Options, one_compile_option_Test) {
180230

181231
TEST(Link_Compile_Options, one_link_and_compile_option_Test) {
182232
sycl::platform Plt{sycl::default_selector()};
233+
if (Plt.is_host()) {
234+
std::cerr << "Test is not supported on host, skipping\n";
235+
return; // test is not supported on host.
236+
}
237+
238+
if (Plt.get_backend() == sycl::backend::ext_oneapi_cuda) {
239+
std::cerr << "Test is not supported on CUDA platform, skipping\n";
240+
return;
241+
}
242+
243+
if (Plt.get_backend() == sycl::backend::ext_oneapi_hip) {
244+
std::cerr << "Test is not supported on HIP platform, skipping\n";
245+
return;
246+
}
183247
sycl::unittest::PiMock Mock{Plt};
184248
setupDefaultMockAPIs(Mock);
185249
Mock.redefine<sycl::detail::PiApiKind::piProgramCompile>(
@@ -209,4 +273,4 @@ TEST(Link_Compile_Options, one_link_and_compile_option_Test) {
209273
sycl::link(BundleObj);
210274
EXPECT_EQ(expected_link_options, current_link_options);
211275
EXPECT_EQ(expected_compile_options, current_compile_options);
212-
}
276+
}

0 commit comments

Comments
 (0)