@@ -104,13 +104,24 @@ namespace adaboost
104
104
*/
105
105
~VectorGPU ();
106
106
};
107
+
108
+ /*
109
+ * This function computes
110
+ * dot product of two vectors on
111
+ * GPU.
112
+ */
107
113
108
114
template <class data_type_vector >
109
115
void product_gpu (const VectorGPU<data_type_vector>& vec1,
110
116
const VectorGPU<data_type_vector>& vec2,
111
117
data_type_vector& result,
112
118
unsigned block_size=0 );
113
-
119
+ /*
120
+ * This class represents GPU version of adaboost::core::Matrix.
121
+ *
122
+ * @tparam data_type_matrix Data type of the elements
123
+ * supported by C++.
124
+ */
114
125
template <class data_type_matrix >
115
126
class MatrixGPU : public adaboost ::core::Matrix<data_type_matrix>
116
127
{
@@ -124,25 +135,51 @@ namespace adaboost
124
135
(unsigned _rows_gpu, unsigned _cols_gpu);
125
136
126
137
public:
127
-
138
+
139
+ /*
140
+ * Default constructor.
141
+ * Sets Matrix::data to NULL, rows to 0
142
+ * and cols to 0.
143
+ * It set size_gpu to 0 and data_gpu to NULL.
144
+ */
128
145
MatrixGPU ();
129
-
146
+
147
+ /*
148
+ *Parameterized constructor.
149
+ */
130
150
MatrixGPU (unsigned _rows, unsigned _cols);
131
-
151
+
152
+ /*
153
+ * Used for filling the matrix with a given value.
154
+ */
132
155
void fill (data_type_matrix value,
133
156
unsigned block_size_x=0 ,
134
157
unsigned block_size_y=0 );
135
-
158
+
159
+
160
+ /*
161
+ * Copies the data from GPU to CPU.
162
+ */
136
163
void copy_to_host ();
137
-
164
+
165
+ /*
166
+ * Copies the data from CPU to GPU.
167
+ */
138
168
void copy_to_device ();
139
-
169
+
170
+ /*
171
+ * Returns number of rows
172
+ * By default returns number of rows on GPU.
173
+ */
140
174
unsigned get_rows (bool gpu=true ) const ;
141
175
142
176
unsigned get_cols (bool gpu=true ) const ;
143
177
144
178
data_type_matrix* get_data_pointer (bool gpu=true ) const ;
145
-
179
+
180
+ /*
181
+ * Frees the memory from both CPU and GPU.
182
+ */
146
183
~MatrixGPU ();
147
184
};
148
185
0 commit comments