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