@@ -163,8 +163,10 @@ TEST(GetProfilingInfo, command_exception_check) {
163
163
(void )submit_time;
164
164
FAIL ();
165
165
} 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." );
168
170
}
169
171
}
170
172
{
@@ -180,8 +182,10 @@ TEST(GetProfilingInfo, command_exception_check) {
180
182
FAIL ();
181
183
} catch (sycl::exception const &e) {
182
184
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." );
185
189
}
186
190
}
187
191
{
@@ -195,12 +199,45 @@ TEST(GetProfilingInfo, command_exception_check) {
195
199
(void )end_time;
196
200
FAIL ();
197
201
} 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." );
200
206
}
201
207
}
202
208
}
203
209
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
+
204
241
TEST (GetProfilingInfo, check_if_now_dead_queue_property_set) {
205
242
sycl::platform Plt{sycl::default_selector{}};
206
243
if (Plt.is_host ()) {
@@ -302,8 +339,10 @@ TEST(GetProfilingInfo, check_if_now_dead_queue_property_not_set) {
302
339
(void )submit_time;
303
340
FAIL ();
304
341
} 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." );
307
346
}
308
347
}
309
348
{
@@ -314,8 +353,10 @@ TEST(GetProfilingInfo, check_if_now_dead_queue_property_not_set) {
314
353
(void )start_time;
315
354
FAIL ();
316
355
} 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." );
319
360
}
320
361
}
321
362
{
@@ -325,8 +366,10 @@ TEST(GetProfilingInfo, check_if_now_dead_queue_property_not_set) {
325
366
(void )end_time;
326
367
FAIL ();
327
368
} 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." );
330
373
}
331
374
}
332
375
// The test passes without this, but keep it still, just in case.
0 commit comments