MCPcopy Create free account
hub / github.com/boostorg/compute / check_transposition

Function check_transposition

example/matrix_transpose.cpp:181–194  ·  view source on GitHub ↗

compare 'expectedResult' to 'transposedMatrix'. prints an error message if not equal.

Source from the content-addressed store, hash-verified

179
180// compare 'expectedResult' to 'transposedMatrix'. prints an error message if not equal.
181bool check_transposition(const std::vector<float>& expectedResult,
182 uint_ size,
183 const std::vector<float>& transposedMatrix)
184{
185 for(uint_ i = 0 ; i < size ; ++i){
186 if(expectedResult[i] != transposedMatrix[i]){
187 std::cout << "idx = " << i << " , expected " << expectedResult[i]
188 << " , got " << transposedMatrix[i] << std::endl;
189 std::cout << "FAILED" << std::endl;
190 return false;
191 }
192 }
193 return true;
194}
195
196// generate a matrix inside 'in' and do the tranposition inside 'out'
197void generate_matrix(std::vector<float>& in, std::vector<float>& out, uint_ rows, uint_ cols)

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected