From 1d3d38a2618c5663bf1549b08805137fd85f2efa Mon Sep 17 00:00:00 2001 From: cnugteren Date: Sat, 9 Apr 2016 22:22:24 -0600 Subject: Events are now properly implemented using event waiting list and asking the user to wait for event completion --- include/internal/routine.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'include/internal/routine.h') diff --git a/include/internal/routine.h b/include/internal/routine.h index 5f5b8211..b2b6f622 100644 --- a/include/internal/routine.h +++ b/include/internal/routine.h @@ -55,7 +55,7 @@ class Routine { static constexpr bool ErrorIn(const StatusCode s) { return (s != StatusCode::kSuccess); } // Base class constructor - explicit Routine(Queue &queue, Event &event, const std::string &name, + explicit Routine(Queue &queue, EventPointer event, const std::string &name, const std::vector &routines, const Precision precision); // Set-up phase of the kernel @@ -65,7 +65,12 @@ class Routine { // Runs a kernel given the global and local thread sizes StatusCode RunKernel(Kernel &kernel, std::vector &global, - const std::vector &local); + const std::vector &local, EventPointer event, + std::vector& waitForEvents); + + // As above, but without an event waiting list + StatusCode RunKernel(Kernel &kernel, std::vector &global, + const std::vector &local, EventPointer event); // Tests for valid inputs of matrices A, B, and C StatusCode TestMatrixA(const size_t one, const size_t two, const Buffer &buffer, @@ -87,7 +92,8 @@ class Routine { // Copies/transposes a matrix and padds/unpads it with zeroes. This method is also able to write // to symmetric and triangular matrices through optional arguments. - StatusCode PadCopyTransposeMatrix(const size_t src_one, const size_t src_two, + StatusCode PadCopyTransposeMatrix(EventPointer event, std::vector& waitForEvents, + const size_t src_one, const size_t src_two, const size_t src_ld, const size_t src_offset, const Buffer &src, const size_t dest_one, const size_t dest_two, @@ -114,7 +120,7 @@ class Routine { // The OpenCL objects, accessible only from derived classes Queue queue_; - Event event_; + EventPointer event_; const Context context_; const Device device_; -- cgit v1.2.3