device_copy.hpp
Go to the documentation of this file.
1/*!
2 * \brief expression templates for copying from cpu to device and back
3 *
4 * \author O. Krause
5 * \date 2013
6 *
7 *
8 * \par Copyright 1995-2015 Shark Development Team
9 *
10 * <BR><HR>
11 * This file is part of Shark.
12 * <http://image.diku.dk/shark/>
13 *
14 * Shark is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License as published
16 * by the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * Shark is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public License
25 * along with Shark. If not, see <http://www.gnu.org/licenses/>.
26 *
27 */
28#ifndef REMORA_DEVICE_COPY_HPP
29#define REMORA_DEVICE_COPY_HPP
30
31#include "expression_types.hpp"
32
33namespace remora{
34
35template<class E>
36E const& copy_to_cpu(vector_expression<E, cpu_tag> const& e){
37 return e();
38}
39
40
41template<class E>
42E const& copy_to_cpu(matrix_expression<E, cpu_tag> const& e){
43 return e();
44}
45
46template<class E>
47E const& copy_to_device(vector_expression<E, cpu_tag> const& e, cpu_tag){
48 return e();
49}
50
51
52template<class E>
53E const& copy_to_device(matrix_expression<E, cpu_tag> const& e, cpu_tag){
54 return e();
55}
56
57}
58
59#ifdef REMORA_USE_GPU
60#include "gpu/copy.hpp"
61#endif
62
63#endif