mapped_array map(const cl::CommandQueue &q) { return mapped_array( static_cast<T*>( q.enqueueMapBuffer( buffer, CL_TRUE, CL_MAP_READ | CL_MAP_WRITE, 0, size() * sizeof(T) ) ), buffer_unmapper(q, buffer) ); }
mapped_array map(boost::compute::command_queue q) const { return mapped_array( static_cast<T*>( q.enqueue_map_buffer( buffer, CL_MAP_READ, 0, size() * sizeof(T) ) ), buffer_unmapper(q, buffer) ); }
/** * \note The host memory gets unmapped automatically when the returned * pointer goes out of scope. */ mapped_array map(const command_queue &q) { mapped_array ptr(new T[n], buffer_unmapper(q, *this)); read(q, 0, n, ptr.get(), true); return ptr; }