summaryrefslogtreecommitdiff
path: root/boost/compute/detail/read_write_single_value.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/compute/detail/read_write_single_value.hpp')
-rw-r--r--boost/compute/detail/read_write_single_value.hpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/boost/compute/detail/read_write_single_value.hpp b/boost/compute/detail/read_write_single_value.hpp
index fde40d946c..3e613bc8c3 100644
--- a/boost/compute/detail/read_write_single_value.hpp
+++ b/boost/compute/detail/read_write_single_value.hpp
@@ -14,6 +14,7 @@
#include <boost/throw_exception.hpp>
#include <boost/compute/buffer.hpp>
+#include <boost/compute/event.hpp>
#include <boost/compute/exception.hpp>
#include <boost/compute/command_queue.hpp>
@@ -47,18 +48,18 @@ inline T read_single_value(const buffer &buffer, command_queue &queue)
// writes a single value at index to the buffer
template<class T>
-inline void write_single_value(const T &value,
- const buffer &buffer,
- size_t index,
- command_queue &queue)
+inline event write_single_value(const T &value,
+ const buffer &buffer,
+ size_t index,
+ command_queue &queue)
{
BOOST_ASSERT(index < buffer.size() / sizeof(T));
BOOST_ASSERT(buffer.get_context() == queue.get_context());
- queue.enqueue_write_buffer(buffer,
- index * sizeof(T),
- sizeof(T),
- &value);
+ return queue.enqueue_write_buffer(buffer,
+ index * sizeof(T),
+ sizeof(T),
+ &value);
}
// writes value to the first location in buffer