-
Notifications
You must be signed in to change notification settings - Fork 92
/
sdx_test.h
46 lines (39 loc) · 927 Bytes
/
sdx_test.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* sdx_test.h
*
* Created on: 2017. 4. 11.
* Author: woobes
*/
#ifndef SRC_SDX_TEST_H_
#define SRC_SDX_TEST_H_
#include <iostream>
#include <time.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "sds_lib.h"
#define TEST_ITR 1000
using namespace std;
/*class perf_counter
{
public:
unsigned long long int tot, cnt, calls;
perf_counter() : tot(0), cnt(0), calls(0) {};
inline void reset() { tot = cnt = calls = 0; }
inline void start() { cnt = sds_clock_counter(); calls++; };
inline void stop() { tot += (sds_clock_counter() - cnt); };
inline uint64_t avg_cpu_cycles() { return (tot / calls); };
};
*/
int check(float* arr1, float* arr2, int N){
for(int i=0;i<N;i++){
float t1 = arr1[i];
float t2 = arr2[i];
if(t1!=t2){
std::cout<<i<<" Error : HW and SW are not matched"<<std::endl;
return 1;
}
}
return 0;
}
#endif /* SRC_SDX_TEST_H_ */