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
+ // ===----------------------------------------------------------------------===//
1
9
#include < CL/sycl.hpp>
2
10
3
11
#include < helpers/CommonRedefinitions.hpp>
@@ -81,6 +89,20 @@ inline pi_result redefinedProgramCompile(pi_program, pi_uint32,
81
89
82
90
TEST (Link_Compile_Options, compile_link_Options_Test_empty) {
83
91
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
+ }
84
106
sycl::unittest::PiMock Mock{Plt};
85
107
setupDefaultMockAPIs (Mock);
86
108
Mock.redefine <sycl::detail::PiApiKind::piProgramCompile>(
@@ -114,6 +136,20 @@ TEST(Link_Compile_Options, compile_link_Options_Test_empty) {
114
136
115
137
TEST (Link_Compile_Options, one_link_option_Test) {
116
138
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
+ }
117
153
sycl::unittest::PiMock Mock{Plt};
118
154
setupDefaultMockAPIs (Mock);
119
155
Mock.redefine <sycl::detail::PiApiKind::piProgramCompile>(
@@ -147,6 +183,20 @@ TEST(Link_Compile_Options, one_link_option_Test) {
147
183
148
184
TEST (Link_Compile_Options, one_compile_option_Test) {
149
185
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
+ }
150
200
sycl::unittest::PiMock Mock{Plt};
151
201
setupDefaultMockAPIs (Mock);
152
202
Mock.redefine <sycl::detail::PiApiKind::piProgramCompile>(
@@ -180,6 +230,20 @@ TEST(Link_Compile_Options, one_compile_option_Test) {
180
230
181
231
TEST (Link_Compile_Options, one_link_and_compile_option_Test) {
182
232
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
+ }
183
247
sycl::unittest::PiMock Mock{Plt};
184
248
setupDefaultMockAPIs (Mock);
185
249
Mock.redefine <sycl::detail::PiApiKind::piProgramCompile>(
@@ -209,4 +273,4 @@ TEST(Link_Compile_Options, one_link_and_compile_option_Test) {
209
273
sycl::link (BundleObj);
210
274
EXPECT_EQ (expected_link_options, current_link_options);
211
275
EXPECT_EQ (expected_compile_options, current_compile_options);
212
- }
276
+ }
0 commit comments