Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
bench.cpp File Reference
#include "zm.h"
#include <xbyak/xbyak.h>
#include <xbyak/xbyak_util.h>
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include <iostream>
Include dependency graph for bench.cpp:

Go to the source code of this file.

Classes

struct  Code
 
struct  Call
 

Macros

#define XBYAK_NO_OP_NAMES
 
#define NUM_OF_ARRAY(x)
 

Functions

mie::Vuint Put (const uint64_t *x, size_t n)
 
void bench (int mode)
 
int main (int argc, char *argv[])
 

Variables

const int innerN = 1
 

Macro Definition Documentation

◆ NUM_OF_ARRAY

#define NUM_OF_ARRAY ( x)
Value:
(sizeof(x) / sizeof(*x))

Definition at line 12 of file bench.cpp.

◆ XBYAK_NO_OP_NAMES

#define XBYAK_NO_OP_NAMES

Definition at line 3 of file bench.cpp.

Function Documentation

◆ bench()

void bench ( int mode)

Definition at line 104 of file bench.cpp.

105{
106 const int N = 100000;
107 Code code;
108 code.makeBench(N, mode);
109 int (*p)(uint64_t*, const uint64_t*, const uint64_t*) = code.getCode<int (*)(uint64_t*, const uint64_t*, const uint64_t*)>();
110
111 uint64_t a[4] = { uint64_t(-1), uint64_t(-2), uint64_t(-3), 544443221 };
112 uint64_t b[4] = { uint64_t(-123), uint64_t(-3), uint64_t(-4), 222222222 };
113 uint64_t c[5] = { 0, 0, 0, 0, 0 };
114
115 const int M = 100;
117 for (int i = 0; i < M; i++) {
118 clk.begin();
119 p(c, a, b);
120 clk.end();
121 }
122 printf("%.2fclk\n", clk.getClock() / double(M) / double(N) / innerN);
123}
const int innerN
Definition bench.cpp:16
const mie::Vuint & p
Definition bn.cpp:27
uint64 getClock() const
Definition xbyak_util.h:401
LOGGING_API void printf(Category category, const char *format,...)
Definition Logging.cpp:30
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
const int N
Definition quantize.cpp:54
unsigned __int64 uint64_t
Definition stdint.h:136
Definition bench.cpp:18
void makeBench(int N, int mode)
Definition bench.cpp:20
Here is the call graph for this function:

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 143 of file bench.cpp.

144{
145 argc--, argv++;
146 /*
147 Core i7
148 add : 8.0clk
149 mul1: 10.7clk
150 mul2: 17.5clk
151 */
152 try {
153 puts("test0");
154 bench(0);
155 puts("test1");
156 bench(1);
157 int (*f)();
158 Call call((const void**)&f);
159 printf("%d\n", f());
160 } catch (std::exception& e) {
161 fprintf(stderr, "ExpCode ERR:%s\n", e.what());
162 }
163}
char ** argv
fc::variant call(const std::string &url, const std::string &path, const T &v)
Definition main.cpp:258
void bench()
Definition test_zm.cpp:848
Here is the call graph for this function:

◆ Put()

mie::Vuint Put ( const uint64_t * x,
size_t n )

Definition at line 96 of file bench.cpp.

97{
98 mie::Vuint t;
99 t.set(x, n);
100 std::cout << t << std::endl;
101 return t;
102}
void set(T x)
Definition zm.h:341
Here is the call graph for this function:

Variable Documentation

◆ innerN

const int innerN = 1

Definition at line 16 of file bench.cpp.