[Compbench-devel] CompBenchmarks++/Benchmark Benchmark-LINPACKC.cpp, NONE, 1.1 Benchmark-LINPACKC.h
Brought to you by:
xfred
|
From: Frederic T. <xf...@us...> - 2006-10-01 19:19:26
|
Update of /cvsroot/compbench/CompBenchmarks++/Benchmark In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv30918 Modified Files: Benchmark-Selector.cpp Makefile.am Makefile.in Added Files: Benchmark-LINPACKC.cpp Benchmark-LINPACKC.h Log Message: LINPACKC package added. Index: Makefile.in =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Makefile.in,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.in 20 Sep 2006 10:47:56 -0000 1.5 --- Makefile.in 1 Oct 2006 19:19:19 -0000 1.6 *************** *** 108,112 **** SUBDIRS = Compiler ! sources = Benchmark.cpp Benchmark-Selector.cpp Benchmark-Autotools.cpp Benchmark-xZIP.cpp Benchmark-GZIP.cpp Benchmark-NBENCH.cpp Benchmark-SCIMARK2.cpp Benchmark-BENCHPP.cpp --- 108,112 ---- SUBDIRS = Compiler ! sources = Benchmark.cpp Benchmark-Selector.cpp Benchmark-Autotools.cpp Benchmark-xZIP.cpp Benchmark-GZIP.cpp Benchmark-NBENCH.cpp Benchmark-SCIMARK2.cpp Benchmark-BENCHPP.cpp Benchmark-LINPACKC.cpp *************** *** 132,136 **** libBenchmark_la_OBJECTS = Benchmark.lo Benchmark-Selector.lo \ Benchmark-Autotools.lo Benchmark-xZIP.lo Benchmark-GZIP.lo \ ! Benchmark-NBENCH.lo Benchmark-SCIMARK2.lo Benchmark-BENCHPP.lo CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) --- 132,137 ---- libBenchmark_la_OBJECTS = Benchmark.lo Benchmark-Selector.lo \ Benchmark-Autotools.lo Benchmark-xZIP.lo Benchmark-GZIP.lo \ ! Benchmark-NBENCH.lo Benchmark-SCIMARK2.lo Benchmark-BENCHPP.lo \ ! Benchmark-LINPACKC.lo CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) *************** *** 148,154 **** GZIP_ENV = --best DEP_FILES = .deps/Benchmark-Autotools.P .deps/Benchmark-BENCHPP.P \ ! .deps/Benchmark-GZIP.P .deps/Benchmark-NBENCH.P \ ! .deps/Benchmark-SCIMARK2.P .deps/Benchmark-Selector.P \ ! .deps/Benchmark-xZIP.P .deps/Benchmark.P SOURCES = $(libBenchmark_la_SOURCES) OBJECTS = $(libBenchmark_la_OBJECTS) --- 149,155 ---- GZIP_ENV = --best DEP_FILES = .deps/Benchmark-Autotools.P .deps/Benchmark-BENCHPP.P \ ! .deps/Benchmark-GZIP.P .deps/Benchmark-LINPACKC.P \ ! .deps/Benchmark-NBENCH.P .deps/Benchmark-SCIMARK2.P \ ! .deps/Benchmark-Selector.P .deps/Benchmark-xZIP.P .deps/Benchmark.P SOURCES = $(libBenchmark_la_SOURCES) OBJECTS = $(libBenchmark_la_OBJECTS) Index: Benchmark-Selector.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Benchmark-Selector.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Benchmark-Selector.cpp 28 Sep 2006 17:52:45 -0000 1.2 --- Benchmark-Selector.cpp 1 Oct 2006 19:19:19 -0000 1.3 *************** *** 6,9 **** --- 6,10 ---- #include <Benchmark/Benchmark-SCIMARK2.h> #include <Benchmark/Benchmark-BENCHPP.h> + #include <Benchmark/Benchmark-LINPACKC.h> CBMBenchmarkSelector::CBMBenchmarkSelector(CBMSystem *_system) *************** *** 96,99 **** --- 97,116 ---- } + if (tmp=="linpackc-sp-unroll") { + return(new CBMBenchmarkLINPACKC_SP_UNROLL(system)); + } + + if (tmp=="linpackc-sp-roll") { + return(new CBMBenchmarkLINPACKC_SP_ROLL(system)); + } + + if (tmp=="linpackc-dp-unroll") { + return(new CBMBenchmarkLINPACKC_DP_UNROLL(system)); + } + + if (tmp=="linpackc-dp-roll") { + return(new CBMBenchmarkLINPACKC_DP_ROLL(system)); + } + tmp="Unknown benchmark '"; tmp+=benchmarkName; *************** *** 129,132 **** --- 146,153 ---- CBMBenchmarkBENCHPP_WHETSTONE benchpp_wet(system); CBMBenchmarkBENCHPP_STEPANOV_AL12 benchpp_ste_al12(system); + CBMBenchmarkLINPACKC_SP_UNROLL linpackc_sp_unroll(system); + CBMBenchmarkLINPACKC_SP_UNROLL linpackc_sp_roll(system); + CBMBenchmarkLINPACKC_SP_UNROLL linpackc_dp_unroll(system); + CBMBenchmarkLINPACKC_SP_UNROLL linpackc_dp_roll(system); gzip1.display(); *************** *** 153,156 **** --- 174,182 ---- benchpp_wet.display(); benchpp_ste_al12.display(); + + linpackc_sp_unroll.display(); + linpackc_sp_roll.display(); + linpackc_dp_unroll.display(); + linpackc_dp_roll.display(); } Index: Makefile.am =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Benchmark/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.am 19 Sep 2006 15:39:34 -0000 1.4 --- Makefile.am 1 Oct 2006 19:19:19 -0000 1.5 *************** *** 9,13 **** Benchmark-NBENCH.cpp \ Benchmark-SCIMARK2.cpp \ ! Benchmark-BENCHPP.cpp --- 9,14 ---- Benchmark-NBENCH.cpp \ Benchmark-SCIMARK2.cpp \ ! Benchmark-BENCHPP.cpp \ ! Benchmark-LINPACKC.cpp --- NEW FILE: Benchmark-LINPACKC.cpp --- #include <Benchmark/Benchmark-LINPACKC.h> #include <System/System.h> #include <config.h> CBMBenchmarkLINPACKC::CBMBenchmarkLINPACKC(CBMSystem *_system) : CBMBenchmark(_system) { } std::string CBMBenchmarkLINPACKC::downloadURL(void) { return("http://www.netlib.org/benchmark/linpackc"); } std::string CBMBenchmarkLINPACKC::expectedMD5(void) { return("f6e06f98fdbf7e39f84aa9e6c04de131"); } std::string CBMBenchmarkLINPACKC::packageName(void) { return("linpackc"); } std::string CBMBenchmarkLINPACKC::benchmarkComments(void) { std::string comment; comment="linpackc benchmark with specific compilation options :"; comment+=benchmarkLINPACKCComments(); return(comment); } std::string CBMBenchmarkLINPACKC::packageVersion(void) { return("02-25-1994"); } int CBMBenchmarkLINPACKC::packageSize(void) { return(907); } int CBMBenchmarkLINPACKC::ContextMatches(CBMBenchmarkContextCompiler *_currentCompiler, CBMBenchmarkContextCompilerOptions *_currentOptions) { std::string localFlags; std::string previousFlags; int r = CBMBenchmark::ContextMatches(_currentCompiler, _currentOptions); if (!r) { return(0); } localFlags=linpackPrecisionFlags(); localFlags+=" "; localFlags+=linpackRollFlags(); previousFlags=system->read("linpackc-localflags"); if ((previousFlags==localFlags) && (getStatus()>=Made)) { return(1); } else { return(0); } } std::string CBMBenchmarkLINPACKC::packageComments(void) { return("Official linpackc benchmark translated to C by Bonnie Toy. A minor patch is applied."); } std::string CBMBenchmarkLINPACKC::localPackageName(void) { return("linpackc.c"); } std::string CBMBenchmarkLINPACKC::language(void) { return("C"); } char* CBMBenchmarkLINPACKC::extractDirectory(void) { std::string dum = "linpackc-"; dum+=packageVersion(); return((char*) dum.c_str()); } int CBMBenchmarkLINPACKC::hasPatch(void) { return(1); } int CBMBenchmarkLINPACKC::patch(int _force) { std::string cmd; std::string sstdout; int r; std::string patch; patch+=system->temporaryDirectory(CBMSystem::Patches); patch+="/linpackc.patch.gz"; cmd+="cd "; cmd+=localPackageAbsoluteDirectory(); cmd+=" && if test ! -f "; cmd+=patch; cmd+="; then exit 1; fi"; cmd+=" && "; cmd+=CBM_PROG_GZIP; cmd+=" -dc "; cmd+=patch; cmd+=" | "; cmd+=CBM_PROG_PATCH; cmd+=" -p0 linpackc.c"; r=system->exec(cmd, sstdout); return(!r); } int CBMBenchmarkLINPACKC::extract(int _force) { std::string localFile = localPackageAbsoluteName(); std::string cmd; std::string sstdout; cmd+="cd "; cmd+=system->temporaryDirectory(CBMSystem::Extract); cmd+=" && "; cmd+=CBM_PROG_MKDIR; cmd+=" -p "; cmd+=extractDirectory(); cmd+=" && cd "; cmd+=extractDirectory(); cmd+=" && "; cmd+=CBM_PROG_CP; cmd+=" "; cmd+=system->temporaryDirectory(CBMSystem::Download); cmd+="/"; cmd+=localPackageName(); cmd+=" ."; return(system->exec(cmd, sstdout)==0); } int CBMBenchmarkLINPACKC::preConfigure(int _force) { return(1); } int CBMBenchmarkLINPACKC::configure(CBMBenchmarkContextCompiler *_currentCompiler, CBMBenchmarkContextCompilerOptions *_currentOptions) { return(1); } int CBMBenchmarkLINPACKC::make(void) { std::string cmd; std::string sstdout; std::string localFlags; int r; localFlags=linpackPrecisionFlags(); localFlags+=" "; localFlags+=linpackRollFlags(); cmd="cd "; cmd+=localPackageAbsoluteDirectory(); cmd+=" && "; cmd+=CBM_PROG_MAKE; cmd+=" linpackc "; if (language()=="C") { cmd+="CC="; } else { if (language()=="C++") { cmd+="CXX="; } else { /* !!! */ } } cmd+=currentCompiler->Binary(); if (language()=="C") { cmd+=" CFLAGS="; } else { if (language()=="C++") { cmd+="CXXFLAGS="; } else { /* !!! */ } } cmd+="'"; cmd+=currentOptions->Options(); cmd+=" "; cmd+=" -lm "; cmd+=localFlags; cmd+="'"; r=system->exec(cmd, sstdout); if (!r) { system->store("linpackc-localflags", localFlags); } return(!r); } std::string CBMBenchmarkLINPACKC::bench(void) { std::string cmd; std::string result; cmd="cd "; cmd+=localPackageAbsoluteDirectory(); cmd+=" && echo $(./linpackc 2>&1 | "; cmd+=CBM_PROG_GREP; cmd+=" 'Kflops' | "; cmd+=CBM_PROG_CUT; cmd+=" -f5 -d' ')"; if (system->exec(cmd, result)==0) { return(result); } else { return("0"); } } int CBMBenchmarkLINPACKC::release(void) { std::string cmd; std::string sstdout; cmd="cd "; cmd+=localPackageAbsoluteDirectory(); cmd+=" && rm -f linpackc linpackc.exe 2> /dev/null"; return(system->exec(cmd, sstdout)==0); } std::string CBMBenchmarkLINPACKC::license(void) { return("Not specified"); } std::string CBMBenchmarkLINPACKC::homePage(void) { return("http://math.nist.gov/scimark/"); } std::string CBMBenchmarkLINPACKC::author(void) { return("Roldan Pozo & Bruce R Miller"); } int CBMBenchmarkLINPACKC::benchmarkSize(void) { return(packageSize()); } CBMBenchmarkLINPACKC::~CBMBenchmarkLINPACKC() { } CBMBenchmarkLINPACKC_SP_UNROLL::CBMBenchmarkLINPACKC_SP_UNROLL(CBMSystem *_system) : CBMBenchmarkLINPACKC(_system) { } std::string CBMBenchmarkLINPACKC_SP_UNROLL::benchmarkName(void) { return("linpackc-sp-unroll"); } std::string CBMBenchmarkLINPACKC_SP_UNROLL::linpackPrecisionFlags(void) { std::string dum = "-DSP"; return(dum); } std::string CBMBenchmarkLINPACKC_SP_UNROLL::linpackRollFlags(void) { std::string dum = "-DUNROLL"; return(dum); } std::string CBMBenchmarkLINPACKC_SP_UNROLL::benchmarkLINPACKCComments(void) { std::string dum = "single precision used. Unrolled version selected, which may ease compiler's work and optimisation."; return(dum); } CBMBenchmarkLINPACKC_SP_UNROLL::~CBMBenchmarkLINPACKC_SP_UNROLL() { } CBMBenchmarkLINPACKC_SP_ROLL::CBMBenchmarkLINPACKC_SP_ROLL(CBMSystem *_system) : CBMBenchmarkLINPACKC(_system) { } std::string CBMBenchmarkLINPACKC_SP_ROLL::benchmarkName(void) { return("linpackc-sp-roll"); } std::string CBMBenchmarkLINPACKC_SP_ROLL::linpackPrecisionFlags(void) { std::string dum = "-DSP"; return(dum); } std::string CBMBenchmarkLINPACKC_SP_ROLL::linpackRollFlags(void) { std::string dum = "-DROLL"; return(dum); } std::string CBMBenchmarkLINPACKC_SP_ROLL::benchmarkLINPACKCComments(void) { std::string dum = "single precision used. Rolled version selected (matrix operations are given in a straightforward way, which may makes compiler's optimisation job more difficult)."; return(dum); } CBMBenchmarkLINPACKC_SP_ROLL::~CBMBenchmarkLINPACKC_SP_ROLL() { } CBMBenchmarkLINPACKC_DP_UNROLL::CBMBenchmarkLINPACKC_DP_UNROLL(CBMSystem *_system) : CBMBenchmarkLINPACKC(_system) { } std::string CBMBenchmarkLINPACKC_DP_UNROLL::benchmarkName(void) { return("linpackc-dp-unroll"); } std::string CBMBenchmarkLINPACKC_DP_UNROLL::linpackPrecisionFlags(void) { std::string dum = "-DDP"; return(dum); } std::string CBMBenchmarkLINPACKC_DP_UNROLL::linpackRollFlags(void) { std::string dum = "-DUNROLL"; return(dum); } std::string CBMBenchmarkLINPACKC_DP_UNROLL::benchmarkLINPACKCComments(void) { std::string dum = "double precision used. Unrolled version selected, which may ease compiler's work and optimisation."; return(dum); } CBMBenchmarkLINPACKC_DP_UNROLL::~CBMBenchmarkLINPACKC_DP_UNROLL() { } CBMBenchmarkLINPACKC_DP_ROLL::CBMBenchmarkLINPACKC_DP_ROLL(CBMSystem *_system) : CBMBenchmarkLINPACKC(_system) { } std::string CBMBenchmarkLINPACKC_DP_ROLL::benchmarkName(void) { return("linpackc-dp-roll"); } std::string CBMBenchmarkLINPACKC_DP_ROLL::linpackPrecisionFlags(void) { std::string dum = "-DDP"; return(dum); } std::string CBMBenchmarkLINPACKC_DP_ROLL::linpackRollFlags(void) { std::string dum = "-DROLL"; return(dum); } std::string CBMBenchmarkLINPACKC_DP_ROLL::benchmarkLINPACKCComments(void) { std::string dum = "double precision used. Rolled version selected (matrix operations are given in a straightforward way, which may makes compiler's optimisation job more difficult)."; return(dum); } CBMBenchmarkLINPACKC_DP_ROLL::~CBMBenchmarkLINPACKC_DP_ROLL() { } --- NEW FILE: Benchmark-LINPACKC.h --- /* ---------------------------------------------------------------------------- $Id: Benchmark-LINPACKC.h,v 1.1 2006/10/01 19:19:19 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBMBENCHMARKLINPACKC #define H_CBMBENCHMARKLINPACKC #include <Benchmark/Benchmark.h> /** \brief Defines the linpackc package. */ class CBMBenchmarkLINPACKC : public CBMBenchmark { public: private: virtual std::string downloadURL(void); virtual std::string expectedMD5(void); virtual std::string packageName(void); virtual std::string benchmarkComments(void); virtual std::string packageVersion(void); virtual int packageSize(void); /* in bytes */ /** Compairs previous compilation context to current one. Local options * are also taken in context. * \return 1 if they match. * \sa contextID() * \sa storeContext() * \sa Make() */ virtual int ContextMatches(CBMBenchmarkContextCompiler *_currentCompiler, CBMBenchmarkContextCompilerOptions *_currentOptions); virtual std::string packageComments(void); virtual std::string localPackageName(void); protected: virtual std::string linpackPrecisionFlags(void) = 0; virtual std::string linpackRollFlags(void) = 0; CBMBenchmarkLINPACKC(class CBMSystem *_system); virtual std::string language(void); virtual std::string benchmarkLINPACKCComments(void) = 0; virtual char* extractDirectory(void); virtual int hasPatch(void); virtual int patch(int _force = 0); virtual int extract(int _force = 0); virtual int preConfigure(int _force); virtual int configure(CBMBenchmarkContextCompiler *_currentCompiler, CBMBenchmarkContextCompilerOptions *_currentOptions); virtual int make(void); virtual std::string bench(void); virtual int release(void); public: virtual std::string license(void); virtual std::string homePage(void); virtual std::string author(void); virtual int benchmarkSize(void); virtual ~CBMBenchmarkLINPACKC(); }; /** \brief Defines the single precision unrolled benchmark within linpackc package. */ class CBMBenchmarkLINPACKC_SP_UNROLL : public CBMBenchmarkLINPACKC { public: private: protected: virtual std::string linpackPrecisionFlags(void); virtual std::string linpackRollFlags(void); virtual std::string benchmarkLINPACKCComments(void); public: CBMBenchmarkLINPACKC_SP_UNROLL(class CBMSystem *_system); virtual std::string benchmarkName(void); virtual ~CBMBenchmarkLINPACKC_SP_UNROLL(); }; /** \brief Defines the single precision 'rolled' benchmark within linpackc package. */ class CBMBenchmarkLINPACKC_SP_ROLL : public CBMBenchmarkLINPACKC { public: private: protected: virtual std::string linpackPrecisionFlags(void); virtual std::string linpackRollFlags(void); virtual std::string benchmarkLINPACKCComments(void); public: CBMBenchmarkLINPACKC_SP_ROLL(class CBMSystem *_system); virtual std::string benchmarkName(void); virtual ~CBMBenchmarkLINPACKC_SP_ROLL(); }; /** \brief Defines the double precision unrolled benchmark within linpackc package. */ class CBMBenchmarkLINPACKC_DP_UNROLL : public CBMBenchmarkLINPACKC { public: private: protected: virtual std::string linpackPrecisionFlags(void); virtual std::string linpackRollFlags(void); virtual std::string benchmarkLINPACKCComments(void); public: CBMBenchmarkLINPACKC_DP_UNROLL(class CBMSystem *_system); virtual std::string benchmarkName(void); virtual ~CBMBenchmarkLINPACKC_DP_UNROLL(); }; /** \brief Defines the double precision 'rolled' benchmark within linpackc package. */ class CBMBenchmarkLINPACKC_DP_ROLL : public CBMBenchmarkLINPACKC { public: private: protected: virtual std::string linpackPrecisionFlags(void); virtual std::string linpackRollFlags(void); virtual std::string benchmarkLINPACKCComments(void); public: CBMBenchmarkLINPACKC_DP_ROLL(class CBMSystem *_system); virtual std::string benchmarkName(void); virtual ~CBMBenchmarkLINPACKC_DP_ROLL(); }; #endif |