[compute] 10/46: Merge pull request #510 from haahh/dev_events_for_queue_enqueue_methods

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Dec 21 18:28:38 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository compute.

commit b2e2bdfb0d13358023ab89cb1771af0bfe83ebc7
Merge: c75f5dc 55a7f87
Author: Kyle Lutz <kyle.r.lutz at gmail.com>
Date:   Mon Sep 28 19:50:10 2015 -0700

    Merge pull request #510 from haahh/dev_events_for_queue_enqueue_methods
    
    Events for queue enqueue_map_ methods

 include/boost/compute/command_queue.hpp | 329 +++++++++++++++++++++++++++++++-
 test/test_image2d.cpp                   |  60 ++++++
 2 files changed, 388 insertions(+), 1 deletion(-)

diff --cc include/boost/compute/command_queue.hpp
index e52f3a9,1458b56..2a2feb0
--- a/include/boost/compute/command_queue.hpp
+++ b/include/boost/compute/command_queue.hpp
@@@ -363,9 -357,54 +363,56 @@@ public
          if(ret != CL_SUCCESS){
              BOOST_THROW_EXCEPTION(opencl_error(ret));
          }
 +
 +        return event_;
      }
+ 
+     /// Enqueues a command to read a rectangular region from \p buffer to
+     /// host memory. The copy will be performed asynchronously.
+     ///
+     /// \see_opencl_ref{clEnqueueReadBufferRect}
+     ///
+     /// \opencl_version_warning{1,1}
+     event enqueue_read_buffer_rect_async(const buffer &buffer,
+                                          const size_t buffer_origin[3],
+                                          const size_t host_origin[3],
+                                          const size_t region[3],
+                                          size_t buffer_row_pitch,
+                                          size_t buffer_slice_pitch,
+                                          size_t host_row_pitch,
+                                          size_t host_slice_pitch,
+                                          void *host_ptr,
+                                          const wait_list &events = wait_list())
+     {
+         BOOST_ASSERT(m_queue != 0);
+         BOOST_ASSERT(buffer.get_context() == this->get_context());
+         BOOST_ASSERT(host_ptr != 0);
+ 
+         event event_;
+ 
+         cl_int ret = clEnqueueReadBufferRect(
+             m_queue,
+             buffer.get(),
+             CL_FALSE,
+             buffer_origin,
+             host_origin,
+             region,
+             buffer_row_pitch,
+             buffer_slice_pitch,
+             host_row_pitch,
+             host_slice_pitch,
+             host_ptr,
+             events.size(),
+             events.get_event_ptr(),
+             &event_.get()
+         );
+ 
+         if(ret != CL_SUCCESS){
+             BOOST_THROW_EXCEPTION(opencl_error(ret));
+         }
+ 
+         return event_;
+     }
      #endif // CL_VERSION_1_1
  
      /// Enqueues a command to write data from host memory to \p buffer.
@@@ -487,9 -520,54 +534,56 @@@
          if(ret != CL_SUCCESS){
              BOOST_THROW_EXCEPTION(opencl_error(ret));
          }
 +
 +        return event_;
      }
+ 
+     /// Enqueues a command to write a rectangular region from host memory
+     /// to \p buffer. The copy is performed asynchronously.
+     ///
+     /// \see_opencl_ref{clEnqueueWriteBufferRect}
+     ///
+     /// \opencl_version_warning{1,1}
+     event enqueue_write_buffer_rect_async(const buffer &buffer,
+                                           const size_t buffer_origin[3],
+                                           const size_t host_origin[3],
+                                           const size_t region[3],
+                                           size_t buffer_row_pitch,
+                                           size_t buffer_slice_pitch,
+                                           size_t host_row_pitch,
+                                           size_t host_slice_pitch,
+                                           void *host_ptr,
+                                           const wait_list &events = wait_list())
+     {
+         BOOST_ASSERT(m_queue != 0);
+         BOOST_ASSERT(buffer.get_context() == this->get_context());
+         BOOST_ASSERT(host_ptr != 0);
+ 
+         event event_;
+ 
+         cl_int ret = clEnqueueWriteBufferRect(
+             m_queue,
+             buffer.get(),
+             CL_FALSE,
+             buffer_origin,
+             host_origin,
+             region,
+             buffer_row_pitch,
+             buffer_slice_pitch,
+             host_row_pitch,
+             host_slice_pitch,
+             host_ptr,
+             events.size(),
+             events.get_event_ptr(),
+             &event_.get()
+         );
+ 
+         if(ret != CL_SUCCESS){
+             BOOST_THROW_EXCEPTION(opencl_error(ret));
+         }
+ 
+         return event_;
+     }
      #endif // CL_VERSION_1_1
  
      /// Enqueues a command to copy data from \p src_buffer to

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/compute.git



More information about the debian-science-commits mailing list