Skip to content

Commit

Permalink
[SYCL] Fix asynchronous exceptions handling
Browse files Browse the repository at this point in the history
This fixes following problem:
If provided async_handler throws an exceptions from passed exception
list, this list won't be cleared and exceptions will be thrown again
from queue destructor.

Signed-off-by: Mariya Podchishchaeva <mariya.podchishchaeva@intel.com>
  • Loading branch information
Fznamznon authored and bader committed Sep 6, 2019
1 parent 0c78bc8 commit 9040739
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sycl/include/CL/sycl/detail/queue_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ class queue_impl {

void throw_asynchronous() {
if (m_AsyncHandler && m_Exceptions.size()) {
m_AsyncHandler(m_Exceptions);
exception_list Exceptions;
std::swap(m_Exceptions, Exceptions);
m_AsyncHandler(Exceptions);
}
m_Exceptions.Clear();
}

RT::PiQueue createQueue(QueueOrder Order) {
Expand Down

0 comments on commit 9040739

Please sign in to comment.