diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2018-08-14 22:52:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-14 22:52:36 +0200 |
commit | c2c1e5fa953659a8ccd647be2e98bc8505ac2abf (patch) | |
tree | 515498d33951368cf997c5bf1790e6bea458b5cf /src/routines/level2/xtrsv.cpp | |
parent | dd1fa7cc8184223900292939dab2518e6a28a6db (diff) | |
parent | bf43dbb4ee076ad74ea330fe87e457d20e297735 (diff) |
Merge pull request #312 from CNugteren/CLBlast-311-missing-event-in-trsv-trsm
Missing events in TRSV and TRSM
Diffstat (limited to 'src/routines/level2/xtrsv.cpp')
-rw-r--r-- | src/routines/level2/xtrsv.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/routines/level2/xtrsv.cpp b/src/routines/level2/xtrsv.cpp index 76401753..2a5a5664 100644 --- a/src/routines/level2/xtrsv.cpp +++ b/src/routines/level2/xtrsv.cpp @@ -33,7 +33,8 @@ void Xtrsv<T>::Substitution(const Layout layout, const Triangle triangle, const size_t n, const Buffer<T> &a_buffer, const size_t a_offset, const size_t a_ld, const Buffer<T> &b_buffer, const size_t b_offset, const size_t b_inc, - const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc) { + const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc, + EventPointer event) { if (n > db_["TRSV_BLOCK_SIZE"]) { throw BLASError(StatusCode::kUnexpectedError); }; @@ -69,9 +70,7 @@ void Xtrsv<T>::Substitution(const Layout layout, const Triangle triangle, // Launches the kernel const auto local = std::vector<size_t>{db_["TRSV_BLOCK_SIZE"]}; const auto global = std::vector<size_t>{Ceil(n, db_["TRSV_BLOCK_SIZE"])}; - auto event = Event(); - RunKernel(kernel, queue_, device_, global, local, event.pointer()); - event.WaitForCompletion(); + RunKernel(kernel, queue_, device_, global, local, event); } // ================================================================================================= @@ -146,14 +145,16 @@ void Xtrsv<T>::DoTrsv(const Layout layout, const Triangle triangle, } // Runs the triangular substitution for the block size + auto sub_event = Event(); Substitution(layout, triangle, a_transpose, diagonal, block_size, a_buffer, a_offset + col + col*a_ld, a_ld, b_buffer, b_offset + col*b_inc, b_inc, - x_buffer, x_offset + col*x_inc, x_inc); + x_buffer, x_offset + col*x_inc, x_inc, sub_event.pointer()); + sub_event.WaitForCompletion(); } // Retrieves the results - x_buffer.CopyTo(queue_, x_size, b_buffer); + x_buffer.CopyToAsync(queue_, x_size, b_buffer, event_); } // ================================================================================================= |