@@ -41,20 +41,30 @@ namespace
41
41
{
42
42
DEFINE_SIMPLE_CONVERSION_FUNCTIONS (queue, DPCTLSyclQueueRef);
43
43
44
+ void error_handler_fn (int /* err*/ )
45
+ {
46
+ return ;
47
+ }
48
+
44
49
struct TestDPCTLQueueMemberFunctions
45
- : public ::testing::TestWithParam<const char *>
50
+ : public ::testing::TestWithParam<
51
+ std::tuple<const char *, DPCTLQueuePropertyType, bool >>
46
52
{
47
53
protected:
48
54
DPCTLSyclQueueRef QRef = nullptr ;
49
55
50
56
TestDPCTLQueueMemberFunctions ()
51
57
{
52
- auto DS = DPCTLFilterSelector_Create (GetParam ());
58
+ auto param_tuple = GetParam ();
59
+ auto DS = DPCTLFilterSelector_Create (std::get<0 >(param_tuple));
53
60
DPCTLSyclDeviceRef DRef = nullptr ;
54
61
if (DS) {
55
62
EXPECT_NO_FATAL_FAILURE (DRef = DPCTLDevice_CreateFromSelector (DS));
56
- EXPECT_NO_FATAL_FAILURE (QRef = DPCTLQueue_CreateForDevice (
57
- DRef, nullptr , DPCTL_DEFAULT_PROPERTY));
63
+ EXPECT_NO_FATAL_FAILURE (
64
+ QRef = DPCTLQueue_CreateForDevice (
65
+ DRef,
66
+ (std::get<2 >(param_tuple)) ? &error_handler_fn : nullptr ,
67
+ std::get<1 >(param_tuple)));
58
68
}
59
69
DPCTLDevice_Delete (DRef);
60
70
DPCTLDeviceSelector_Delete (DS);
@@ -63,8 +73,9 @@ struct TestDPCTLQueueMemberFunctions
63
73
void SetUp ()
64
74
{
65
75
if (!QRef) {
76
+ auto param_tuple = GetParam ();
66
77
auto message = " Skipping as no device of type " +
67
- std::string (GetParam ( )) + " ." ;
78
+ std::string (std::get< 0 >(param_tuple )) + " ." ;
68
79
GTEST_SKIP_ (message.c_str ());
69
80
}
70
81
}
@@ -284,8 +295,14 @@ TEST_P(TestDPCTLQueueMemberFunctions, CheckGetDevice)
284
295
EXPECT_NO_FATAL_FAILURE (DPCTLDevice_Delete (D));
285
296
}
286
297
287
- INSTANTIATE_TEST_SUITE_P (DPCTLQueueMemberFuncTests,
288
- TestDPCTLQueueMemberFunctions,
289
- ::testing::Values (" opencl:gpu:0" ,
290
- " opencl:cpu:0" ,
291
- " level_zero:gpu:0" ));
298
+ INSTANTIATE_TEST_SUITE_P (
299
+ DPCTLQueueMemberFuncTests,
300
+ TestDPCTLQueueMemberFunctions,
301
+ ::testing::Combine (
302
+ ::testing::Values (" opencl:gpu" , " opencl:cpu" , " level_zero:gpu" ),
303
+ ::testing::Values(DPCTL_DEFAULT_PROPERTY,
304
+ DPCTL_ENABLE_PROFILING,
305
+ DPCTL_IN_ORDER,
306
+ static_cast <DPCTLQueuePropertyType>(
307
+ DPCTL_ENABLE_PROFILING | DPCTL_IN_ORDER)),
308
+ ::testing::Bool()));
0 commit comments