#include <stdio.h>
#include <stdlib.h>
#include <givaro/givtimer.h>
#include <givaro/givrandom.h>
#include <givaro/givzpz.h>
using namespace Givaro;
#ifndef GIVMIN
#define GIVMIN(a,b) (((a)<(b))?(a):(b))
#endif
#ifndef NB
#define NB 1000000
#endif
#ifndef TAILLE
#define TAILLE 256
#endif
int main(
int argc,
char ** argv)
{
long P (32749);
int offset = 0;
if (argc > ++offset) P = atoi( argv[ offset ] );
int i;
std::cout << "."<< std::flush;
std::cout << "."<< std::flush;
std::cout << "."<< std::flush;
std::cout << "Init et Tableaux des modulo " << P << " :\n" << inver << std::endl << std::flush;
int k;
for (k=0; k<
NB; ++k)
for(i=0; i<
TAILLE; ++i)
std::cout << NB <<
" * " << TAILLE <<
" Mul: " << coef / tim.
usertime()
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
for (k=0; k<
NB; ++k)
for(i=0; i<
TAILLE; ++i)
std::cout << NB <<
" * " << TAILLE <<
" Add: " << coef / tim.
usertime()
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
for (k=0; k<
NB; ++k)
for(i=0; i<
TAILLE; ++i)
std::cout << NB <<
" * " << TAILLE <<
" MulAdd IN place: " << 2*coef / tim.
usertime()
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
for (k=0; k<
NB; ++k)
for(i=0; i<
TAILLE; ++i)
GFq.
axpy(z3, z1, z2, z23);
std::cout << NB <<
" * " << TAILLE <<
" MulAdd: " << 2*coef / tim.
usertime()
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
for (k=0; k<
NB; ++k)
for(i=0; i<
TAILLE; ++i)
std::cout << NB <<
" * " << TAILLE <<
" Sub: " << coef / tim.
usertime()
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
#if 0
for (k=0; k<
NB; ++k)
for(i=0; i<
TAILLE; ++i)
std::cout << NB <<
" * " << TAILLE <<
" Div: " << coef / tim.
usertime()
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
#endif
for (k=0; k<
NB; ++k)
for(i=0; i<
TAILLE; ++i)
std::cout << NB <<
" * " << TAILLE <<
" Neg: " << (coef / tim.
usertime())
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
for (k=0; k<
NB; ++k)
for(i=0; i<
TAILLE; ++i)
std::cout << NB <<
" * " << TAILLE <<
" Add: " << coef / tim.
usertime()
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
for (k=0; k<
NB; ++k)
for(i=0; i<
TAILLE; ++i)
std::cout << NB <<
" * " << TAILLE <<
" Sub: " << coef / tim.
usertime()
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
for (k=0; k<
NB; ++k)
for(i=0; i<
TAILLE; ++i)
std::cout << NB <<
" * " << TAILLE <<
" MulAdd IN place: " << 2*coef / tim.
usertime()
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
for (k=0; k<
NB; ++k)
for(i=0; i<
TAILLE; ++i)
GFq.
axpy(z3, z1, z2, z23);
std::cout << NB <<
" * " << TAILLE <<
" MulAdd: " << 2*coef / tim.
usertime()
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
for (k=0; k<
NB; ++k)
for(i=0; i<
TAILLE; ++i)
std::cout << NB <<
" * " << TAILLE <<
" Neg: " << coef / tim.
usertime()
<< "Mop/s\n" << tim << ", ex: " << z3 << std::endl << std::flush;
return 0;
}