ViennaCL - The Vienna Computing Library: libviennacl/src/viennacl_private.hpp Source File

ViennaCL - The Vienna Computing Library 1.7.1 Free open-source GPU-accelerated linear algebra and solver library. |

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
viennacl_private.hpp
Go to the documentation of this file.
1 #ifndef VIENNACL_VIENNACL_PRIVATE_HPP
2 #define VIENNACL_VIENNACL_PRIVATE_HPP
3
4
5 /* =========================================================================
6 Copyright (c) 2010-2014, Institute for Microelectronics,
7 Institute for Analysis and Scientific Computing,
8 TU Wien.
9 Portions of this software are copyright by UChicago Argonne, LLC.
10
11 -----------------
12 ViennaCL - The Vienna Computing Library
13 -----------------
14
15 Project Head: Karl Rupp rupp@iue.tuwien.ac.at
16
17 (A list of authors and contributors can be found in the PDF manual)
18
19 License: MIT (X11), see file LICENSE in the base directory
20 ============================================================================= */
21
22 #include <stdlib.h>
23
24 #ifdef VIENNACL_WITH_OPENCL
25 #ifdef __APPLE__
26 #include <OpenCL/cl.h>
27 #else
28 #include <CL/cl.h>
29 #endif
30 #endif
31
32 #include "viennacl.hpp"
33
34
35 /************* Backend Management ******************/
36
37 struct ViennaCLCUDABackend_impl
38 {
39 //TODO: Add stream and/or device descriptors here
40 };
41
42 struct ViennaCLOpenCLBackend_impl
43 {
44 ViennaCLInt context_id;
45 };
46
47 struct ViennaCLHostBackend_impl
48 {
49 // Nothing to specify *at the moment*
50 };
51
52
54 struct ViennaCLBackend_impl
55 {
56 ViennaCLBackendTypes backend_type;
57
58 ViennaCLCUDABackend_impl cuda_backend;
59 ViennaCLOpenCLBackend_impl opencl_backend;
60 ViennaCLHostBackend_impl host_backend;
61 };
62
63
64
65 /******** User Types **********/
66
67 struct ViennaCLHostScalar_impl
68 {
69 ViennaCLPrecision precision;
70
71 union {
72 float value_float;
73 double value_double;
74 };
75 };
76
77 struct ViennaCLScalar_impl
78 {
79 ViennaCLBackend backend;
80 ViennaCLPrecision precision;
81
82 // buffer:
83 #ifdef VIENNACL_WITH_CUDA
84 char * cuda_mem;
85 #endif
86 #ifdef VIENNACL_WITH_OPENCL
87 cl_mem opencl_mem;
88 #endif
89 char * host_mem;
90
91 ViennaCLInt offset;
92 };
93
94 struct ViennaCLVector_impl
95 {
96 ViennaCLBackend backend;
97 ViennaCLPrecision precision;
98
99 // buffer:
100 #ifdef VIENNACL_WITH_CUDA
101 char * cuda_mem;
102 #endif
103 #ifdef VIENNACL_WITH_OPENCL
104 cl_mem opencl_mem;
105 #endif
106 char * host_mem;
107
108 ViennaCLInt offset;
109 ViennaCLInt inc;
110 ViennaCLInt size;
111 };
112
113 struct ViennaCLMatrix_impl
114 {
115 ViennaCLBackend backend;
116 ViennaCLPrecision precision;
117 ViennaCLOrder order;
118 ViennaCLTranspose trans;
119
120 // buffer:
121 #ifdef VIENNACL_WITH_CUDA
122 char * cuda_mem;
123 #endif
124 #ifdef VIENNACL_WITH_OPENCL
125 cl_mem opencl_mem;
126 #endif
127 char * host_mem;
128
129 ViennaCLInt size1;
130 ViennaCLInt start1;
131 ViennaCLInt stride1;
132 ViennaCLInt internal_size1;
133
134 ViennaCLInt size2;
135 ViennaCLInt start2;
136 ViennaCLInt stride2;
137 ViennaCLInt internal_size2;
138 };
139
140
141 #endif
ViennaCLBackendTypes
ViennaCLBackendTypes
Definition: viennacl.hpp:53
ViennaCLTranspose
ViennaCLTranspose
Definition: viennacl.hpp:68
ViennaCLBackend_impl
Generic backend for CUDA, OpenCL, host-based stuff.
Definition: viennacl_private.hpp:54
ViennaCLVector_impl::precision
ViennaCLPrecision precision
Definition: viennacl_private.hpp:97
ViennaCLHostScalar_impl::value_float
float value_float
Definition: viennacl_private.hpp:72
ViennaCLMatrix_impl::start1
ViennaCLInt start1
Definition: viennacl_private.hpp:130
ViennaCLMatrix_impl::stride2
ViennaCLInt stride2
Definition: viennacl_private.hpp:136
ViennaCLBackend_impl::backend_type
ViennaCLBackendTypes backend_type
Definition: viennacl_private.hpp:56
ViennaCLMatrix_impl::internal_size2
ViennaCLInt internal_size2
Definition: viennacl_private.hpp:137
ViennaCLVector_impl::backend
ViennaCLBackend backend
Definition: viennacl_private.hpp:96
ViennaCLVector_impl::size
ViennaCLInt size
Definition: viennacl_private.hpp:110
ViennaCLBackend_impl::host_backend
ViennaCLHostBackend_impl host_backend
Definition: viennacl_private.hpp:60
ViennaCLMatrix_impl::order
ViennaCLOrder order
Definition: viennacl_private.hpp:117
ViennaCLMatrix_impl
Definition: viennacl_private.hpp:113
ViennaCLVector_impl::inc
ViennaCLInt inc
Definition: viennacl_private.hpp:109
ViennaCLVector_impl
Definition: viennacl_private.hpp:94
ViennaCLOpenCLBackend_impl::context_id
ViennaCLInt context_id
Definition: viennacl_private.hpp:44
ViennaCLMatrix_impl::backend
ViennaCLBackend backend
Definition: viennacl_private.hpp:115
ViennaCLMatrix_impl::stride1
ViennaCLInt stride1
Definition: viennacl_private.hpp:131
ViennaCLBackend_impl::opencl_backend
ViennaCLOpenCLBackend_impl opencl_backend
Definition: viennacl_private.hpp:59
ViennaCLOrder
ViennaCLOrder
Definition: viennacl.hpp:61
ViennaCLHostBackend_impl
Definition: viennacl_private.hpp:47
ViennaCLMatrix_impl::start2
ViennaCLInt start2
Definition: viennacl_private.hpp:135
ViennaCLMatrix_impl::size1
ViennaCLInt size1
Definition: viennacl_private.hpp:129
ViennaCLMatrix_impl::internal_size1
ViennaCLInt internal_size1
Definition: viennacl_private.hpp:132
ViennaCLScalar_impl::backend
ViennaCLBackend backend
Definition: viennacl_private.hpp:79
ViennaCLVector_impl::host_mem
char * host_mem
Definition: viennacl_private.hpp:106
ViennaCLScalar_impl::offset
ViennaCLInt offset
Definition: viennacl_private.hpp:91
ViennaCLScalar_impl
Definition: viennacl_private.hpp:77
ViennaCLInt
int ViennaCLInt
Definition: viennacl.hpp:48
ViennaCLScalar_impl::precision
ViennaCLPrecision precision
Definition: viennacl_private.hpp:80
ViennaCLPrecision
ViennaCLPrecision
Definition: viennacl.hpp:89
ViennaCLVector_impl::offset
ViennaCLInt offset
Definition: viennacl_private.hpp:108
ViennaCLHostScalar_impl
Definition: viennacl_private.hpp:67
ViennaCLOpenCLBackend_impl
Definition: viennacl_private.hpp:42
ViennaCLScalar_impl::host_mem
char * host_mem
Definition: viennacl_private.hpp:89
ViennaCLMatrix_impl::size2
ViennaCLInt size2
Definition: viennacl_private.hpp:134
ViennaCLMatrix_impl::trans
ViennaCLTranspose trans
Definition: viennacl_private.hpp:118
ViennaCLBackend_impl::cuda_backend
ViennaCLCUDABackend_impl cuda_backend
Definition: viennacl_private.hpp:58
ViennaCLMatrix_impl::precision
ViennaCLPrecision precision
Definition: viennacl_private.hpp:116
viennacl.hpp
ViennaCLMatrix_impl::host_mem
char * host_mem
Definition: viennacl_private.hpp:127
ViennaCLHostScalar_impl::value_double
double value_double
Definition: viennacl_private.hpp:73
ViennaCLHostScalar_impl::precision
ViennaCLPrecision precision
Definition: viennacl_private.hpp:69
ViennaCLCUDABackend_impl
Definition: viennacl_private.hpp:37