Thread: [Compbench-devel] CompBenchmarks++/SupportedBenchmarks Benchmark-LINPACKC.cpp, 1.1, 1.2 Benchmark-L
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-01-03 20:05:26
|
Update of /cvsroot/compbench/CompBenchmarks++/SupportedBenchmarks In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv12133 Modified Files: Benchmark-LINPACKC.cpp Benchmark-LINPACKC.h Log Message: CBMPackage and new related API used. Index: Benchmark-LINPACKC.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/SupportedBenchmarks/Benchmark-LINPACKC.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Benchmark-LINPACKC.cpp 28 Dec 2006 17:41:03 -0000 1.1 --- Benchmark-LINPACKC.cpp 3 Jan 2007 20:05:20 -0000 1.2 *************** *** 6,30 **** #include <SupportedBenchmarks/Benchmark-LINPACKC.libwrapper.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; --- 6,30 ---- #include <SupportedBenchmarks/Benchmark-LINPACKC.libwrapper.h> ! CBMPackageLINPACKC::CBMPackageLINPACKC(CBMSystem *_system) ! : CBMPackage(_system) { } ! std::string CBMPackageLINPACKC::downloadURL(void) { return("http://www.netlib.org/benchmark/linpackc"); } ! std::string CBMPackageLINPACKC::expectedMD5(void) { return("f6e06f98fdbf7e39f84aa9e6c04de131"); } ! std::string CBMPackageLINPACKC::packageName(void) { return("linpackc"); } ! std::string CBMPackageLINPACKC::benchmarkComments(void) { std::string comment; *************** *** 35,49 **** } ! std::string CBMBenchmarkLINPACKC::packageVersion(void) { return("02-25-1994"); } ! int CBMBenchmarkLINPACKC::packageSize(void) { return(907); } ! int CBMBenchmarkLINPACKC::ContextMatches(CBMCompiler *_currentCompiler, CBMCompilerOptions *_currentOptions) { --- 35,49 ---- } ! std::string CBMPackageLINPACKC::packageVersion(void) { return("02-25-1994"); } ! int CBMPackageLINPACKC::packageSize(void) { return(907); } ! int CBMPackageLINPACKC::ContextMatches(CBMCompiler *_currentCompiler, CBMCompilerOptions *_currentOptions) { *************** *** 51,56 **** std::string previousFlags; ! int r = CBMBenchmark::ContextMatches(_currentCompiler, ! _currentOptions); if (!r) { --- 51,56 ---- std::string previousFlags; ! int r = CBMPackage::ContextMatches(_currentCompiler, ! _currentOptions); if (!r) { *************** *** 62,66 **** localFlags+=linpackRollFlags(); ! previousFlags=system->read("linpackc-localflags"); if ((previousFlags==localFlags) && --- 62,66 ---- localFlags+=linpackRollFlags(); ! previousFlags=System()->read("linpackc-localflags"); if ((previousFlags==localFlags) && *************** *** 73,92 **** ! 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-"; --- 73,92 ---- ! std::string CBMPackageLINPACKC::packageComments(void) { return("Official linpackc benchmark translated to C by Bonnie Toy. A minor patch is applied."); } ! std::string CBMPackageLINPACKC::localPackageName(void) { return("linpackc.c"); } ! std::string CBMPackageLINPACKC::language(void) { return("C"); } ! char* CBMPackageLINPACKC::extractDirectory(void) { std::string dum = "linpackc-"; *************** *** 96,105 **** } ! int CBMBenchmarkLINPACKC::hasPatch(void) { return(1); } ! int CBMBenchmarkLINPACKC::patch(int _force) { std::string cmd; --- 96,105 ---- } ! int CBMPackageLINPACKC::hasPatch(void) { return(1); } ! int CBMPackageLINPACKC::patch(int _force) { std::string cmd; *************** *** 127,131 **** } ! int CBMBenchmarkLINPACKC::extract(int _force) { std::string localFile = localPackageAbsoluteName(); --- 127,131 ---- } ! int CBMPackageLINPACKC::extract(int _force) { std::string localFile = localPackageAbsoluteName(); *************** *** 152,161 **** } ! int CBMBenchmarkLINPACKC::preConfigure(int _force) { return(1); } ! int CBMBenchmarkLINPACKC::configure(CBMCompiler *_currentCompiler, CBMCompilerOptions *_currentOptions) { --- 152,161 ---- } ! int CBMPackageLINPACKC::preConfigure(int _force) { return(1); } ! int CBMPackageLINPACKC::configure(CBMCompiler *_currentCompiler, CBMCompilerOptions *_currentOptions) { *************** *** 163,167 **** } ! int CBMBenchmarkLINPACKC::make(void) { std::string cmd; --- 163,167 ---- } ! int CBMPackageLINPACKC::make(void) { std::string cmd; *************** *** 217,242 **** } ! 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; --- 217,221 ---- } ! int CBMPackageLINPACKC::release(void) { std::string cmd; *************** *** 250,279 **** } ! 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) { } --- 229,290 ---- } ! std::string CBMPackageLINPACKC::license(void) { return("Not specified"); } ! std::string CBMPackageLINPACKC::homePage(void) { return("http://math.nist.gov/scimark/"); } ! std::string CBMPackageLINPACKC::author(void) { return("Roldan Pozo & Bruce R Miller"); } ! int CBMPackageLINPACKC::benchmarkSize(void) { return(packageSize()); } + CBMPackageLINPACKC::~CBMPackageLINPACKC() + { + } + + + + CBMBenchmarkLINPACKC::CBMBenchmarkLINPACKC(CBMPackage *_package) + : CBMBenchmark(_package) + { + } + + std::string CBMBenchmarkLINPACKC::bench(void) + { + std::string cmd; + std::string result; + + cmd="cd "; + cmd+=package->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"); + } + + } + CBMBenchmarkLINPACKC::~CBMBenchmarkLINPACKC() { } ! CBMBenchmarkLINPACKC_SP_UNROLL::CBMBenchmarkLINPACKC_SP_UNROLL(CBMPackage *_package) ! : CBMBenchmarkLINPACKC(_package) { } *************** *** 306,311 **** } ! CBMBenchmarkLINPACKC_SP_ROLL::CBMBenchmarkLINPACKC_SP_ROLL(CBMSystem *_system) ! : CBMBenchmarkLINPACKC(_system) { } --- 317,322 ---- } ! CBMBenchmarkLINPACKC_SP_ROLL::CBMBenchmarkLINPACKC_SP_ROLL(CBMPackage *_package) ! : CBMBenchmarkLINPACKC(_package) { } *************** *** 338,343 **** } ! CBMBenchmarkLINPACKC_DP_UNROLL::CBMBenchmarkLINPACKC_DP_UNROLL(CBMSystem *_system) ! : CBMBenchmarkLINPACKC(_system) { } --- 349,354 ---- } ! CBMBenchmarkLINPACKC_DP_UNROLL::CBMBenchmarkLINPACKC_DP_UNROLL(CBMPackage *_package) ! : CBMBenchmarkLINPACKC(_package) { } *************** *** 370,375 **** } ! CBMBenchmarkLINPACKC_DP_ROLL::CBMBenchmarkLINPACKC_DP_ROLL(CBMSystem *_system) ! : CBMBenchmarkLINPACKC(_system) { } --- 381,386 ---- } ! CBMBenchmarkLINPACKC_DP_ROLL::CBMBenchmarkLINPACKC_DP_ROLL(CBMPackage *_package) ! : CBMBenchmarkLINPACKC(_package) { } Index: Benchmark-LINPACKC.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/SupportedBenchmarks/Benchmark-LINPACKC.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Benchmark-LINPACKC.h 28 Dec 2006 17:41:03 -0000 1.1 --- Benchmark-LINPACKC.h 3 Jan 2007 20:05:20 -0000 1.2 *************** *** 11,18 **** #include <Benchmark/Benchmark.h> /** \brief Defines the linpackc package. */ ! class CBMBenchmarkLINPACKC : public CBMBenchmark { public: --- 11,19 ---- #include <Benchmark/Benchmark.h> + #include <Benchmark/Package.h> /** \brief Defines the linpackc package. */ ! class CBMPackageLINPACKC : public CBMPackage { public: *************** *** 45,50 **** virtual std::string linpackRollFlags(void) = 0; - CBMBenchmarkLINPACKC(class CBMSystem *_system); - virtual std::string language(void); --- 46,49 ---- *************** *** 62,69 **** virtual int make(void); - virtual std::string bench(void); virtual int release(void); public: virtual std::string license(void); virtual std::string homePage(void); --- 61,70 ---- virtual int make(void); virtual int release(void); public: + CBMPackageLINPACKC(class CBMSystem *_system); + DLPackageWrapper_declare(); + virtual std::string license(void); virtual std::string homePage(void); *************** *** 71,74 **** --- 72,85 ---- virtual int benchmarkSize(void); + virtual ~CBMPackageLINPACKC(); + }; + + /** \brief Abstract class for CBMPackageLINPACKC benchmarks + */ + class CBMBenchmarkLINPACKC : public CBMBenchmark + { + protected: + CBMBenchmarkLINPACKC(CBMPackage *_package); + virtual std::string bench(void); virtual ~CBMBenchmarkLINPACKC(); }; *************** *** 88,92 **** public: ! CBMBenchmarkLINPACKC_SP_UNROLL(class CBMSystem *_system); virtual std::string benchmarkName(void); --- 99,103 ---- public: ! CBMBenchmarkLINPACKC_SP_UNROLL(CBMPackage *_package); virtual std::string benchmarkName(void); *************** *** 109,113 **** public: ! CBMBenchmarkLINPACKC_SP_ROLL(class CBMSystem *_system); virtual std::string benchmarkName(void); --- 120,124 ---- public: ! CBMBenchmarkLINPACKC_SP_ROLL(CBMPackage *_package); virtual std::string benchmarkName(void); *************** *** 131,135 **** public: ! CBMBenchmarkLINPACKC_DP_UNROLL(class CBMSystem *_system); virtual std::string benchmarkName(void); --- 142,146 ---- public: ! CBMBenchmarkLINPACKC_DP_UNROLL(CBMPackage *_package); virtual std::string benchmarkName(void); *************** *** 152,156 **** public: ! CBMBenchmarkLINPACKC_DP_ROLL(class CBMSystem *_system); virtual std::string benchmarkName(void); --- 163,167 ---- public: ! CBMBenchmarkLINPACKC_DP_ROLL(CBMPackage *_package); virtual std::string benchmarkName(void); *************** *** 160,164 **** }; ! lib_declare(); #endif --- 171,175 ---- }; ! DLdeclare(); #endif |