@@ -226,8 +226,13 @@ template <>
226
226
cl_ulong
227
227
event_impl::get_profiling_info<info::event_profiling::command_submit>() const {
228
228
if (!MHostEvent) {
229
- return get_event_profiling_info<info::event_profiling::command_submit>::get (
230
- this ->getHandleRef (), this ->getPlugin ());
229
+ if (MEvent)
230
+ return get_event_profiling_info<
231
+ info::event_profiling::command_submit>::get (this ->getHandleRef (),
232
+ this ->getPlugin ());
233
+ // TODO this should throw an exception if the queue the dummy event is
234
+ // bound to does not support profiling info.
235
+ return 0 ;
231
236
}
232
237
if (!MHostProfilingInfo)
233
238
throw invalid_object_error (" Profiling info is not available." ,
@@ -239,8 +244,13 @@ template <>
239
244
cl_ulong
240
245
event_impl::get_profiling_info<info::event_profiling::command_start>() const {
241
246
if (!MHostEvent) {
242
- return get_event_profiling_info<info::event_profiling::command_start>::get (
243
- this ->getHandleRef (), this ->getPlugin ());
247
+ if (MEvent)
248
+ return get_event_profiling_info<
249
+ info::event_profiling::command_start>::get (this ->getHandleRef (),
250
+ this ->getPlugin ());
251
+ // TODO this should throw an exception if the queue the dummy event is
252
+ // bound to does not support profiling info.
253
+ return 0 ;
244
254
}
245
255
if (!MHostProfilingInfo)
246
256
throw invalid_object_error (" Profiling info is not available." ,
@@ -252,8 +262,12 @@ template <>
252
262
cl_ulong
253
263
event_impl::get_profiling_info<info::event_profiling::command_end>() const {
254
264
if (!MHostEvent) {
255
- return get_event_profiling_info<info::event_profiling::command_end>::get (
256
- this ->getHandleRef (), this ->getPlugin ());
265
+ if (MEvent)
266
+ return get_event_profiling_info<info::event_profiling::command_end>::get (
267
+ this ->getHandleRef (), this ->getPlugin ());
268
+ // TODO this should throw an exception if the queue the dummy event is
269
+ // bound to does not support profiling info.
270
+ return 0 ;
257
271
}
258
272
if (!MHostProfilingInfo)
259
273
throw invalid_object_error (" Profiling info is not available." ,
@@ -262,7 +276,7 @@ event_impl::get_profiling_info<info::event_profiling::command_end>() const {
262
276
}
263
277
264
278
template <> cl_uint event_impl::get_info<info::event::reference_count>() const {
265
- if (!MHostEvent) {
279
+ if (!MHostEvent && MEvent ) {
266
280
return get_event_info<info::event::reference_count>::get (
267
281
this ->getHandleRef (), this ->getPlugin ());
268
282
}
@@ -272,7 +286,7 @@ template <> cl_uint event_impl::get_info<info::event::reference_count>() const {
272
286
template <>
273
287
info::event_command_status
274
288
event_impl::get_info<info::event::command_execution_status>() const {
275
- if (!MHostEvent) {
289
+ if (!MHostEvent && MEvent ) {
276
290
return get_event_info<info::event::command_execution_status>::get (
277
291
this ->getHandleRef (), this ->getPlugin ());
278
292
}
0 commit comments