예제 #1
0
		void apply(std::string key, const::Plugin::Common::Header &header) {
			for (int i = 0; i < header.hosts_size(); i++) {
				if (header.hosts(i).id() == key) {
					apply_host(header.hosts(i));
				}
			}
		}
예제 #2
0
  // Dispatcher for y = Ax
  void apply(viennacl::vector_base<NumericT> const & x, viennacl::vector_base<NumericT> & y) const
  {
#if defined(VIENNACL_WITH_CUDA)
    if (viennacl::traits::active_handle_id(x) == viennacl::CUDA_MEMORY)
      apply_cuda(x, y);
#endif

#if defined(VIENNACL_WITH_OPENCL)
    if (viennacl::traits::active_handle_id(x) == viennacl::OPENCL_MEMORY)
      apply_opencl(x, y);
#endif

    if (viennacl::traits::active_handle_id(x) == viennacl::MAIN_MEMORY)
      apply_host(x, y);
  }