@@ -163,8 +163,10 @@ TEST(GetProfilingInfo, command_exception_check) {
163163 (void )submit_time;
164164 FAIL ();
165165 } catch (sycl::exception &e) {
166- EXPECT_STREQ (e.what (), " get_profiling_info() can't be used without set "
167- " 'enable_profiling' queue property" );
166+ EXPECT_STREQ (
167+ e.what (),
168+ " Profiling information is unavailable as the queue associated with "
169+ " the event does not have the 'enable_profiling' property." );
168170 }
169171 }
170172 {
@@ -180,8 +182,10 @@ TEST(GetProfilingInfo, command_exception_check) {
180182 FAIL ();
181183 } catch (sycl::exception const &e) {
182184 std::cerr << e.what () << std::endl;
183- EXPECT_STREQ (e.what (), " get_profiling_info() can't be used without set "
184- " 'enable_profiling' queue property" );
185+ EXPECT_STREQ (
186+ e.what (),
187+ " Profiling information is unavailable as the queue associated with "
188+ " the event does not have the 'enable_profiling' property." );
185189 }
186190 }
187191 {
@@ -195,12 +199,45 @@ TEST(GetProfilingInfo, command_exception_check) {
195199 (void )end_time;
196200 FAIL ();
197201 } catch (sycl::exception const &e) {
198- EXPECT_STREQ (e.what (), " get_profiling_info() can't be used without set "
199- " 'enable_profiling' queue property" );
202+ EXPECT_STREQ (
203+ e.what (),
204+ " Profiling information is unavailable as the queue associated with "
205+ " the event does not have the 'enable_profiling' property." );
200206 }
201207 }
202208}
203209
210+ TEST (GetProfilingInfo, exception_check_no_queue) {
211+ sycl::event E;
212+ try {
213+ auto info =
214+ E.get_profiling_info <sycl::info::event_profiling::command_submit>();
215+ (void )info;
216+ FAIL ();
217+ } catch (sycl::exception const &e) {
218+ EXPECT_STREQ (e.what (), " Profiling information is unavailable as the event "
219+ " has no associated queue." );
220+ }
221+ try {
222+ auto info =
223+ E.get_profiling_info <sycl::info::event_profiling::command_start>();
224+ (void )info;
225+ FAIL ();
226+ } catch (sycl::exception const &e) {
227+ EXPECT_STREQ (e.what (), " Profiling information is unavailable as the event "
228+ " has no associated queue." );
229+ }
230+ try {
231+ auto info =
232+ E.get_profiling_info <sycl::info::event_profiling::command_end>();
233+ (void )info;
234+ FAIL ();
235+ } catch (sycl::exception const &e) {
236+ EXPECT_STREQ (e.what (), " Profiling information is unavailable as the event "
237+ " has no associated queue." );
238+ }
239+ }
240+
204241TEST (GetProfilingInfo, check_if_now_dead_queue_property_set) {
205242 sycl::platform Plt{sycl::default_selector{}};
206243 if (Plt.is_host ()) {
@@ -302,8 +339,10 @@ TEST(GetProfilingInfo, check_if_now_dead_queue_property_not_set) {
302339 (void )submit_time;
303340 FAIL ();
304341 } catch (sycl::exception &e) {
305- EXPECT_STREQ (e.what (), " get_profiling_info() can't be used without set "
306- " 'enable_profiling' queue property" );
342+ EXPECT_STREQ (
343+ e.what (),
344+ " Profiling information is unavailable as the queue associated with "
345+ " the event does not have the 'enable_profiling' property." );
307346 }
308347 }
309348 {
@@ -314,8 +353,10 @@ TEST(GetProfilingInfo, check_if_now_dead_queue_property_not_set) {
314353 (void )start_time;
315354 FAIL ();
316355 } catch (sycl::exception &e) {
317- EXPECT_STREQ (e.what (), " get_profiling_info() can't be used without set "
318- " 'enable_profiling' queue property" );
356+ EXPECT_STREQ (
357+ e.what (),
358+ " Profiling information is unavailable as the queue associated with "
359+ " the event does not have the 'enable_profiling' property." );
319360 }
320361 }
321362 {
@@ -325,8 +366,10 @@ TEST(GetProfilingInfo, check_if_now_dead_queue_property_not_set) {
325366 (void )end_time;
326367 FAIL ();
327368 } catch (sycl::exception &e) {
328- EXPECT_STREQ (e.what (), " get_profiling_info() can't be used without set "
329- " 'enable_profiling' queue property" );
369+ EXPECT_STREQ (
370+ e.what (),
371+ " Profiling information is unavailable as the queue associated with "
372+ " the event does not have the 'enable_profiling' property." );
330373 }
331374 }
332375 // The test passes without this, but keep it still, just in case.
0 commit comments