diff --git a/sycl/source/detail/queue_impl.hpp b/sycl/source/detail/queue_impl.hpp index d42cb1c87e6cf..da434e1fe50f5 100644 --- a/sycl/source/detail/queue_impl.hpp +++ b/sycl/source/detail/queue_impl.hpp @@ -870,10 +870,7 @@ class queue_impl { event finalizeHandlerPostProcess( HandlerType &Handler, const optional &PostProcessorFunc) { - auto HandlerImpl = detail::getSyclObjImpl(Handler); - const CGType Type = HandlerImpl->MCGType; - - bool IsKernel = Type == CGType::Kernel; + bool IsKernel = Handler.getType() == CGType::Kernel; bool KernelUsesAssert = false; if (IsKernel)