/* * Copyright (C) FFLAS-FFPACK * Written by Pascal Giorgi * * This file is Free Software and part of FFLAS-FFPACK. * * ========LICENCE======== * This file is part of the library FFLAS-FFPACK. * * FFLAS-FFPACK is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ========LICENCE======== *. */ // declare that the call to openblas_set_numthread will be made here, hence don't do it // everywhere in the call stack #define __FFLASFFPACK_OPENBLAS_NT_ALREADY_SET 1 #if not defined(MG_DEFAULT) #define MG_DEFAULT MG_ACTIVE #endif #if not defined(STD_RECINT_SIZE) #define STD_RECINT_SIZE 8 #endif #include "fflas-ffpack/fflas-ffpack-config.h" #include #include #include #include using namespace std; #include "fflas-ffpack/utils/timer.h" #include "fflas-ffpack/fflas/fflas.h" #include "fflas-ffpack/utils/args-parser.h" #include "givaro/modular-integer.h" #include "givaro/givcaster.h" #include "fflas-ffpack/paladin/parallel.h" #ifdef BENCH_RECINT #include "recint/recint.h" #endif template std::ostream& write_matrix(std::ostream& out, Givaro::Integer p, size_t m, size_t n, T* C, size_t ldc){ size_t www(size_t((double(p.bitsize())*log(2.))/log(10.))); out<<"Matrix("< int tmain(){ srand( (int)seed); srand48(seed); Givaro::Integer::seeding(seed); typedef Givaro::Modular Field; Givaro::Integer p; FFLAS::Timer chrono, TimFreivalds; double time=0.; for (size_t loop=0;loop(ip,p); Givaro::Caster(p,ip); // to check consistency Field F(ip); size_t lda,ldb,ldc; lda=k; ldb=1; ldc=1; typename Field::RandIter Rand(F,seed); typename Field::Element_ptr A,B,C; A= FFLAS::fflas_new(F,m,lda); B= FFLAS::fflas_new(F,k,ldb); C= FFLAS::fflas_new(F,m,ldc); // for (size_t i=0;i(); #ifdef BENCH_RECINT r1 += tmain>(); #endif return r1; } /* -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ // vim:sts=4:sw=4:ts=4:et:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s