Skip to content

Commit de4c8df

Browse files
Added some documentation (#22)
1 parent 14cb452 commit de4c8df

File tree

1 file changed

+45
-8
lines changed

1 file changed

+45
-8
lines changed

adaboost/cuda/cuda_data_structures.hpp

+45-8
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,24 @@ namespace adaboost
104104
*/
105105
~VectorGPU();
106106
};
107+
108+
/*
109+
* This function computes
110+
* dot product of two vectors on
111+
* GPU.
112+
*/
107113

108114
template <class data_type_vector>
109115
void product_gpu(const VectorGPU<data_type_vector>& vec1,
110116
const VectorGPU<data_type_vector>& vec2,
111117
data_type_vector& result,
112118
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+
*/
114125
template <class data_type_matrix>
115126
class MatrixGPU: public adaboost::core::Matrix<data_type_matrix>
116127
{
@@ -124,25 +135,51 @@ namespace adaboost
124135
(unsigned _rows_gpu, unsigned _cols_gpu);
125136

126137
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+
*/
128145
MatrixGPU();
129-
146+
147+
/*
148+
*Parameterized constructor.
149+
*/
130150
MatrixGPU(unsigned _rows, unsigned _cols);
131-
151+
152+
/*
153+
* Used for filling the matrix with a given value.
154+
*/
132155
void fill(data_type_matrix value,
133156
unsigned block_size_x=0,
134157
unsigned block_size_y=0);
135-
158+
159+
160+
/*
161+
* Copies the data from GPU to CPU.
162+
*/
136163
void copy_to_host();
137-
164+
165+
/*
166+
* Copies the data from CPU to GPU.
167+
*/
138168
void copy_to_device();
139-
169+
170+
/*
171+
* Returns number of rows
172+
* By default returns number of rows on GPU.
173+
*/
140174
unsigned get_rows(bool gpu=true) const;
141175

142176
unsigned get_cols(bool gpu=true) const;
143177

144178
data_type_matrix* get_data_pointer(bool gpu=true) const;
145-
179+
180+
/*
181+
* Frees the memory from both CPU and GPU.
182+
*/
146183
~MatrixGPU();
147184
};
148185

0 commit comments

Comments
 (0)