@@ -41,20 +41,30 @@ namespace
4141{
4242DEFINE_SIMPLE_CONVERSION_FUNCTIONS (queue, DPCTLSyclQueueRef);
4343
44+ void error_handler_fn (int /* err*/ )
45+ {
46+ return ;
47+ }
48+
4449struct TestDPCTLQueueMemberFunctions
45- : public ::testing::TestWithParam<const char *>
50+ : public ::testing::TestWithParam<
51+ std::tuple<const char *, DPCTLQueuePropertyType, bool >>
4652{
4753protected:
4854 DPCTLSyclQueueRef QRef = nullptr ;
4955
5056 TestDPCTLQueueMemberFunctions ()
5157 {
52- auto DS = DPCTLFilterSelector_Create (GetParam ());
58+ auto param_tuple = GetParam ();
59+ auto DS = DPCTLFilterSelector_Create (std::get<0 >(param_tuple));
5360 DPCTLSyclDeviceRef DRef = nullptr ;
5461 if (DS) {
5562 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)));
5868 }
5969 DPCTLDevice_Delete (DRef);
6070 DPCTLDeviceSelector_Delete (DS);
@@ -63,8 +73,9 @@ struct TestDPCTLQueueMemberFunctions
6373 void SetUp ()
6474 {
6575 if (!QRef) {
76+ auto param_tuple = GetParam ();
6677 auto message = " Skipping as no device of type " +
67- std::string (GetParam ( )) + " ." ;
78+ std::string (std::get< 0 >(param_tuple )) + " ." ;
6879 GTEST_SKIP_ (message.c_str ());
6980 }
7081 }
@@ -284,8 +295,14 @@ TEST_P(TestDPCTLQueueMemberFunctions, CheckGetDevice)
284295 EXPECT_NO_FATAL_FAILURE (DPCTLDevice_Delete (D));
285296}
286297
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