Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения

Class template mapped_view

Boost , Chapter 1. Boost.Compute , Reference

Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Class template mapped_view

boost::compute::mapped_view — A mapped view of host memory.

Synopsis

// In header: <boost/compute/container/mapped_view.hpp>
template<typename T> 
class mapped_view {
public:
  // types
  typedef T                    value_type;     
  typedef size_t               size_type;      
  typedef ptrdiff_t            difference_type;
  typedef buffer_iterator< T > iterator;       
  typedef buffer_iterator< T > const_iterator; 
  // construct/copy/destruct
  mapped_view();
  mapped_view(T *, size_type, const context & = system::default_context());
  mapped_view(const T *, size_type, 
              const context & = system::default_context());
  mapped_view(const mapped_view< T > &);
  mapped_view< T > & operator=(const mapped_view< T > &);
  ~mapped_view();
  // public member functions
  iterator begin();
  const_iterator begin() const;
  const_iterator cbegin() const;
  iterator end();
  const_iterator end() const;
  const_iterator cend() const;
  size_type size() const;
  T * get_host_ptr();
  const T * get_host_ptr() const;
  void resize(size_type);
  bool empty() const;
  const buffer & get_buffer() const;
  void map(cl_map_flags, command_queue &);
  void map(command_queue &);
  void unmap(command_queue &);
};

Description

Класс mapped_view упрощает отображение памяти хоста в вычислительное устройство. Это позволяет использовать выделенную хостом память с Boost. Вычислить алгоритмы.

Следующий пример показывает, как нанести на карту простой C-массив, содержащий данные на хосте устройства, и запустить алгоритм редуцирования () для расчета суммы:

См. также:

буфер

mapped_view public construct/copy/destruct

  1. mapped_view();
    Создает нулевой mapped_view объект.
  2. mapped_view(T * host_ptr, size_type n, 
                const context & context = system::default_context());

    Creates a mapped_view for host_ptr with n elements. After constructing a mapped_view the data is available for use by a compute device. Use the unmap() method to make the updated data available to the host.

  3. mapped_view(const T * host_ptr, size_type n, 
                const context & context = system::default_context());

    Creates a read-only mapped_view for host_ptr with n elements. After constructing a mapped_view the data is available for use by a compute device. Use the unmap() method to make the updated data available to the host.

  4. mapped_view(const mapped_view< T > & other);
    Creates a copy of other.
  5. mapped_view<T > & constconstmapped_view<  > ;Копирует нанесенный на карту буфер из other.
  6. ~mapped_view();
    Уничтожает объект mapped_view.

mapped_view public member functions

  1. iterator begin();
    Вернет итератор к первому элементу в mapped_view.
  2. const_iterator begin() const;
    Вернет const_iterator к первому элементу в mapped_view.
  3. const_iterator cbegin() const;
    Вернет const_iterator к первому элементу в mapped_view.
  4. iterator end();
    Returns an iterator to one past the last element in the mapped_view.
  5. const_iterator end() const;
    Returns a const_iterator to one past the last element in the mapped_view.
  6. const_iterator cend() const;
    Вернет const_iterator к одному прошедшему последнему элементу в mapped_view.
  7. size_type size() const;
    Вернет количество элементов в mapped_view.
  8. T * get_host_ptr();
    Returns the host data pointer.
  9. const Tget_host_ptr() const;
    Вернет указатель данных хоста.
  10. void resize(size_type size);
    Resizes mapped_view to size elements.
  11. bool empty() const;
    Возвращает true, если mapped_view пуст.
  12. const buffer & get_buffer() const;
    Вернет отображаемый буфер.
  13. void map(cl_map_flags flags, command_queue & queue);

    Maps the buffer into the host address space.

    See the documentation for clEnqueueMapBuffer() for more information.

  14. void map(command_queue & queue);

    Maps the buffer into the host address space for reading and writing.

    Equivalent to:

    map(CL_MAP_READ | CL_MAP_WRITE, queue);
    

  15. void unmap(command_queue & queue);

    Unmaps the buffer from the host address space.

    See the documentation for clEnqueueUnmapMemObject() for more information.


PrevUpHomeNext

Статья Class template mapped_view раздела Chapter 1. Boost.Compute Reference может быть полезна для разработчиков на c++ и boost.




Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



:: Главная :: Reference ::


реклама


©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
Top.Mail.Ru

Время компиляции файла: 2024-08-30 11:47:00
2025-07-04 15:39:08/0.0044081211090088/0