ViennaCL - The Vienna Computing Library
1.2.0
Main Page
Namespaces
Data Structures
Files
File List
Globals
viennacl
traits
handle.hpp
Go to the documentation of this file.
1
#ifndef VIENNACL_TRAITS_HANDLE_HPP_
2
#define VIENNACL_TRAITS_HANDLE_HPP_
3
4
/* =========================================================================
5
Copyright (c) 2010-2011, Institute for Microelectronics,
6
Institute for Analysis and Scientific Computing,
7
TU Wien.
8
9
-----------------
10
ViennaCL - The Vienna Computing Library
11
-----------------
12
13
Project Head: Karl Rupp rupp@iue.tuwien.ac.at
14
15
(A list of authors and contributors can be found in the PDF manual)
16
17
License: MIT (X11), see file LICENSE in the base directory
18
============================================================================= */
19
24
#include <string>
25
#include <fstream>
26
#include <sstream>
27
#include "
viennacl/forwards.h
"
28
29
#ifdef __APPLE__
30
#include <OpenCL/cl.h>
31
#else
32
#include <CL/cl.h>
33
#endif
34
35
namespace
viennacl
36
{
37
namespace
traits
38
{
39
40
// Returns the OpenCL handle of a ViennaCL object
41
template
<
typename
T>
42
viennacl::ocl::handle<cl_mem>
handle
(T & obj)
43
{
44
return
obj.
handle
();
45
}
46
47
template
<
typename
T>
48
viennacl::ocl::handle<cl_mem>
handle
(
viennacl::vector_range<T>
& obj)
49
{
50
return
handle
(obj.
get
());
51
}
52
53
template
<
typename
T>
54
viennacl::ocl::handle<cl_mem>
handle
(
viennacl::vector_range<T>
const
& obj)
55
{
56
return
handle
(obj.
get
());
57
}
58
59
template
<
typename
T>
60
viennacl::ocl::handle<cl_mem>
handle
(
viennacl::matrix_range<T>
& obj)
61
{
62
return
handle
(obj.
get
());
63
}
64
65
template
<
typename
T>
66
viennacl::ocl::handle<cl_mem>
handle
(
viennacl::matrix_range<T>
const
& obj)
67
{
68
return
handle
(obj.
get
());
69
}
70
71
}
//namespace traits
72
}
//namespace viennacl
73
74
75
#endif
Generated on Fri Jul 27 2012 22:02:52 for ViennaCL - The Vienna Computing Library by
1.8.1.2