@@ -159,15 +159,21 @@ struct urSamplerTest : urContextTest {
159
159
UR_SAMPLER_ADDRESSING_MODE_CLAMP, /* addressing mode */
160
160
UR_SAMPLER_FILTER_MODE_LINEAR, /* filterMode */
161
161
};
162
- ASSERT_SUCCESS (urSamplerCreate (context, &sampler_desc, &sampler));
162
+ auto ret = urSamplerCreate (context, &sampler_desc, &sampler);
163
+ if (ret == UR_RESULT_ERROR_UNSUPPORTED_FEATURE ||
164
+ ret == UR_RESULT_ERROR_UNINITIALIZED) {
165
+ GTEST_SKIP () << " urSamplerCreate not supported" ;
166
+ }
163
167
}
164
168
165
169
void TearDown () override {
166
- EXPECT_SUCCESS (urSamplerRelease (sampler));
170
+ if (sampler) {
171
+ EXPECT_SUCCESS (urSamplerRelease (sampler));
172
+ }
167
173
UUR_RETURN_ON_FATAL_FAILURE (urContextTest::TearDown ());
168
174
}
169
175
170
- ur_sampler_handle_t sampler;
176
+ ur_sampler_handle_t sampler = nullptr ;
171
177
ur_sampler_desc_t sampler_desc;
172
178
};
173
179
@@ -263,15 +269,22 @@ template <class T> struct urSamplerTestWithParam : urContextTestWithParam<T> {
263
269
UR_SAMPLER_ADDRESSING_MODE_CLAMP, /* addressing mode */
264
270
UR_SAMPLER_FILTER_MODE_LINEAR, /* filterMode */
265
271
};
266
- ASSERT_SUCCESS (urSamplerCreate (this ->context , &sampler_desc, &sampler));
272
+ auto ret = urSamplerCreate (this ->context , &sampler_desc, &sampler);
273
+ if (ret == UR_RESULT_ERROR_UNSUPPORTED_FEATURE ||
274
+ ret == UR_RESULT_ERROR_UNINITIALIZED) {
275
+ GTEST_SKIP () << " urSamplerCreate not supported" ;
276
+ }
267
277
}
268
278
269
279
void TearDown () override {
270
- EXPECT_SUCCESS (urSamplerRelease (sampler));
280
+ if (sampler) {
281
+ EXPECT_SUCCESS (urSamplerRelease (sampler));
282
+ }
283
+
271
284
UUR_RETURN_ON_FATAL_FAILURE (urContextTestWithParam<T>::TearDown ());
272
285
}
273
286
274
- ur_sampler_handle_t sampler;
287
+ ur_sampler_handle_t sampler = nullptr ;
275
288
ur_sampler_desc_t sampler_desc;
276
289
};
277
290
0 commit comments