File: test.cpp

package info (click to toggle)
python-peachpy 0.0~git20211013.257881e-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,452 kB
  • sloc: python: 29,286; ansic: 54; makefile: 44; cpp: 31
file content (24 lines) | stat: -rw-r--r-- 579 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <cstdlib>
#include <iostream>

extern "C" void transpose4x4_opt(float matrix[4 * 4]);

extern void transpose4x4_ref(float matrix[4 * 4]);

int main(int argc, char** argv) {
	float matrix_ref[4 * 4], matrix_opt[4 * 4];
	for (size_t i = 0; i < 4 * 4; i++) {
		matrix_ref[i] = i;
		matrix_opt[i] = i;
	}
	transpose4x4_ref(matrix_ref);
	transpose4x4_opt(matrix_opt);
	for (size_t i = 0; i < 4 * 4; i++) {
		if (matrix_ref[i] != matrix_opt[i]) {
			std::cerr << "UNIT TEST FAILED" << std::endl;
			return 1;
		}
	}
	std::cerr << "UNIT TEST PASSED" << std::endl;
	return 0;
}