-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmain.cpp
More file actions
32 lines (27 loc) · 714 Bytes
/
Copy pathmain.cpp
File metadata and controls
32 lines (27 loc) · 714 Bytes
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
#include <chrono>
#include <iostream>
#if defined(MATMUL)
extern "C" float matmul();
#elif defined(VECADD)
extern "C" float vecadd();
#elif defined(CONV)
extern "C" float conv();
#endif
int main(int argc, char *argv[]) {
std::chrono::time_point<std::chrono::system_clock> startTime =
std::chrono::system_clock::now();
#if defined(MATMUL)
float v = matmul();
#elif defined(VECADD)
float v = vecadd();
#elif defined(CONV)
float v = conv();
#else
float v = 0.0f;
#endif
std::chrono::duration<double> elapsedTime =
std::chrono::system_clock::now() - startTime;
std::cout << "op result = " << v << ", time = " << elapsedTime.count()
<< " seconds." << std::endl;
return 0;
}