├── CONTRIBUTING.md ├── Contributed_Lecture_Materials ├── OpenACC_ResourcesSlide_Aug2017.pptx └── Readme ├── Contributed_Sample_Codes ├── NAS_SHOC_OpenACC_2.5 │ ├── LICENSE │ ├── NAS │ │ ├── BT │ │ │ ├── Makefile │ │ │ ├── add.c │ │ │ ├── adi.c │ │ │ ├── bt.c │ │ │ ├── c_timers.c │ │ │ ├── error.c │ │ │ ├── exact_rhs.c │ │ │ ├── exact_solution.c │ │ │ ├── header.h │ │ │ ├── initialize.c │ │ │ ├── print_results.c │ │ │ ├── print_results.h │ │ │ ├── rhs.c │ │ │ ├── set_constants.c │ │ │ ├── solve_subs.c │ │ │ ├── timers.h │ │ │ ├── type.h │ │ │ ├── verify.c │ │ │ ├── wtime.c │ │ │ ├── wtime.h │ │ │ ├── x_solve.c │ │ │ ├── y_solve.c │ │ │ └── z_solve.c │ │ ├── CG │ │ │ ├── Makefile │ │ │ ├── README.carefully │ │ │ ├── cg.c │ │ │ └── globals.h │ │ ├── EP │ │ │ ├── .ep.c.swo │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── c_timers.c │ │ │ ├── ep.c │ │ │ ├── print_results.c │ │ │ ├── print_results.h │ │ │ ├── timers.h │ │ │ ├── type.h │ │ │ ├── wtime.c │ │ │ └── wtime.h │ │ ├── FT │ │ │ ├── Makefile │ │ │ ├── c_timers.c │ │ │ ├── ft.c │ │ │ ├── print_results.c │ │ │ ├── print_results.h │ │ │ ├── randdp.c │ │ │ ├── randdp.h │ │ │ ├── timers.h │ │ │ ├── wtime.c │ │ │ └── wtime.h │ │ ├── LU-HP │ │ │ ├── Makefile │ │ │ ├── applu.incl │ │ │ ├── blts.c │ │ │ ├── buts.c │ │ │ ├── calcnp.c │ │ │ ├── domain.c │ │ │ ├── erhs.c │ │ │ ├── error.c │ │ │ ├── exact.c │ │ │ ├── jacld.c │ │ │ ├── jacu.c │ │ │ ├── l2norm.c │ │ │ ├── lu.c │ │ │ ├── lu.config │ │ │ ├── pintgr.c │ │ │ ├── read_input.c │ │ │ ├── rhs.c │ │ │ ├── setbv.c │ │ │ ├── setcoeff.c │ │ │ ├── setiv.c │ │ │ ├── ssor.c │ │ │ └── verify.c │ │ ├── MG │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── globals.h │ │ │ ├── mg.c │ │ │ ├── mg.config │ │ │ └── mg.input.sample │ │ ├── README.md │ │ ├── README_NPB3.3 │ │ ├── SP │ │ │ ├── Makefile │ │ │ ├── add.c │ │ │ ├── adi.c │ │ │ ├── c_timers.c │ │ │ ├── error.c │ │ │ ├── exact_rhs.c │ │ │ ├── exact_solution.c │ │ │ ├── header.h │ │ │ ├── initialize.c │ │ │ ├── print_results.c │ │ │ ├── print_results.h │ │ │ ├── rhs.c │ │ │ ├── set_constants.c │ │ │ ├── sp.c │ │ │ ├── tags │ │ │ ├── timers.h │ │ │ ├── txinvr.c │ │ │ ├── type.h │ │ │ ├── verify.c │ │ │ └── wtime.h │ │ ├── common │ │ │ ├── c_print_results.c │ │ │ ├── c_timers.c │ │ │ ├── print_results.c │ │ │ ├── print_results.h │ │ │ ├── randdp.c │ │ │ ├── randdp.h │ │ │ ├── timers.h │ │ │ ├── type.h │ │ │ ├── wtime.c │ │ │ ├── wtime.h │ │ │ └── wtime_sgi64.c │ │ ├── config │ │ │ └── make.def │ │ └── sys │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── make.common │ │ │ ├── print_header │ │ │ ├── print_instructions │ │ │ ├── setparams.c │ │ │ └── suite.awk │ ├── NPB-CUDA │ │ ├── BT │ │ │ ├── Makefile │ │ │ ├── bt.cpp │ │ │ ├── bt_kernels.cu │ │ │ ├── inputbt.data.sample │ │ │ ├── main.h │ │ │ └── timers.cpp │ │ ├── LU │ │ │ ├── Makefile │ │ │ ├── inputlu.data.sample │ │ │ ├── lu.cpp │ │ │ ├── lu_kernels.cu │ │ │ ├── main.h │ │ │ └── timers.cpp │ │ ├── README │ │ └── SP │ │ │ ├── Makefile │ │ │ ├── inputsp.data.sample │ │ │ ├── main.h │ │ │ ├── sp.cpp │ │ │ ├── sp_kernels.cu │ │ │ └── timers.cpp │ ├── NPB-OMP-C │ │ ├── BT │ │ │ ├── Makefile │ │ │ ├── add.c │ │ │ ├── adi.c │ │ │ ├── bt.c │ │ │ ├── error.c │ │ │ ├── exact_rhs.c │ │ │ ├── exact_solution.c │ │ │ ├── header.h │ │ │ ├── initialize.c │ │ │ ├── inputbt.data.sample │ │ │ ├── rhs.c │ │ │ ├── set_constants.c │ │ │ ├── solve_subs.c │ │ │ ├── verify.c │ │ │ ├── work_lhs.h │ │ │ ├── x_solve.c │ │ │ ├── y_solve.c │ │ │ └── z_solve.c │ │ ├── CG │ │ │ ├── Makefile │ │ │ ├── README.carefully │ │ │ ├── cg.c │ │ │ └── globals.h │ │ ├── DC │ │ │ ├── ADC.par │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── adc.c │ │ │ ├── adc.h │ │ │ ├── adcc.h │ │ │ ├── dc.c │ │ │ ├── extbuild.c │ │ │ ├── jobcntl.c │ │ │ ├── macrodef.h │ │ │ ├── npbparams.h │ │ │ ├── protots.h │ │ │ ├── rbt.c │ │ │ └── rbt.h │ │ ├── EP │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── c_print_results.c │ │ │ ├── c_timers.c │ │ │ ├── ep.c │ │ │ ├── npbparams.h │ │ │ ├── print_results.c │ │ │ ├── print_results.h │ │ │ ├── randdp.c │ │ │ ├── randdp.h │ │ │ ├── timers.h │ │ │ ├── type.h │ │ │ ├── wtime.c │ │ │ ├── wtime.h │ │ │ └── wtime_sgi64.c │ │ ├── FT │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── ft.c │ │ │ ├── global.h │ │ │ └── inputft.data.sample │ │ ├── IS │ │ │ ├── Makefile │ │ │ ├── README.carefully │ │ │ ├── is.c │ │ │ ├── is.c.orig │ │ │ └── is.c.test │ │ ├── LU │ │ │ ├── Makefile │ │ │ ├── applu.incl │ │ │ ├── blts.c │ │ │ ├── buts.c │ │ │ ├── domain.c │ │ │ ├── erhs.c │ │ │ ├── error.c │ │ │ ├── exact.c │ │ │ ├── inputlu.data.sample │ │ │ ├── jacld.c │ │ │ ├── jacu.c │ │ │ ├── l2norm.c │ │ │ ├── lu.c │ │ │ ├── pintgr.c │ │ │ ├── read_input.c │ │ │ ├── rhs.c │ │ │ ├── setbv.c │ │ │ ├── setcoeff.c │ │ │ ├── setiv.c │ │ │ ├── ssor.c │ │ │ ├── syncs.c │ │ │ └── verify.c │ │ ├── MG │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── globals.h │ │ │ ├── mg.c │ │ │ └── mg.input.sample │ │ ├── Makefile │ │ ├── SP │ │ │ ├── Makefile │ │ │ ├── add.c │ │ │ ├── adi.c │ │ │ ├── error.c │ │ │ ├── exact_rhs.c │ │ │ ├── exact_solution.c │ │ │ ├── header.h │ │ │ ├── initialize.c │ │ │ ├── inputsp.data.sample │ │ │ ├── ninvr.c │ │ │ ├── pinvr.c │ │ │ ├── rhs.c │ │ │ ├── set_constants.c │ │ │ ├── sp.c │ │ │ ├── txinvr.c │ │ │ ├── tzetar.c │ │ │ ├── verify.c │ │ │ ├── x_solve.c │ │ │ ├── y_solve.c │ │ │ └── z_solve.c │ │ ├── UA │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── adapt.c │ │ │ ├── convect.c │ │ │ ├── diffuse.c │ │ │ ├── header.h │ │ │ ├── mason.c │ │ │ ├── move.c │ │ │ ├── precond.c │ │ │ ├── setup.c │ │ │ ├── transfer.c │ │ │ ├── transfer_au.c │ │ │ ├── ua.c │ │ │ ├── utils.c │ │ │ └── verify.c │ │ ├── common │ │ │ ├── c_print_results.c │ │ │ ├── c_timers.c │ │ │ ├── print_results.c │ │ │ ├── print_results.h │ │ │ ├── randdp.c │ │ │ ├── randdp.h │ │ │ ├── timers.h │ │ │ ├── type.h │ │ │ ├── wtime.c │ │ │ ├── wtime.h │ │ │ └── wtime_sgi64.c │ │ ├── config │ │ │ ├── NAS.samples │ │ │ │ ├── README │ │ │ │ ├── make.def.gcc_x86 │ │ │ │ ├── make.def_ibm │ │ │ │ ├── make.def_ibm64 │ │ │ │ ├── make.def_intel │ │ │ │ ├── make.def_omni │ │ │ │ ├── make.def_pgi │ │ │ │ ├── make.def_sgi │ │ │ │ ├── make.def_sgi64 │ │ │ │ ├── make.def_sun │ │ │ │ ├── make.def_sun64 │ │ │ │ ├── suite.def.bt │ │ │ │ ├── suite.def.cg │ │ │ │ ├── suite.def.ep │ │ │ │ ├── suite.def.ft │ │ │ │ ├── suite.def.is │ │ │ │ ├── suite.def.lu │ │ │ │ ├── suite.def.mg │ │ │ │ └── suite.def.sp │ │ │ ├── make.def │ │ │ ├── make.def.template │ │ │ ├── suite.def │ │ │ └── suite.def.template │ │ └── sys │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── make.common │ │ │ ├── print_header │ │ │ ├── print_instructions │ │ │ ├── setparams │ │ │ ├── setparams.c │ │ │ └── suite.awk │ ├── README.md │ ├── SHOC │ │ ├── LICENSE │ │ ├── README.md │ │ ├── common │ │ │ ├── BadCommandLine.h │ │ │ ├── CTimer.cpp │ │ │ ├── CTimer.h │ │ │ ├── Graph.cpp │ │ │ ├── Graph.h │ │ │ ├── HostStencil.cpp │ │ │ ├── HostStencil.h │ │ │ ├── HostStencilFactory.cpp │ │ │ ├── HostStencilFactory.h │ │ │ ├── InitializeMatrix2D.cpp │ │ │ ├── InitializeMatrix2D.h │ │ │ ├── InvalidArgValue.cpp │ │ │ ├── InvalidArgValue.h │ │ │ ├── Makefile │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── Matrix2D.cpp │ │ │ ├── Matrix2D.h │ │ │ ├── Matrix2DFileSupport.cpp │ │ │ ├── Matrix2DStatics.cpp │ │ │ ├── MultiNodeContainer.h │ │ │ ├── NodeIDList.h │ │ │ ├── NodePlatformContainer.h │ │ │ ├── Option.cpp │ │ │ ├── Option.h │ │ │ ├── OptionParser.cpp │ │ │ ├── OptionParser.h │ │ │ ├── PMSMemMgr.h │ │ │ ├── Platform.h │ │ │ ├── ProgressBar.cpp │ │ │ ├── ProgressBar.h │ │ │ ├── QTC │ │ │ │ ├── libdata.cpp │ │ │ │ ├── libdata.h │ │ │ │ └── qtc_common.h │ │ │ ├── ResultDatabase.cpp │ │ │ ├── ResultDatabase.h │ │ │ ├── SerialStencilUtil.cpp │ │ │ ├── SerialStencilUtil.h │ │ │ ├── SerializableObject.h │ │ │ ├── Spmv │ │ │ │ └── util.h │ │ │ ├── Stencil.h │ │ │ ├── StencilFactory.cpp │ │ │ ├── StencilFactory.h │ │ │ ├── StencilUtil.cpp │ │ │ ├── StencilUtil.h │ │ │ ├── Timer.cpp │ │ │ ├── Timer.h │ │ │ ├── Utility.h │ │ │ ├── ValidateMatrix2D.cpp │ │ │ ├── ValidateMatrix2D.h │ │ │ └── libSHOCCommon.a │ │ ├── config │ │ │ ├── common.mk │ │ │ ├── common.mk.in │ │ │ ├── conf-atlanta.sh │ │ │ ├── conf-cation.sh │ │ │ ├── conf-crossarm.sh │ │ │ ├── conf-ion.sh │ │ │ ├── conf-keeneland.sh │ │ │ ├── conf-lens.sh │ │ │ ├── conf-linux.sh │ │ │ ├── conf-llano.sh │ │ │ ├── conf-newark.sh │ │ │ ├── conf-osx.sh │ │ │ ├── conf-titan.sh │ │ │ ├── conf-valhalla.sh │ │ │ ├── config.h │ │ │ ├── config.h.in │ │ │ ├── config.mk │ │ │ ├── config.mk.in │ │ │ ├── dirtargets.mk │ │ │ ├── dirtargets.mk.in │ │ │ ├── find_cuda_libs.sh │ │ │ ├── stamp-h1 │ │ │ ├── targets.mk │ │ │ └── targets.mk.in │ │ ├── crpl_conf │ │ │ ├── make.common │ │ │ └── make.def │ │ └── openacc │ │ │ ├── common │ │ │ ├── PMSMemMgmt.h │ │ │ └── main.cpp │ │ │ └── level1 │ │ │ ├── md │ │ │ ├── MD.cpp │ │ │ ├── MD.h │ │ │ ├── MDFuncs.cpp │ │ │ ├── Makefile.acc │ │ │ ├── Makefile.omp │ │ │ └── constants.h │ │ │ ├── reduction │ │ │ ├── Makefile.acc │ │ │ ├── Makefile.omp │ │ │ ├── ReduceFuncs.cpp │ │ │ └── Reduction.cpp │ │ │ └── stencil2d │ │ │ ├── CommonOpenACCStencilFactory.cpp │ │ │ ├── CommonOpenACCStencilFactory.h │ │ │ ├── MPIOpenACCStencil.cpp │ │ │ ├── MPIOpenACCStencil.h │ │ │ ├── MPIOpenACCStencilFactory.cpp │ │ │ ├── MPIOpenACCStencilFactory.h │ │ │ ├── Makefile.acc │ │ │ ├── Makefile.omp │ │ │ ├── OpenACCStencil.cpp │ │ │ ├── OpenACCStencil.h │ │ │ ├── OpenACCStencilFactory.cpp │ │ │ ├── OpenACCStencilFactory.h │ │ │ ├── Stencil2Dmain.cpp │ │ │ └── StencilFuncs.cpp │ └── scripts │ │ ├── conf_files │ │ ├── acc │ │ │ ├── BT.conf │ │ │ ├── CG.conf │ │ │ ├── EP.conf │ │ │ ├── FT.conf │ │ │ ├── LU.conf │ │ │ ├── MG.conf │ │ │ ├── SP.conf │ │ │ ├── md.conf │ │ │ ├── reduction.conf │ │ │ └── stencil.conf │ │ ├── acc_multicore │ │ │ ├── BT.conf │ │ │ ├── CG.conf │ │ │ ├── EP.conf │ │ │ ├── FT.conf │ │ │ ├── LU.conf │ │ │ ├── MG.conf │ │ │ ├── SP.conf │ │ │ ├── md.conf │ │ │ ├── reduction.conf │ │ │ └── stencil.conf │ │ ├── cuda │ │ │ ├── BT.conf │ │ │ ├── LU.conf │ │ │ └── SP.conf │ │ └── omp │ │ │ ├── BT.conf │ │ │ ├── CG.conf │ │ │ ├── EP.conf │ │ │ ├── FT.conf │ │ │ ├── LU.conf │ │ │ ├── MG.conf │ │ │ ├── SP.conf │ │ │ ├── md.conf │ │ │ ├── reduction.conf │ │ │ └── stencil.conf │ │ ├── create_app.sh │ │ ├── execExperiments.sh │ │ ├── pcc-0.1.0 │ │ ├── cpp.py │ │ ├── parser.py │ │ └── scanner.py │ │ ├── plot_bar.py │ │ ├── plot_boxplot.py │ │ ├── plot_indbar.py │ │ ├── plot_scatter.py │ │ ├── processResults.sh │ │ ├── record_cpu.sh │ │ └── singleExperiment.sh ├── PolyBench-ACC │ ├── #README.m# │ ├── #README.md# │ ├── AUTHORS │ ├── LICENSE │ ├── Makefile │ ├── README │ ├── README.md │ ├── datamining │ │ ├── Makefile │ │ ├── correlation │ │ │ ├── Makefile │ │ │ ├── correlation.c │ │ │ └── correlation.h │ │ └── covariance │ │ │ ├── Makefile │ │ │ ├── covariance.c │ │ │ └── covariance.h │ ├── linear-algebra │ │ ├── Makefile │ │ ├── kernels │ │ │ ├── 2mm │ │ │ │ ├── #2mm.c# │ │ │ │ ├── .gitignore │ │ │ │ ├── 2mm.c │ │ │ │ ├── 2mm.h │ │ │ │ ├── Makefile │ │ │ │ └── compiler.opts │ │ │ ├── 3mm │ │ │ │ ├── 3mm.c │ │ │ │ ├── 3mm.h │ │ │ │ ├── Makefile │ │ │ │ └── compiler.opts │ │ │ ├── Makefile │ │ │ ├── atax │ │ │ │ ├── Makefile │ │ │ │ ├── atax.c │ │ │ │ └── atax.h │ │ │ ├── bicg │ │ │ │ ├── Makefile │ │ │ │ ├── bicg.c │ │ │ │ └── bicg.h │ │ │ ├── cholesky │ │ │ │ ├── Makefile │ │ │ │ ├── cholesky.c │ │ │ │ └── cholesky.h │ │ │ ├── doitgen │ │ │ │ ├── Makefile │ │ │ │ ├── doitgen.c │ │ │ │ └── doitgen.h │ │ │ ├── gemm │ │ │ │ ├── Makefile │ │ │ │ ├── gemm.c │ │ │ │ └── gemm.h │ │ │ ├── gemver │ │ │ │ ├── Makefile │ │ │ │ ├── gemver.c │ │ │ │ └── gemver.h │ │ │ ├── gesummv │ │ │ │ ├── Makefile │ │ │ │ ├── gesummv.c │ │ │ │ └── gesummv.h │ │ │ ├── mvt │ │ │ │ ├── Makefile │ │ │ │ ├── mvt.c │ │ │ │ └── mvt.h │ │ │ ├── symm │ │ │ │ ├── Makefile │ │ │ │ ├── symm.c │ │ │ │ └── symm.h │ │ │ ├── syr2k │ │ │ │ ├── Makefile │ │ │ │ ├── syr2k.c │ │ │ │ └── syr2k.h │ │ │ ├── syrk │ │ │ │ ├── Makefile │ │ │ │ ├── syrk.c │ │ │ │ └── syrk.h │ │ │ ├── trisolv │ │ │ │ ├── Makefile │ │ │ │ ├── trisolv.c │ │ │ │ └── trisolv.h │ │ │ └── trmm │ │ │ │ ├── Makefile │ │ │ │ ├── trmm.c │ │ │ │ └── trmm.h │ │ └── solvers │ │ │ ├── Makefile │ │ │ ├── durbin │ │ │ ├── Makefile │ │ │ ├── durbin.c │ │ │ └── durbin.h │ │ │ ├── dynprog │ │ │ ├── Makefile │ │ │ ├── dynprog.c │ │ │ └── dynprog.h │ │ │ ├── gramschmidt │ │ │ ├── Makefile │ │ │ ├── gramschmidt.c │ │ │ └── gramschmidt.h │ │ │ ├── lu │ │ │ ├── Makefile │ │ │ ├── lu.c │ │ │ └── lu.h │ │ │ └── ludcmp │ │ │ ├── Makefile │ │ │ ├── ludcmp.c │ │ │ └── ludcmp.h │ ├── medley │ │ ├── Makefile │ │ ├── floyd-warshall │ │ │ ├── Makefile │ │ │ ├── floyd-warshall.c │ │ │ └── floyd-warshall.h │ │ └── reg_detect │ │ │ ├── Makefile │ │ │ ├── reg_detect.c │ │ │ └── reg_detect.h │ ├── stencils │ │ ├── Makefile │ │ ├── adi │ │ │ ├── Makefile │ │ │ ├── adi.c │ │ │ └── adi.h │ │ ├── convolution-2d │ │ │ ├── Makefile │ │ │ ├── convolution-2d.c │ │ │ └── convolution-2d.h │ │ ├── convolution-3d │ │ │ ├── Makefile │ │ │ ├── convolution-3d.c │ │ │ └── convolution-3d.h │ │ ├── fdtd-2d │ │ │ ├── Makefile │ │ │ ├── fdtd-2d.c │ │ │ └── fdtd-2d.h │ │ ├── fdtd-apml │ │ │ ├── Makefile │ │ │ ├── fdtd-apml.c │ │ │ └── fdtd-apml.h │ │ ├── jacobi-1d-imper │ │ │ ├── Makefile │ │ │ ├── jacobi-1d-imper.c │ │ │ └── jacobi-1d-imper.h │ │ ├── jacobi-2d-imper │ │ │ ├── Makefile │ │ │ ├── jacobi-2d-imper.c │ │ │ └── jacobi-2d-imper.h │ │ └── seidel-2d │ │ │ ├── Makefile │ │ │ ├── seidel-2d.c │ │ │ └── seidel-2d.h │ └── utilities │ │ ├── benchmark_list │ │ ├── c.mk │ │ ├── c2.mk │ │ ├── common.mk │ │ ├── create_cpped_version.sh │ │ ├── options.mk │ │ ├── papi_counters.list │ │ ├── polybench.c │ │ ├── polybench.h │ │ ├── template-for-new-benchmark.c │ │ ├── template-for-new-benchmark.h │ │ └── time_benchmark.sh ├── Readme └── Tutorial1 │ ├── LICENSE │ ├── README.md │ ├── pi │ ├── Makefile │ ├── README.md │ ├── pic.cpp │ └── pif.f90 │ └── solver │ ├── Makefile │ ├── README.md │ ├── jsolvec.cpp │ └── jsolvef.F90 └── README.md /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributor Agreement 2 | ===================== 3 | 4 | # Licensing 5 | Code examples contributed to this project must be licensed under the 3-clause 6 | BSD license or a compatible license. Code examples that do not contain a clear 7 | statement of license will not be accepted.  8 | 9 | # Pull Request Process 10 | Contributors should: 11 | - Fork a copy of the repository 12 | - Clone the project to your own machine 13 | - Add your examples by following the guidelines in CONTRIBUTING.md 14 | - Commit and push the changes to your fork 15 | - Submit a pull request to have your contribution accepted into the main repository. 16 | 17 | # Indicating your acceptance 18 | Contributions must have a signed-off-by tag in the commit message, acknowledging 19 | the rights of the author to make the contribution under the specified license. 20 |   21 | 22 | # Your information 23 | Contributors may add their name, affiliation, and 24 | contact information to the CONTRIBUTORS file in the source repository. 25 | 26 | 27 | # Update the README.md 28 | When you add an example, you are required to add to the list of examples 29 | in the project’s README.md with the name of your example codes and 1-2 sentences describing them. 30 | Detailed explanations of the code should be placed in the contribution’s README file rather than 31 | in the README.md file of the project. 32 | 33 | 34 | -------------------------------------------------------------------------------- /Contributed_Lecture_Materials/OpenACC_ResourcesSlide_Aug2017.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenACCUserGroup/openacc-users-group/76f649b8e92ab2187a55e2bf130517ee09d71573/Contributed_Lecture_Materials/OpenACC_ResourcesSlide_Aug2017.pptx -------------------------------------------------------------------------------- /Contributed_Lecture_Materials/Readme: -------------------------------------------------------------------------------- 1 | All lecture materials will go into this folder 2 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | BSD 3-Clause License 3 | 4 | Copyright (c) 2017, University of Delaware 5 | Sergio Pino sergiop@udel.edu 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | 11 | * Redistributions of source code must retain the above copyright notice, this 12 | list of conditions and the following disclaimer. 13 | 14 | * Redistributions in binary form must reproduce the above copyright notice, 15 | this list of conditions and the following disclaimer in the documentation 16 | and/or other materials provided with the distribution. 17 | 18 | * Neither the name of the copyright holder nor the names of its 19 | contributors may be used to endorse or promote products derived from 20 | this software without specific prior written permission. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 23 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 26 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 30 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/BT/print_results.h: -------------------------------------------------------------------------------- 1 | #ifndef __PRINT_RESULTS_H__ 2 | #define __PRINT_RESULTS_H__ 3 | 4 | void print_results(char *name, char class, int n1, int n2, int n3, int niter, 5 | double t, double mops, char *optype, int verified, char *npbversion, 6 | char *compiletime, char *cs1, char *cs2, char *cs3, char *cs4, char *cs5, 7 | char *cs6, char *cs7); 8 | 9 | #endif //__PRINT_RESULTS_H__ 10 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/BT/timers.h: -------------------------------------------------------------------------------- 1 | #ifndef __TIMERS_H__ 2 | #define __TIMERS_H__ 3 | 4 | void timer_clear( int n ); 5 | void timer_start( int n ); 6 | void timer_stop( int n ); 7 | double timer_read( int n ); 8 | 9 | #endif 10 | 11 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/BT/type.h: -------------------------------------------------------------------------------- 1 | #ifndef __TYPE_H__ 2 | #define __TYPE_H__ 3 | 4 | typedef enum { false, true } logical; 5 | typedef struct { 6 | double real; 7 | double imag; 8 | } dcomplex; 9 | 10 | 11 | #define min(x,y) ((x) < (y) ? (x) : (y)) 12 | #define max(x,y) ((x) > (y) ? (x) : (y)) 13 | 14 | #endif //__TYPE_H__ 15 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/BT/wtime.c: -------------------------------------------------------------------------------- 1 | #include "wtime.h" 2 | #include 3 | #ifndef DOS 4 | #include 5 | #endif 6 | 7 | void wtime(double *t) 8 | { 9 | static int sec = -1; 10 | struct timeval tv; 11 | gettimeofday(&tv, (void *)0); 12 | if (sec < 0) sec = tv.tv_sec; 13 | *t = (tv.tv_sec - sec) + 1.0e-6*tv.tv_usec; 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/BT/wtime.h: -------------------------------------------------------------------------------- 1 | /* C/Fortran interface is different on different machines. 2 | * You may need to tweak this. 3 | */ 4 | 5 | 6 | #if defined(IBM) 7 | #define wtime wtime 8 | #elif defined(CRAY) 9 | #define wtime WTIME 10 | #else 11 | #define wtime wtime_ 12 | #endif 13 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/CG/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=/bin/sh 2 | BENCHMARK=cg 3 | BENCHMARKU=CG 4 | DEFINES=-DCRPL_COMP=0 5 | PXM=acc 6 | 7 | include ../config/make.def 8 | 9 | include ../sys/make.common 10 | 11 | OBJS = cg.o \ 12 | ${COMMON}/print_results.o \ 13 | ${COMMON}/${RAND}.o \ 14 | ${COMMON}/c_timers.o \ 15 | ${COMMON}/wtime.o 16 | 17 | 18 | ${PROGRAM}: config ${OBJS} 19 | ${CLINK} ${CLINKFLAGS} -o ${PROGRAM} ${OBJS} ${C_LIB} 20 | 21 | .c.o: 22 | ${CCOMPILE} ${DEFINES} $< 23 | 24 | cg.o: cg.c globals.h npbparams.h 25 | 26 | clean: 27 | - rm -f *.x *.w2c.ptx *.o *.w2c.cu *.w2c.c *.w2c.h *.i *.spin *.B *.s *.t *~ ../common/*.o 28 | - rm -f npbparams.h core 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/CG/README.carefully: -------------------------------------------------------------------------------- 1 | Note: please observe that in the routine conj_grad three 2 | implementations of the sparse matrix-vector multiply have 3 | been supplied. The default matrix-vector multiply is not 4 | loop unrolled. The alternate implementations are unrolled 5 | to a depth of 2 and unrolled to a depth of 8. Please 6 | experiment with these to find the fastest for your particular 7 | architecture. If reporting timing results, any of these three may 8 | be used without penalty. 9 | 10 | Performance examples: 11 | The non-unrolled version of the multiply is actually (slightly: 12 | maybe %5) faster on the sp2-66MHz-WN on 16 nodes than is the 13 | unrolled-by-2 version below. On the Cray t3d, the reverse is true, 14 | i.e., the unrolled-by-two version is some 10% faster. 15 | The unrolled-by-8 version below is significantly faster 16 | on the Cray t3d - overall speed of code is 1.5 times faster. 17 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/EP/.ep.c.swo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenACCUserGroup/openacc-users-group/76f649b8e92ab2187a55e2bf130517ee09d71573/Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/EP/.ep.c.swo -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/EP/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=/bin/sh 2 | BENCHMARK=ep 3 | BENCHMARKU=EP 4 | DEFINES=-DCRPL_COMP=0 5 | PXM=acc 6 | 7 | include ../config/make.def 8 | 9 | include ../sys/make.common 10 | 11 | OBJS = ep.o \ 12 | print_results.o \ 13 | ${COMMON}/${RAND}.o \ 14 | c_timers.o \ 15 | wtime.o 16 | 17 | 18 | ${PROGRAM}: config ${OBJS} 19 | ${CLINK} ${CLINKFLAGS} -o ${PROGRAM} ${OBJS} ${C_LIB} 20 | 21 | .c.o: 22 | ${CCOMPILE} ${DEFINES} $< 23 | 24 | ep.o: ep.c npbparams.h 25 | 26 | clean: 27 | - rm -f *.i *.w2c.h *.w2c.c *.t *.spin *.B *.x *.w2c.ptx *.w2c.cu *.o *~ ../common/*.o 28 | - rm -f npbparams.h core 29 | 30 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/EP/README: -------------------------------------------------------------------------------- 1 | This code implements the random-number generator described in the 2 | NAS Parallel Benchmark document RNR Technical Report RNR-94-007. 3 | The code is "embarrassingly" parallel in that no communication is 4 | required for the generation of the random numbers itself. 5 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/EP/print_results.h: -------------------------------------------------------------------------------- 1 | #ifndef __PRINT_RESULTS_H__ 2 | #define __PRINT_RESULTS_H__ 3 | 4 | void print_results(char *name, char class, int n1, int n2, int n3, int niter, 5 | double t, double mops, char *optype, int verified, char *npbversion, 6 | char *compiletime, char *cs1, char *cs2, char *cs3, char *cs4, char *cs5, 7 | char *cs6, char *cs7); 8 | 9 | #endif //__PRINT_RESULTS_H__ 10 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/EP/timers.h: -------------------------------------------------------------------------------- 1 | #ifndef __TIMERS_H__ 2 | #define __TIMERS_H__ 3 | 4 | void timer_clear( int n ); 5 | void timer_start( int n ); 6 | void timer_stop( int n ); 7 | double timer_read( int n ); 8 | 9 | #endif 10 | 11 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/EP/type.h: -------------------------------------------------------------------------------- 1 | #ifndef __TYPE_H__ 2 | #define __TYPE_H__ 3 | 4 | typedef enum { false, true } logical; 5 | typedef struct { 6 | double real; 7 | double imag; 8 | } dcomplex; 9 | 10 | 11 | #define min(x,y) ((x) < (y) ? (x) : (y)) 12 | #define max(x,y) ((x) > (y) ? (x) : (y)) 13 | 14 | #endif //__TYPE_H__ 15 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/EP/wtime.c: -------------------------------------------------------------------------------- 1 | #include "wtime.h" 2 | #include 3 | #ifndef DOS 4 | #include 5 | #endif 6 | 7 | void wtime(double *t) 8 | { 9 | static int sec = -1; 10 | struct timeval tv; 11 | gettimeofday(&tv, (void *)0); 12 | if (sec < 0) sec = tv.tv_sec; 13 | *t = (tv.tv_sec - sec) + 1.0e-6*tv.tv_usec; 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/EP/wtime.h: -------------------------------------------------------------------------------- 1 | /* C/Fortran interface is different on different machines. 2 | * You may need to tweak this. 3 | */ 4 | 5 | 6 | #if defined(IBM) 7 | #define wtime wtime 8 | #elif defined(CRAY) 9 | #define wtime WTIME 10 | #else 11 | #define wtime wtime_ 12 | #endif 13 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/FT/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=/bin/sh 2 | BENCHMARK=ft 3 | BENCHMARKU=FT 4 | DEFINES=-DCRPL_COMP=0 5 | PXM=acc 6 | 7 | include ../config/make.def 8 | 9 | include ../sys/make.common 10 | 11 | OBJS = ft.o ${RAND}.o print_results.o \ 12 | c_timers.o wtime.o 13 | 14 | ${PROGRAM}: config ${OBJS} 15 | ${CLINK} ${CLINKFLAGS} -o ${PROGRAM} ${OBJS} ${C_LIB} 16 | 17 | .c.o: 18 | ${CCOMPILE} ${DEFINES} $< 19 | 20 | ft.o: ft.c npbparams.h 21 | 22 | clean: 23 | - rm -f *.x *.i *.B *.spin *.s *.t *.w2c.c *.w2c.h *.w2c.cu *.ptx *.o *~ mputil* ../common/*.o 24 | - rm -f ft npbparams.h core 25 | - if [ -d rii_files ]; then rm -r rii_files; fi 26 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/FT/print_results.h: -------------------------------------------------------------------------------- 1 | #ifndef __PRINT_RESULTS_H__ 2 | #define __PRINT_RESULTS_H__ 3 | 4 | void print_results(char *name, char class, int n1, int n2, int n3, int niter, 5 | double t, double mops, char *optype, int verified, char *npbversion, 6 | char *compiletime, char *cs1, char *cs2, char *cs3, char *cs4, char *cs5, 7 | char *cs6, char *cs7); 8 | 9 | #endif //__PRINT_RESULTS_H__ 10 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/FT/randdp.h: -------------------------------------------------------------------------------- 1 | #ifndef __RANDDP_H__ 2 | #define __RANDDP_H__ 3 | 4 | double randlc( double *x, double a ); 5 | void vranlc( int n, double *x, double a, double y[] ); 6 | 7 | #endif 8 | 9 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/FT/timers.h: -------------------------------------------------------------------------------- 1 | #ifndef __TIMERS_H__ 2 | #define __TIMERS_H__ 3 | 4 | void timer_clear( int n ); 5 | void timer_start( int n ); 6 | void timer_stop( int n ); 7 | double timer_read( int n ); 8 | 9 | #endif 10 | 11 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/FT/wtime.c: -------------------------------------------------------------------------------- 1 | #include "wtime.h" 2 | #include 3 | #ifndef DOS 4 | #include 5 | #endif 6 | 7 | void wtime(double *t) 8 | { 9 | static int sec = -1; 10 | struct timeval tv; 11 | gettimeofday(&tv, (void *)0); 12 | if (sec < 0) sec = tv.tv_sec; 13 | *t = (tv.tv_sec - sec) + 1.0e-6*tv.tv_usec; 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/FT/wtime.h: -------------------------------------------------------------------------------- 1 | /* C/Fortran interface is different on different machines. 2 | * You may need to tweak this. 3 | */ 4 | 5 | 6 | #if defined(IBM) 7 | #define wtime wtime 8 | #elif defined(CRAY) 9 | #define wtime WTIME 10 | #else 11 | #define wtime wtime_ 12 | #endif 13 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/LU-HP/lu.config: -------------------------------------------------------------------------------- 1 | gpustarttimestamp 2 | gridsize 3 | threadblocksize 4 | memtransferdir 5 | memtransfersize 6 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/MG/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=/bin/sh 2 | BENCHMARK=mg 3 | BENCHMARKU=MG 4 | DEFINES=-DCRPL_COMP=0 5 | PXM=acc 6 | 7 | include ../config/make.def 8 | 9 | include ../sys/make.common 10 | 11 | OBJS = mg.o \ 12 | ${COMMON}/print_results.o \ 13 | ${COMMON}/c_timers.o \ 14 | ${COMMON}/wtime.o 15 | 16 | 17 | ${PROGRAM}: config ${OBJS} 18 | ${CLINK} ${CLINKFLAGS} -o ${PROGRAM} ${OBJS} ${C_LIB} 19 | 20 | .c.o: 21 | ${CCOMPILE} ${DEFINES} $< 22 | 23 | mg.o: mg.c globals.h npbparams.h 24 | 25 | clean: 26 | - rm -f *.o *~ ../common/*.o *.w2c.c *.w2c.h *.i *.B *.t *.w2c.cu *.w2c.ptx *.spin *.s *.x 27 | - rm -f npbparams.h core 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/MG/mg.config: -------------------------------------------------------------------------------- 1 | gpustarttimestamp 2 | gridsize 3 | threadblocksize 4 | memtransferdir 5 | memtransfersize 6 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/MG/mg.input.sample: -------------------------------------------------------------------------------- 1 | 8 = top level 2 | 256 256 256 = nx ny nz 3 | 20 = nit 4 | 0 0 0 0 0 0 0 0 = debug_vec 5 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/SP/print_results.h: -------------------------------------------------------------------------------- 1 | #ifndef __PRINT_RESULTS_H__ 2 | #define __PRINT_RESULTS_H__ 3 | 4 | void print_results(char *name, char class, int n1, int n2, int n3, int niter, 5 | double t, double mops, char *optype, int verified, char *npbversion, 6 | char *compiletime, char *cs1, char *cs2, char *cs3, char *cs4, char *cs5, 7 | char *cs6, char *cs7); 8 | 9 | #endif //__PRINT_RESULTS_H__ 10 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/SP/timers.h: -------------------------------------------------------------------------------- 1 | #ifndef __TIMERS_H__ 2 | #define __TIMERS_H__ 3 | 4 | void timer_clear( int n ); 5 | void timer_start( int n ); 6 | void timer_stop( int n ); 7 | double timer_read( int n ); 8 | 9 | #endif 10 | 11 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/SP/type.h: -------------------------------------------------------------------------------- 1 | #ifndef __TYPE_H__ 2 | #define __TYPE_H__ 3 | 4 | typedef enum { false, true } logical; 5 | typedef struct { 6 | double real; 7 | double imag; 8 | } dcomplex; 9 | 10 | 11 | #define min(x,y) ((x) < (y) ? (x) : (y)) 12 | #define max(x,y) ((x) > (y) ? (x) : (y)) 13 | 14 | #endif //__TYPE_H__ 15 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/SP/wtime.h: -------------------------------------------------------------------------------- 1 | /* C/Fortran interface is different on different machines. 2 | * You may need to tweak this. 3 | */ 4 | 5 | 6 | #if defined(IBM) 7 | #define wtime wtime 8 | #elif defined(CRAY) 9 | #define wtime WTIME 10 | #else 11 | #define wtime wtime_ 12 | #endif 13 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/common/print_results.h: -------------------------------------------------------------------------------- 1 | #ifndef __PRINT_RESULTS_H__ 2 | #define __PRINT_RESULTS_H__ 3 | 4 | void print_results(char *name, char class, int n1, int n2, int n3, int niter, 5 | double t, double mops, char *optype, int verified, char *npbversion, 6 | char *compiletime, char *cs1, char *cs2, char *cs3, char *cs4, char *cs5, 7 | char *cs6, char *cs7); 8 | 9 | #endif //__PRINT_RESULTS_H__ 10 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/common/randdp.h: -------------------------------------------------------------------------------- 1 | #ifndef __RANDDP_H__ 2 | #define __RANDDP_H__ 3 | 4 | double randlc( double *x, double a ); 5 | void vranlc( int n, double *x, double a, double y[] ); 6 | 7 | #endif 8 | 9 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/common/timers.h: -------------------------------------------------------------------------------- 1 | #ifndef __TIMERS_H__ 2 | #define __TIMERS_H__ 3 | 4 | void timer_clear( int n ); 5 | void timer_start( int n ); 6 | void timer_stop( int n ); 7 | double timer_read( int n ); 8 | 9 | #endif 10 | 11 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/common/type.h: -------------------------------------------------------------------------------- 1 | #ifndef __TYPE_H__ 2 | #define __TYPE_H__ 3 | 4 | typedef enum { false, true } logical; 5 | typedef struct { 6 | double real; 7 | double imag; 8 | } dcomplex; 9 | 10 | 11 | #define min(x,y) ((x) < (y) ? (x) : (y)) 12 | #define max(x,y) ((x) > (y) ? (x) : (y)) 13 | 14 | #endif //__TYPE_H__ 15 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/common/wtime.c: -------------------------------------------------------------------------------- 1 | #include "wtime.h" 2 | #include 3 | #ifndef DOS 4 | #include 5 | #endif 6 | 7 | void wtime(double *t) 8 | { 9 | static int sec = -1; 10 | struct timeval tv; 11 | gettimeofday(&tv, (void *)0); 12 | if (sec < 0) sec = tv.tv_sec; 13 | *t = (tv.tv_sec - sec) + 1.0e-6*tv.tv_usec; 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/common/wtime.h: -------------------------------------------------------------------------------- 1 | /* C/Fortran interface is different on different machines. 2 | * You may need to tweak this. 3 | */ 4 | 5 | 6 | #if defined(IBM) 7 | #define wtime wtime 8 | #elif defined(CRAY) 9 | #define wtime WTIME 10 | #else 11 | #define wtime wtime_ 12 | #endif 13 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/sys/Makefile: -------------------------------------------------------------------------------- 1 | UCC = cc 2 | include ../config/make.def 3 | 4 | # Note that COMPILE is also defined in make.common and should 5 | # be the same. We can't include make.common because it has a lot 6 | # of other garbage. 7 | FCOMPILE = $(F77) -c $(F_INC) $(FFLAGS) 8 | 9 | all: clean setparams 10 | 11 | # setparams creates an npbparam.h file for each benchmark 12 | # configuration. npbparams.h also contains info about how a benchmark 13 | # was compiled and linked 14 | 15 | setparams: setparams.c ../config/make.def 16 | $(UCC) ${CONVERTFLAG} -o setparams setparams.c 17 | 18 | 19 | clean: 20 | -rm -f setparams setparams.h npbparams.h 21 | -rm -f *~ *.o 22 | 23 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/sys/README: -------------------------------------------------------------------------------- 1 | This directory contains utilities and files used by the 2 | build process. You should not need to change anything 3 | in this directory. 4 | 5 | Original Files 6 | -------------- 7 | setparams.c: 8 | Source for the setparams program. This program is used internally 9 | in the build process to create the file "npbparams.h" for each 10 | benchmark. npbparams.h contains Fortran or C parameters to build a 11 | benchmark for a specific class. The setparams program is never run 12 | directly by a user. Its invocation syntax is 13 | 14 | "setparams benchmark-name class". 15 | 16 | It examines the file "npbparams.h" in the current directory. If 17 | the specified parameters are the same as those in the npbparams.h 18 | file, nothing it changed. If the file does not exist or corresponds 19 | to a different class/number of nodes, it is (re)built. 20 | One of the more complicated things in npbparams.h is that it 21 | contains, in a Fortran string, the compiler flags used to build a 22 | benchmark, so that a benchmark can print out how it was compiled. 23 | 24 | make.common 25 | A makefile segment that is included in each individual benchmark 26 | program makefile. It sets up some standard macros (COMPILE, etc) 27 | and makes sure everything is configured correctly (npbparams.h) 28 | 29 | Makefile 30 | Builds setparams 31 | 32 | README 33 | This file. 34 | 35 | 36 | Created files 37 | ------------- 38 | 39 | setparams 40 | See descriptions above 41 | 42 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/sys/print_header: -------------------------------------------------------------------------------- 1 | echo ' ===========================================' 2 | echo ' = NAS PARALLEL BENCHMARKS 3.3 =' 3 | echo ' = Serial Versions =' 4 | echo ' = C =' 5 | echo ' ===========================================' 6 | echo '' 7 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/sys/print_instructions: -------------------------------------------------------------------------------- 1 | echo '' 2 | echo ' To make a NAS benchmark type ' 3 | echo '' 4 | echo ' make CLASS=' 5 | echo '' 6 | echo ' where is "bt", "cg", "ep", "ft", "is", "lu",' 7 | echo ' "lu-hp", "mg", "sp", or "ua"' 8 | echo ' is "S", "W", "A", "B", "C" or "D"' 9 | echo '' 10 | echo ' To make a set of benchmarks, create the file config/suite.def' 11 | echo ' according to the instructions in config/suite.def.template and type' 12 | echo '' 13 | echo ' make suite' 14 | echo '' 15 | echo ' ***************************************************************' 16 | echo ' * Remember to edit the file config/make.def for site specific *' 17 | echo ' * information as described in the README file *' 18 | echo ' ***************************************************************' 19 | 20 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NAS/sys/suite.awk: -------------------------------------------------------------------------------- 1 | BEGIN { SMAKE = "make" } { 2 | if ($1 !~ /^#/ && NF > 1) { 3 | printf "cd `echo %s|tr '[a-z]' '[A-Z]'`; %s clean;", $1, SMAKE; 4 | printf "%s CLASS=%s", SMAKE, $2; 5 | if (NF > 2) { 6 | printf " VERSION=%s", $3; 7 | } 8 | printf "; cd ..\n"; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-CUDA/BT/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=bt 2 | CPP=g++ 3 | CPPFLAGS=-O3 -c -Wall -g 4 | CLINK=g++ 5 | CLINKFLAGS= 6 | CLIB= 7 | NVCOMPILE=nvcc 8 | NVFLAGS=-O3 -c -g -arch=sm_35 9 | NVLIB= 10 | 11 | OBJS = bt.o timers.o bt_kernels.o 12 | 13 | ${PROGRAM}: ${OBJS} 14 | ${NVCOMPILE} ${CLINKFLAGS} -o ${PROGRAM} ${OBJS} ${CLIB} ${NVLIB} 15 | 16 | .cpp.o: 17 | ${CPP} ${CPPFLAGS} $< 18 | %.o: %.cu 19 | ${NVCOMPILE} ${NVFLAGS} $< 20 | 21 | bt.o: bt.cpp main.h 22 | timers.o: timers.cpp main.h 23 | bt_kernels.o: bt_kernels.cu main.h 24 | 25 | clean: 26 | - rm -f *.o 27 | - rm -f core 28 | - rm -f ${PROGRAM} 29 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-CUDA/BT/inputbt.data.sample: -------------------------------------------------------------------------------- 1 | 60 number of time steps 2 | 0.01d0 dt for class A = 0.0008d0. class B = 0.0003d0 class C = 0.0001d0 3 | 12 12 12 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-CUDA/LU/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=lu 2 | CPP=g++ 3 | CPPFLAGS=-O3 -c -Wall -g 4 | CLINKFLAGS= 5 | CLIB= 6 | NVCOMPILE=nvcc 7 | NVFLAGS=-O3 -c -g -arch=sm_35 8 | NVLIB= 9 | 10 | OBJS = lu.o timers.o lu_kernels.o 11 | 12 | ${PROGRAM}: ${OBJS} 13 | ${NVCOMPILE} ${CLINKFLAGS} -o ${PROGRAM} ${OBJS} ${CLIB} ${NVLIB} 14 | 15 | .cpp.o: 16 | ${CPP} ${CPPFLAGS} $< 17 | %.o: %.cu 18 | ${NVCOMPILE} ${NVFLAGS} $< 19 | 20 | lu.o: lu.cpp main.h 21 | timers.o: timers.cpp main.h 22 | lu_kernels.o: lu_kernels.cu main.h 23 | 24 | clean: 25 | - rm -f *.o 26 | - rm -f core 27 | - rm -f ${PROGRAM} 28 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-CUDA/LU/inputlu.data.sample: -------------------------------------------------------------------------------- 1 | c 2 | c***controls printing of the progress of iterations: ipr inorm 3 | 1 250 4 | c 5 | c***the maximum no. of pseudo-time steps to be performed: nitmax 6 | 250 7 | c 8 | c***magnitude of the time step: dt 9 | 2.0e+00 10 | c 11 | c***relaxation factor for SSOR iterations: omega 12 | 1.2 13 | c 14 | c***tolerance levels for steady-state residuals: tolnwt(m),m=1,5 15 | 1.0e-08 1.0e-08 1.0e-08 1.0e-08 1.0e-08 16 | c 17 | c***number of grid points in xi and eta and zeta directions: nx ny nz 18 | 64 64 64 19 | c 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-CUDA/README: -------------------------------------------------------------------------------- 1 | The CUDA implementation of NPB 3.3 (NPB3.3-CUDA) 2 | -------------------------------------------------- 3 | 4 | NPB3.3-CUDA is a sample CUDA implementation based on the 5 | sequential implementation of the NAS Parallel Benchmarks 6 | version 3.3.1. This implementation (NPB3.3-CUDA) contains 7 | three benchmarks: LU, SP, and BT. 8 | 9 | 1. Compilation and Execution 10 | 11 | Prerequisites: C++ compiler and a working CUDA installation 12 | are required. 13 | 14 | To compile the benchmarks, change into the appropriate 15 | subdirectory, adjust the settings in the Makefile to your 16 | system and type make. This produces a single executable 17 | that includes all benchmark classes. The benchmark class 18 | is specified by a command line parameter (see below for 19 | an example). If no parameter is provided, the default 20 | class 'S' is used. 21 | 22 | Example for LU benchmark: 23 | cd LU 24 | make 25 | ./lu A # execute LU benchmark class A 26 | 27 | 28 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-CUDA/SP/Makefile: -------------------------------------------------------------------------------- 1 | PROGRAM=sp 2 | CPP=g++ 3 | CPPFLAGS=-O3 -c -Wall -g 4 | CLINKFLAGS= 5 | CLIB= 6 | NVCOMPILE=nvcc 7 | NVFLAGS=-O3 -c -g -arch=sm_35 8 | NVLIB= 9 | 10 | OBJS = sp.o timers.o sp_kernels.o 11 | 12 | ${PROGRAM}: ${OBJS} 13 | ${NVCOMPILE} ${CLINKFLAGS} -o ${PROGRAM} ${OBJS} ${CLIB} ${NVLIB} 14 | 15 | .cpp.o: 16 | ${CPP} ${CPPFLAGS} $< 17 | %.o: %.cu 18 | ${NVCOMPILE} ${NVFLAGS} $< 19 | 20 | sp.o: sp.cpp main.h 21 | timers.o: timers.cpp main.h 22 | sp_kernels.o: sp_kernels.cu main.h 23 | 24 | clean: 25 | - rm -f *.o 26 | - rm -f core 27 | - rm -f ${PROGRAM} 28 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-CUDA/SP/inputsp.data.sample: -------------------------------------------------------------------------------- 1 | 400 number of time steps 2 | 0.0015d0 dt for class A = 0.0015d0. class B = 0.001d0 class C = 0.00067d0 3 | 64 64 64 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/BT/inputbt.data.sample: -------------------------------------------------------------------------------- 1 | 60 number of time steps 2 | 0.01d0 dt for class A = 0.0008d0. class B = 0.0003d0 class C = 0.0001d0 3 | 12 12 12 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/CG/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=/bin/sh 2 | BENCHMARK=cg 3 | BENCHMARKU=CG 4 | 5 | include ../config/make.def 6 | 7 | include ../sys/make.common 8 | 9 | OBJS = cg.o \ 10 | ${COMMON}/print_results.o \ 11 | ${COMMON}/${RAND}.o \ 12 | ${COMMON}/c_timers.o \ 13 | ${COMMON}/wtime.o 14 | 15 | 16 | ${PROGRAM}: config ${OBJS} 17 | ${CLINK} ${CLINKFLAGS} -o ${PROGRAM} ${OBJS} ${C_LIB} 18 | 19 | .c.o: 20 | ${CCOMPILE} $< 21 | 22 | cg.o: cg.c globals.h npbparams.h 23 | 24 | clean: 25 | - rm -f *.o *~ 26 | - rm -f npbparams.h core 27 | - if [ -d rii_files ]; then rm -r rii_files; fi 28 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/CG/README.carefully: -------------------------------------------------------------------------------- 1 | Note: please observe that in the routine conj_grad three 2 | implementations of the sparse matrix-vector multiply have 3 | been supplied. The default matrix-vector multiply is not 4 | loop unrolled. The alternate implementations are unrolled 5 | to a depth of 2 and unrolled to a depth of 8. Please 6 | experiment with these to find the fastest for your particular 7 | architecture. If reporting timing results, any of these three may 8 | be used without penalty. 9 | 10 | Performance examples: 11 | The non-unrolled version of the multiply is actually (slightly: 12 | maybe %5) faster on the sp2-66MHz-WN on 16 nodes than is the 13 | unrolled-by-2 version below. On the Cray t3d, the reverse is true, 14 | i.e., the unrolled-by-two version is some 10% faster. 15 | The unrolled-by-8 version below is significantly faster 16 | on the Cray t3d - overall speed of code is 1.5 times faster. 17 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/DC/ADC.par: -------------------------------------------------------------------------------- 1 | attrNum=12 2 | measuresNum=1 3 | tuplesNum=100 4 | INVERSE_ENDIAN=0 5 | fileName=ADC 6 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/DC/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=/bin/sh 2 | BENCHMARK=dc 3 | BENCHMARKU=DC 4 | 5 | include ../config/make.def 6 | 7 | include ../sys/make.common 8 | 9 | OBJS = adc.o dc.o extbuild.o rbt.o jobcntl.o \ 10 | ${COMMON}/c_print_results.o \ 11 | ${COMMON}/c_timers.o ${COMMON}/c_wtime.o 12 | 13 | 14 | # npbparams.h is provided for backward compatibility with NPB compilation 15 | # header.h: npbparams.h 16 | 17 | ${PROGRAM}: config ${OBJS} 18 | ${CLINK} ${CLINKFLAGS} -o ${PROGRAM} ${OBJS} ${C_LIB} 19 | 20 | .c.o: 21 | ${CCOMPILE} $< 22 | 23 | adc.o: adc.c npbparams.h 24 | dc.o: dc.c adcc.h adc.h macrodef.h npbparams.h 25 | extbuild.o: extbuild.c adcc.h adc.h macrodef.h npbparams.h 26 | rbt.o: rbt.c adcc.h adc.h rbt.h macrodef.h npbparams.h 27 | jobcntl.o: jobcntl.c adcc.h adc.h macrodef.h npbparams.h 28 | 29 | clean: 30 | - rm -f *.o 31 | - rm -f npbparams.h core 32 | - rm -f {../,}ADC.{logf,view,dat,viewsz,groupby,chunks}.* 33 | 34 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/DC/macrodef.h: -------------------------------------------------------------------------------- 1 | #define PutErrMsg(msg) {fprintf(stderr," %s, errno = %d\n", msg, errno);} 2 | 3 | #define WriteToFile(ptr,size,nitems,stream,logf) if( fwrite(ptr,size,nitems,stream) != nitems )\ 4 | {\ 5 | fprintf(stderr,"\n Write error from WriteToFile()\n"); return ADC_WRITE_FAILED; \ 6 | } 7 | 8 | #ifdef WINNT 9 | #define FSEEK(stream,offset,whence) fseek(stream, (long)offset,whence); 10 | #else 11 | #define FSEEK(stream,offset,whence) fseek(stream,offset,whence); 12 | #endif 13 | 14 | #define GetRecSize(nd,nm) (DIM_FSZ*nd+MSR_FSZ*nm) 15 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/DC/npbparams.h: -------------------------------------------------------------------------------- 1 | #define CLASS 'W' 2 | /* 3 | This file is generated automatically by the setparams utility. 4 | It sets the number of processors and the class of the NPB 5 | in this directory. Do not modify it by hand. 6 | This file provided for backward compatibility. 7 | It is not used in DC benchmark. */ 8 | 9 | long long int input_tuples=100000, attrnum=10; 10 | #define COMPILETIME "03 Mar 2016" 11 | #define NPBVERSION "3.3.1" 12 | #define CC "gcc" 13 | #define CFLAGS "-O3 -fopenmp -mcmodel=medium" 14 | #define CLINK "$(CC)" 15 | #define CLINKFLAGS "-O3 -fopenmp -mcmodel=medium" 16 | #define C_LIB "-lm" 17 | #define C_INC "(none)" 18 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/DC/rbt.h: -------------------------------------------------------------------------------- 1 | #ifndef _ADC_PARVIEW_TREE_DEF_H_ 2 | #define _ADC_PARVIEW_TREE_DEF_H_ 3 | 4 | #define MAX_TREE_HEIGHT 64 5 | enum{BLACK,RED}; 6 | 7 | typedef struct treeNode{ 8 | struct treeNode *left; 9 | struct treeNode *right; 10 | uint32 clr; 11 | int64 nodeMemPool[1]; 12 | } treeNode; 13 | 14 | typedef struct RBTree{ 15 | treeNode root; 16 | treeNode * mp; 17 | uint32 count; 18 | uint32 treeNodeSize; 19 | uint32 nodeDataSize; 20 | uint32 memoryLimit; 21 | uint32 memaddr; 22 | uint32 memoryIsFull; 23 | uint32 freeNodeCounter; 24 | uint32 nNodesLimit; 25 | uint32 nd; 26 | uint32 nm; 27 | uint32 *drcts; 28 | treeNode **nodes; 29 | unsigned char * memPool; 30 | } RBTree; 31 | 32 | #define NEW_TREE_NODE(node_ptr,memPool,memaddr,treeNodeSize, \ 33 | freeNodeCounter,memoryIsFull) \ 34 | node_ptr=(struct treeNode*)(memPool+memaddr); \ 35 | memaddr+=treeNodeSize; \ 36 | (freeNodeCounter)--; \ 37 | if( freeNodeCounter == 0 ) { \ 38 | memoryIsFull = 1; \ 39 | } 40 | 41 | int32 TreeInsert(RBTree *tree, uint32 *attrs); 42 | 43 | #endif /* _ADC_PARVIEW_TREE_DEF_H_ */ 44 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/EP/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=/bin/sh 2 | BENCHMARK=ep 3 | BENCHMARKU=EP 4 | 5 | include ../config/make.def 6 | 7 | include ../sys/make.common 8 | 9 | OBJS = ep.o \ 10 | ${COMMON}/print_results.o \ 11 | ${COMMON}/${RAND}.o \ 12 | ${COMMON}/c_timers.o \ 13 | ${COMMON}/wtime.o 14 | 15 | 16 | ${PROGRAM}: config ${OBJS} 17 | ${CLINK} ${CLINKFLAGS} -o ${PROGRAM} ${OBJS} ${C_LIB} 18 | 19 | .c.o: 20 | ${CCOMPILE} $< 21 | 22 | ep.o: ep.c npbparams.h 23 | 24 | clean: 25 | - rm -f *.o *~ 26 | - rm -f npbparams.h core 27 | - if [ -d rii_files ]; then rm -r rii_files; fi 28 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/EP/README: -------------------------------------------------------------------------------- 1 | This code implements the random-number generator described in the 2 | NAS Parallel Benchmark document RNR Technical Report RNR-94-007. 3 | The code is "embarrassingly" parallel in that no communication is 4 | required for the generation of the random numbers itself. 5 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/EP/npbparams.h: -------------------------------------------------------------------------------- 1 | /* CLASS = W */ 2 | /* 3 | This file is generated automatically by the setparams utility. 4 | It sets the number of processors and the class of the NPB 5 | in this directory. Do not modify it by hand. 6 | */ 7 | #define CLASS 'W' 8 | #define M 25 9 | 10 | #define CONVERTDOUBLE false 11 | #define COMPILETIME "17 Mar 2016" 12 | #define NPBVERSION "3.3.1" 13 | #define CS1 "gcc" 14 | #define CS2 "$(CC)" 15 | #define CS3 "-lm" 16 | #define CS4 "-I../common" 17 | #define CS5 "-g -Wall -O3 -fopenmp -mcmodel=medium" 18 | #define CS6 "-O3 -fopenmp -mcmodel=medium" 19 | #define CS7 "randdp" 20 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/EP/print_results.h: -------------------------------------------------------------------------------- 1 | #ifndef __PRINT_RESULTS_H__ 2 | #define __PRINT_RESULTS_H__ 3 | 4 | void print_results(char *name, char class, int n1, int n2, int n3, int niter, 5 | double t, double mops, char *optype, logical verified, char *npbversion, 6 | char *compiletime, char *cs1, char *cs2, char *cs3, char *cs4, char *cs5, 7 | char *cs6, char *cs7); 8 | 9 | #endif //__PRINT_RESULTS_H__ 10 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/EP/randdp.h: -------------------------------------------------------------------------------- 1 | #ifndef __RANDDP_H__ 2 | #define __RANDDP_H__ 3 | 4 | double randlc( double *x, double a ); 5 | void vranlc( int n, double *x, double a, double y[] ); 6 | 7 | #endif 8 | 9 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/EP/timers.h: -------------------------------------------------------------------------------- 1 | #ifndef __TIMERS_H__ 2 | #define __TIMERS_H__ 3 | 4 | void timer_clear( int n ); 5 | void timer_start( int n ); 6 | void timer_stop( int n ); 7 | double timer_read( int n ); 8 | unsigned timer_count( int n ); 9 | 10 | #endif 11 | 12 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/EP/type.h: -------------------------------------------------------------------------------- 1 | #ifndef __TYPE_H__ 2 | #define __TYPE_H__ 3 | 4 | typedef enum { false, true } logical; 5 | typedef struct { 6 | double real; 7 | double imag; 8 | } dcomplex; 9 | 10 | 11 | #define min(x,y) ((x) < (y) ? (x) : (y)) 12 | #define max(x,y) ((x) > (y) ? (x) : (y)) 13 | 14 | #endif //__TYPE_H__ 15 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/EP/wtime.c: -------------------------------------------------------------------------------- 1 | #include "wtime.h" 2 | #include 3 | #ifndef DOS 4 | #include 5 | #endif 6 | 7 | void wtime(double *t) 8 | { 9 | /* a generic timer */ 10 | static int sec = -1; 11 | struct timeval tv; 12 | gettimeofday(&tv, (void *)0); 13 | if (sec < 0) sec = tv.tv_sec; 14 | *t = (tv.tv_sec - sec) + 1.0e-6*tv.tv_usec; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/EP/wtime.h: -------------------------------------------------------------------------------- 1 | /* C/Fortran interface is different on different machines. 2 | * You may need to tweak this. 3 | */ 4 | 5 | 6 | #if defined(IBM) 7 | #define wtime wtime 8 | #elif defined(CRAY) 9 | #define wtime WTIME 10 | #else 11 | #define wtime wtime_ 12 | #endif 13 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/FT/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=/bin/sh 2 | BENCHMARK=ft 3 | BENCHMARKU=FT 4 | 5 | include ../config/make.def 6 | 7 | include ../sys/make.common 8 | 9 | OBJS = ft.o ${COMMON}/${RAND}.o ${COMMON}/print_results.o \ 10 | ${COMMON}/c_timers.o ${COMMON}/wtime.o 11 | 12 | ${PROGRAM}: config ${OBJS} 13 | ${CLINK} ${CLINKFLAGS} -o ${PROGRAM} ${OBJS} ${C_LIB} 14 | 15 | .c.o: 16 | ${CCOMPILE} $< 17 | 18 | ft.o: ft.c global.h npbparams.h 19 | 20 | clean: 21 | - rm -f *.o *~ mputil* 22 | - rm -f ft npbparams.h core 23 | - if [ -d rii_files ]; then rm -r rii_files; fi 24 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/FT/README: -------------------------------------------------------------------------------- 1 | This code implements the time integration of a three-dimensional 2 | partial differential equation using the Fast Fourier Transform. 3 | Some of the dimension statements are not F77 conforming and will 4 | not work using the g77 compiler. All dimension statements, 5 | however, are legal F90. -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/FT/inputft.data.sample: -------------------------------------------------------------------------------- 1 | 6 ! number of iterations 2 | 2 ! layout type. 0 = 0d, 1 = 1d, 2 = 2d 3 | 2 4 ! processor layout. 0d must be "1 1"; 1d must be "1 N" 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/IS/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=/bin/sh 2 | BENCHMARK=is 3 | BENCHMARKU=IS 4 | 5 | include ../config/make.def 6 | 7 | include ../sys/make.common 8 | 9 | OBJS = is.o \ 10 | ${COMMON}/c_print_results.o \ 11 | ${COMMON}/c_timers.o \ 12 | ${COMMON}/c_wtime.o 13 | 14 | 15 | ${PROGRAM}: config ${OBJS} 16 | ${CLINK} ${CLINKFLAGS} -o ${PROGRAM} ${OBJS} ${C_LIB} 17 | 18 | .c.o: 19 | ${CCOMPILE} $< 20 | 21 | is.o: is.c npbparams.h 22 | 23 | 24 | clean: 25 | - rm -f *.o *~ mputil* 26 | - rm -f npbparams.h core 27 | - if [ -d rii_files ]; then rm -r rii_files; fi 28 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/LU/inputlu.data.sample: -------------------------------------------------------------------------------- 1 | c 2 | c***controls printing of the progress of iterations: ipr inorm 3 | 1 250 4 | c 5 | c***the maximum no. of pseudo-time steps to be performed: nitmax 6 | 250 7 | c 8 | c***magnitude of the time step: dt 9 | 2.0e+00 10 | c 11 | c***relaxation factor for SSOR iterations: omega 12 | 1.2 13 | c 14 | c***tolerance levels for steady-state residuals: tolnwt(m),m=1,5 15 | 1.0e-08 1.0e-08 1.0e-08 1.0e-08 1.0e-08 16 | c 17 | c***number of grid points in xi and eta and zeta directions: nx ny nz 18 | 64 64 64 19 | c 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/MG/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=/bin/sh 2 | BENCHMARK=mg 3 | BENCHMARKU=MG 4 | 5 | include ../config/make.def 6 | 7 | include ../sys/make.common 8 | 9 | OBJS = mg.o \ 10 | ${COMMON}/print_results.o \ 11 | ${COMMON}/${RAND}.o \ 12 | ${COMMON}/c_timers.o \ 13 | ${COMMON}/wtime.o 14 | 15 | 16 | ${PROGRAM}: config ${OBJS} 17 | ${CLINK} ${CLINKFLAGS} -o ${PROGRAM} ${OBJS} ${C_LIB} 18 | 19 | .c.o: 20 | ${CCOMPILE} $< 21 | 22 | mg.o: mg.c globals.h npbparams.h 23 | 24 | clean: 25 | - rm -f *.o *~ 26 | - rm -f npbparams.h core 27 | - if [ -d rii_files ]; then rm -r rii_files; fi 28 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/MG/mg.input.sample: -------------------------------------------------------------------------------- 1 | 8 = top level 2 | 256 256 256 = nx ny nz 3 | 20 = nit 4 | 0 0 0 0 0 0 0 0 = debug_vec 5 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/SP/inputsp.data.sample: -------------------------------------------------------------------------------- 1 | 400 number of time steps 2 | 0.0015d0 dt for class A = 0.0015d0. class B = 0.001d0 class C = 0.00067d0 3 | 64 64 64 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/UA/README: -------------------------------------------------------------------------------- 1 | Note on the parallelization of transfer.f 2 | ----------------------------------------- 3 | 4 | The file contains three major loops that update sparsely overlapped 5 | mortar points. Parallelization of these loops requires atomic update 6 | of memory references by mortar points. The first implementation 7 | uses the ATOMIC directive to perform the job. However, in some systems 8 | where atomic update of memory references is not available, the ATOMIC 9 | directive could be implemented as a critical section, which would be 10 | very expensive. An alternative approach is to use locks to guard 11 | atomic updates. The second implementation scales reasonably well. 12 | However, the overhead associated with calling lock routines deep 13 | inside loop nests could be large. 14 | 15 | Two implementations: 16 | - transfer_au.f: use ATOMIC directive for atomic updates 17 | - transfer.f: use locks for atomic updates, as the default 18 | 19 | To use the first approach, one can either rename 'transfer_au.f' 20 | to 'transfer.f' before compilation or use the suboption "UPDATE" 21 | in make: 22 | 23 | % make CLASS= UPDATE=au 24 | 25 | where is one of [S,W,A,B,C,D]. 26 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/common/print_results.h: -------------------------------------------------------------------------------- 1 | #ifndef __PRINT_RESULTS_H__ 2 | #define __PRINT_RESULTS_H__ 3 | 4 | void print_results(char *name, char class, int n1, int n2, int n3, int niter, 5 | double t, double mops, char *optype, logical verified, char *npbversion, 6 | char *compiletime, char *cs1, char *cs2, char *cs3, char *cs4, char *cs5, 7 | char *cs6, char *cs7); 8 | 9 | #endif //__PRINT_RESULTS_H__ 10 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/common/randdp.h: -------------------------------------------------------------------------------- 1 | #ifndef __RANDDP_H__ 2 | #define __RANDDP_H__ 3 | 4 | double randlc( double *x, double a ); 5 | void vranlc( int n, double *x, double a, double y[] ); 6 | 7 | #endif 8 | 9 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/common/timers.h: -------------------------------------------------------------------------------- 1 | #ifndef __TIMERS_H__ 2 | #define __TIMERS_H__ 3 | 4 | void timer_clear( int n ); 5 | void timer_start( int n ); 6 | void timer_stop( int n ); 7 | double timer_read( int n ); 8 | unsigned timer_count( int n ); 9 | 10 | #endif 11 | 12 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/common/type.h: -------------------------------------------------------------------------------- 1 | #ifndef __TYPE_H__ 2 | #define __TYPE_H__ 3 | 4 | typedef enum { false, true } logical; 5 | typedef struct { 6 | double real; 7 | double imag; 8 | } dcomplex; 9 | 10 | 11 | #define min(x,y) ((x) < (y) ? (x) : (y)) 12 | #define max(x,y) ((x) > (y) ? (x) : (y)) 13 | 14 | #endif //__TYPE_H__ 15 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/common/wtime.c: -------------------------------------------------------------------------------- 1 | #include "wtime.h" 2 | #include 3 | #ifndef DOS 4 | #include 5 | #endif 6 | 7 | void wtime(double *t) 8 | { 9 | /* a generic timer */ 10 | static int sec = -1; 11 | struct timeval tv; 12 | gettimeofday(&tv, (void *)0); 13 | if (sec < 0) sec = tv.tv_sec; 14 | *t = (tv.tv_sec - sec) + 1.0e-6*tv.tv_usec; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/common/wtime.h: -------------------------------------------------------------------------------- 1 | /* C/Fortran interface is different on different machines. 2 | * You may need to tweak this. 3 | */ 4 | 5 | 6 | #if defined(IBM) 7 | #define wtime wtime 8 | #elif defined(CRAY) 9 | #define wtime WTIME 10 | #else 11 | #define wtime wtime_ 12 | #endif 13 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/config/NAS.samples/README: -------------------------------------------------------------------------------- 1 | This directory contains examples of make.def files that were used 2 | by the NPB team in testing the benchmarks on different platforms. 3 | They can be used as starting points for make.def files for your 4 | own platform, but you may need to taylor them for best performance 5 | on your installation. A clean template can be found in directory 6 | `config'. 7 | Some examples of suite.def files are also provided. -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/config/NAS.samples/suite.def.bt: -------------------------------------------------------------------------------- 1 | bt S 2 | bt W 3 | bt A 4 | bt B 5 | bt C 6 | bt D 7 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/config/NAS.samples/suite.def.cg: -------------------------------------------------------------------------------- 1 | cg S 2 | cg W 3 | cg A 4 | cg B 5 | cg C 6 | cg D 7 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/config/NAS.samples/suite.def.ep: -------------------------------------------------------------------------------- 1 | ep S 2 | ep W 3 | ep A 4 | ep B 5 | ep C 6 | ep D 7 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/config/NAS.samples/suite.def.ft: -------------------------------------------------------------------------------- 1 | ft S 2 | ft W 3 | ft A 4 | ft B 5 | ft C 6 | ft D 7 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/config/NAS.samples/suite.def.is: -------------------------------------------------------------------------------- 1 | is S 2 | is W 3 | is A 4 | is B 5 | is C 6 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/config/NAS.samples/suite.def.lu: -------------------------------------------------------------------------------- 1 | lu S 2 | lu W 3 | lu A 4 | lu B 5 | lu C 6 | lu D 7 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/config/NAS.samples/suite.def.mg: -------------------------------------------------------------------------------- 1 | mg S 2 | mg W 3 | mg A 4 | mg B 5 | mg C 6 | mg D 7 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/config/NAS.samples/suite.def.sp: -------------------------------------------------------------------------------- 1 | sp S 2 | sp W 3 | sp A 4 | sp B 5 | sp C 6 | sp D 7 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/config/suite.def: -------------------------------------------------------------------------------- 1 | # config/suite.def 2 | # This file is used to build several benchmarks with a single command. 3 | # Typing "make suite" in the main directory will build all the benchmarks 4 | # specified in this file. 5 | # Each line of this file contains a benchmark name, class. 6 | # The name is one of "cg", "is", "dc", "ep", mg", "ft", "sp", 7 | # "bt", "lu", and "ua". 8 | # The class is one of "S", "W", "A", "B", and "C" 9 | # (classes D and E are defined for a number of benchmarks, but they 10 | # are likely not practical to run in serial. See README.install). 11 | # No blank lines. 12 | # The following example builds serial sample sizes of all benchmarks. 13 | ep S 14 | ep W 15 | ep A 16 | ep B 17 | ep C 18 | 19 | is S 20 | is W 21 | is A 22 | is B 23 | is C 24 | 25 | cg S 26 | cg W 27 | cg A 28 | cg B 29 | cg C 30 | 31 | mg S 32 | mg W 33 | mg A 34 | mg B 35 | mg C 36 | 37 | ft S 38 | ft W 39 | ft A 40 | ft B 41 | ft C 42 | 43 | sp S 44 | sp W 45 | sp A 46 | sp B 47 | sp C 48 | 49 | bt S 50 | bt W 51 | bt A 52 | bt B 53 | bt C 54 | 55 | lu S 56 | lu W 57 | lu A 58 | lu B 59 | lu C 60 | 61 | dc S 62 | dc W 63 | dc A 64 | dc B 65 | dc C 66 | 67 | ua S 68 | ua W 69 | ua A 70 | ua B 71 | ua C 72 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/config/suite.def.template: -------------------------------------------------------------------------------- 1 | # config/suite.def 2 | # This file is used to build several benchmarks with a single command. 3 | # Typing "make suite" in the main directory will build all the benchmarks 4 | # specified in this file. 5 | # Each line of this file contains a benchmark name and the class. 6 | # The name is one of "cg", "is", "dc", "ep", mg", "ft", "sp", 7 | # "bt", "lu", and "ua". 8 | # The class is one of "S", "W", "A" through "E" 9 | # (except that no classes C,D,E for DC and no class E for IS and UA). 10 | # No blank lines. 11 | # The following example builds sample sizes of all benchmarks. 12 | ft S 13 | mg S 14 | sp S 15 | lu S 16 | bt S 17 | is S 18 | ep S 19 | cg S 20 | ua S 21 | dc S 22 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/sys/Makefile: -------------------------------------------------------------------------------- 1 | UCC = cc 2 | include ../config/make.def 3 | 4 | # Note that COMPILE is also defined in make.common and should 5 | # be the same. We can't include make.common because it has a lot 6 | # of other garbage. 7 | FCOMPILE = $(F77) -c $(F_INC) $(FFLAGS) 8 | 9 | all: setparams 10 | 11 | # setparams creates an npbparam.h file for each benchmark 12 | # configuration. npbparams.h also contains info about how a benchmark 13 | # was compiled and linked 14 | 15 | setparams: setparams.c ../config/make.def 16 | $(UCC) ${CONVERTFLAG} -o setparams setparams.c 17 | 18 | 19 | clean: 20 | -rm -f setparams setparams.h npbparams.h 21 | -rm -f *~ *.o 22 | 23 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/sys/README: -------------------------------------------------------------------------------- 1 | This directory contains utilities and files used by the 2 | build process. You should not need to change anything 3 | in this directory. 4 | 5 | Original Files 6 | -------------- 7 | setparams.c: 8 | Source for the setparams program. This program is used internally 9 | in the build process to create the file "npbparams.h" for each 10 | benchmark. npbparams.h contains Fortran or C parameters to build a 11 | benchmark for a specific class. The setparams program is never run 12 | directly by a user. Its invocation syntax is 13 | 14 | "setparams benchmark-name class". 15 | 16 | It examines the file "npbparams.h" in the current directory. If 17 | the specified parameters are the same as those in the npbparams.h 18 | file, nothing it changed. If the file does not exist or corresponds 19 | to a different class/number of nodes, it is (re)built. 20 | One of the more complicated things in npbparams.h is that it 21 | contains, in a Fortran string, the compiler flags used to build a 22 | benchmark, so that a benchmark can print out how it was compiled. 23 | 24 | make.common 25 | A makefile segment that is included in each individual benchmark 26 | program makefile. It sets up some standard macros (COMPILE, etc) 27 | and makes sure everything is configured correctly (npbparams.h) 28 | 29 | Makefile 30 | Builds setparams 31 | 32 | README 33 | This file. 34 | 35 | 36 | Created files 37 | ------------- 38 | 39 | setparams 40 | See descriptions above 41 | 42 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/sys/print_header: -------------------------------------------------------------------------------- 1 | echo ' ============================================' 2 | echo ' = NAS PARALLEL BENCHMARKS 3.3 =' 3 | echo ' = OpenMP Versions =' 4 | echo ' = C =' 5 | echo ' ============================================' 6 | echo '' 7 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/sys/print_instructions: -------------------------------------------------------------------------------- 1 | echo '' 2 | echo ' To make a NAS benchmark type ' 3 | echo '' 4 | echo ' make CLASS=' 5 | echo '' 6 | echo ' where is "bt", "cg", "ep", "ft", "is", "lu",' 7 | echo ' "mg", "sp", "ua", or "dc"' 8 | echo ' is "S", "W", "A", "B", "C" or "D"' 9 | echo '' 10 | echo ' To make a set of benchmarks, create the file config/suite.def' 11 | echo ' according to the instructions in config/suite.def.template and type' 12 | echo '' 13 | echo ' make suite' 14 | echo '' 15 | echo ' ***************************************************************' 16 | echo ' * Remember to edit the file config/make.def for site specific *' 17 | echo ' * information as described in the README file *' 18 | echo ' ***************************************************************' 19 | 20 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/sys/setparams: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenACCUserGroup/openacc-users-group/76f649b8e92ab2187a55e2bf130517ee09d71573/Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/sys/setparams -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/NPB-OMP-C/sys/suite.awk: -------------------------------------------------------------------------------- 1 | BEGIN { SMAKE = "make" } { 2 | if ($1 !~ /^#/ && NF > 1) { 3 | printf "cd `echo %s|tr '[a-z]' '[A-Z]'`; %s clean;", $1, SMAKE; 4 | printf "%s CLASS=%s", SMAKE, $2; 5 | if (NF > 2) { 6 | printf " VERSION=%s", $3; 7 | } 8 | printf "; cd ..\n"; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/BadCommandLine.h: -------------------------------------------------------------------------------- 1 | #ifndef BAD_COMMAND_LINE_H 2 | #define BAD_COMMAND_LINE_H 3 | 4 | #include 5 | 6 | // **************************************************************************** 7 | // Class: BadCommandLine 8 | // 9 | // Purpose: 10 | // Exception for command line parse errors 11 | // 12 | // Programmer: Phil Roth 13 | // Creation: October 28, 2009 14 | // 15 | // **************************************************************************** 16 | struct BadCommandLine : public std::exception 17 | { 18 | // NOTE: current OptionParser implementation prints problems rather 19 | // than leaving it for us to determine how to print, so we have nothing 20 | // else to do. 21 | virtual char const* what( void ) const throw() { return "invalid command line"; } 22 | }; 23 | 24 | #endif // BAD_COMMAND_LINE_H 25 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/CTimer.cpp: -------------------------------------------------------------------------------- 1 | #include "CTimer.h" 2 | #include "Timer.h" 3 | 4 | int 5 | Timer_Start() 6 | { 7 | return Timer::Start(); 8 | } 9 | 10 | double 11 | Timer_Stop(int h, const char *d) 12 | { 13 | return Timer::Stop(h,d); 14 | } 15 | 16 | void 17 | Timer_Insert(const char *d, double v) 18 | { 19 | Timer::Insert(d,v); 20 | } 21 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/CTimer.h: -------------------------------------------------------------------------------- 1 | #ifndef CTIMER_H 2 | #define CTIMER_H 3 | 4 | // **************************************************************************** 5 | // File: CTimer.h 6 | // 7 | // Purpose: 8 | // C versions to call the critical routines of the Timer class. 9 | // 10 | // Programmer: Jeremy Meredith 11 | // Creation: October 22, 2007 12 | // 13 | // **************************************************************************** 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | int Timer_Start(); 18 | double Timer_Stop(int, const char *); 19 | void Timer_Insert(const char *, double); 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/Graph.h: -------------------------------------------------------------------------------- 1 | #define MAX_LINE_LENGTH 500000 2 | 3 | class Graph 4 | { 5 | unsigned int num_verts; 6 | unsigned int num_edges; 7 | unsigned int adj_list_length; 8 | unsigned int *edge_offsets; 9 | unsigned int *edge_list; 10 | unsigned int *edge_costs; 11 | unsigned int max_degree; 12 | int graph_type; 13 | 14 | bool if_delete_arrays; 15 | 16 | void SetAllCosts(unsigned int c); 17 | public: 18 | Graph(); 19 | ~Graph(); 20 | void LoadMetisGraph(const char *filename); 21 | void SaveMetisGraph(const char *filename); 22 | unsigned int GetNumVertices(); 23 | unsigned int GetNumEdges(); 24 | unsigned int GetMaxDegree(); 25 | 26 | unsigned int *GetEdgeOffsets(); 27 | unsigned int *GetEdgeList(); 28 | unsigned int *GetEdgeCosts(); 29 | 30 | unsigned int **GetEdgeOffsetsPtr(); 31 | unsigned int **GetEdgeListPtr(); 32 | unsigned int **GetEdgeCostsPtr(); 33 | 34 | unsigned int *GetVertexLengths(unsigned int *cost,unsigned int source); 35 | int GetMetisGraphType(); 36 | unsigned int GetAdjacencyListLength(); 37 | void GenerateSimpleKWayGraph(unsigned int verts,unsigned int degree); 38 | }; 39 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/HostStencil.h: -------------------------------------------------------------------------------- 1 | #ifndef HOSTSTENCIL_H 2 | #define HOSTSTENCIL_H 3 | 4 | #include "Stencil.h" 5 | 6 | // **************************************************************************** 7 | // Class: HostStencil 8 | // 9 | // Purpose: 10 | // Stencils for hosts. 11 | // 12 | // Programmer: Phil Roth 13 | // Creation: October 28, 2009 14 | // 15 | // **************************************************************************** 16 | template 17 | class HostStencil : public Stencil 18 | { 19 | protected: 20 | virtual void DoPreIterationWork( Matrix2D& mtx, unsigned int iter ); 21 | 22 | public: 23 | HostStencil( T wCenter, 24 | T wCardinal, 25 | T wDiagonal ) 26 | : Stencil( wCenter, wCardinal, wDiagonal ) 27 | { 28 | // nothing else to do 29 | } 30 | 31 | virtual void operator()( Matrix2D&, unsigned int nIters ); 32 | }; 33 | 34 | #endif /* HOSTSTENCIL_H */ 35 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/HostStencilFactory.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "HostStencilFactory.h" 3 | #include "HostStencil.h" 4 | 5 | template 6 | Stencil* 7 | HostStencilFactory::BuildStencil( const OptionParser& options ) 8 | { 9 | // get options for base class 10 | T wCenter; 11 | T wCardinal; 12 | T wDiagonal; 13 | StencilFactory::ExtractOptions( options, wCenter, wCardinal, wDiagonal ); 14 | 15 | return new HostStencil( wCenter, wCardinal, wDiagonal ); 16 | } 17 | 18 | 19 | template 20 | void 21 | HostStencilFactory::CheckOptions( const OptionParser& options ) const 22 | { 23 | // let base class check its options 24 | StencilFactory::CheckOptions( options ); 25 | 26 | // nothing else to do - we add no options 27 | } 28 | 29 | 30 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/HostStencilFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef HOSTSTENCILFACTORY_H 2 | #define HOSTSTENCILFACTORY_H 3 | 4 | #include "StencilFactory.h" 5 | 6 | // **************************************************************************** 7 | // Class: HostStencilFactory 8 | // 9 | // Purpose: 10 | // Class to generate stencils for hosts. 11 | // 12 | // Programmer: Phil Roth 13 | // Creation: October 28, 2009 14 | // 15 | // **************************************************************************** 16 | template 17 | class HostStencilFactory: public StencilFactory 18 | { 19 | public: 20 | HostStencilFactory( void ) 21 | : StencilFactory( "HostStencil" ) 22 | { 23 | // nothing else to do 24 | } 25 | 26 | virtual Stencil* BuildStencil( const OptionParser& options ); 27 | virtual void CheckOptions( const OptionParser& options ) const; 28 | }; 29 | 30 | #endif // HOSTSTENCILFACTORY_H 31 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/InitializeMatrix2D.h: -------------------------------------------------------------------------------- 1 | #ifndef INITIALIZE_H 2 | #define INITIALIZE_H 3 | 4 | #include 5 | #include "Matrix2D.h" 6 | 7 | // **************************************************************************** 8 | // Class: Initialize 9 | // 10 | // Purpose: 11 | // Initialize 2D matrices. 12 | // 13 | // Programmer: Phil Roth 14 | // Creation: October 28, 2009 15 | // 16 | // **************************************************************************** 17 | template 18 | class Initialize : public std::unary_function&, void> 19 | { 20 | private: 21 | long seed; 22 | unsigned int haloWidth; // width of halo 23 | T haloVal; // value to use for halo 24 | int rowPeriod; // period for row values 25 | int colPeriod; // period for column values 26 | 27 | public: 28 | Initialize( long int _seed, 29 | unsigned int _halo = 1, 30 | T _haloVal = 0, 31 | int _rowPeriod = -1, 32 | int _colPeriod = -1 ) 33 | : seed( _seed ), 34 | haloWidth( _halo ), 35 | haloVal( _haloVal ), 36 | rowPeriod( _rowPeriod ), 37 | colPeriod( _colPeriod ) 38 | { 39 | // nothing else to do 40 | } 41 | 42 | void operator()( Matrix2D& mtx ); 43 | }; 44 | 45 | #endif // INITIALIZE_H 46 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/InvalidArgValue.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "InvalidArgValue.h" 3 | 4 | const char* InvalidArgValue::defMsg = "invalid argument value: no further details available"; 5 | 6 | 7 | InvalidArgValue::InvalidArgValue( const char* _msg ) 8 | : msg( NULL ) 9 | { 10 | if( _msg != NULL ) 11 | { 12 | try 13 | { 14 | msg = new char[strlen(_msg)]; 15 | strcpy( msg, _msg ); 16 | } 17 | catch(...) 18 | { 19 | // nothing else to do - just leave msg as NULL 20 | } 21 | } 22 | } 23 | 24 | InvalidArgValue::~InvalidArgValue( void ) throw () 25 | { 26 | delete[] msg; 27 | msg = NULL; 28 | } 29 | 30 | 31 | char const* 32 | InvalidArgValue::what( void ) const throw() 33 | { 34 | return "invalid argument value"; 35 | } 36 | 37 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/InvalidArgValue.h: -------------------------------------------------------------------------------- 1 | #ifndef INVALIDARGVALUE_H 2 | #define INVALIDARGVALUE_H 3 | 4 | #include 5 | 6 | // Exception for command line argument value errors 7 | class InvalidArgValue : public std::exception 8 | { 9 | private: 10 | static const char* defMsg; 11 | char* msg; 12 | 13 | public: 14 | InvalidArgValue( const char* _msg ); 15 | virtual ~InvalidArgValue( void ) throw(); 16 | virtual char const* what( void ) const throw(); 17 | 18 | const char* GetMessage( void ) const { return (msg != NULL) ? msg : defMsg; } 19 | }; 20 | 21 | #endif // INVALIDARGVALUE_H 22 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/Makefile.am: -------------------------------------------------------------------------------- 1 | include ${top_builddir}/config/common.mk 2 | include ${top_builddir}/config/targets.mk 3 | 4 | noinst_LIBRARIES = libSHOCCommon.a 5 | libSHOCCommon_a_SOURCES = CTimer.cpp \ 6 | ResultDatabase.cpp \ 7 | OptionParser.cpp \ 8 | Option.cpp \ 9 | Timer.cpp \ 10 | ProgressBar.cpp \ 11 | InvalidArgValue.cpp \ 12 | Matrix2DStatics.cpp 13 | 14 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/Matrix2DFileSupport.cpp: -------------------------------------------------------------------------------- 1 | #ifndef MATRIX2DFILESUPPORT_H 2 | #define MATRIX2DFILESUPPORT_H 3 | 4 | template 5 | std::string 6 | GetMatrixFileName( std::string baseName ) 7 | { 8 | // nothing to do - this should never be instantiated 9 | assert( false ); 10 | return ""; 11 | } 12 | 13 | template<> 14 | std::string 15 | GetMatrixFileName( std::string baseName ) 16 | { 17 | return baseName + "-sp.dat"; 18 | } 19 | 20 | template<> 21 | std::string 22 | GetMatrixFileName( std::string baseName ) 23 | { 24 | return baseName + "-dp.dat"; 25 | } 26 | 27 | 28 | template 29 | bool 30 | SaveMatrixToFile( const Matrix2D& m, std::string fileName ) 31 | { 32 | bool ok = true; 33 | 34 | std::ofstream ofs( fileName.c_str(), ios::out | ios::binary ); 35 | if( ofs.is_open() ) 36 | { 37 | ok = m.WriteTo( ofs ); 38 | ofs.close(); 39 | } 40 | else 41 | { 42 | std::cerr << "Unable to write matrix to file \'" << fileName << "\'" << std::endl; 43 | ok = false; 44 | } 45 | return ok; 46 | } 47 | 48 | 49 | template 50 | bool 51 | ReadMatrixFromFile( Matrix2D& m, std::string fileName ) 52 | { 53 | bool ok = true; 54 | 55 | std::ifstream ifs( fileName.c_str(), ios::in | ios::binary ); 56 | if( ifs.is_open() ) 57 | { 58 | ok = m.ReadFrom( ifs ); 59 | ifs.close(); 60 | } 61 | else 62 | { 63 | std::cerr << "Unable to read matrix from file \'" << fileName << "\'" << std::endl; 64 | ok = false; 65 | } 66 | return ok; 67 | } 68 | 69 | #endif // MATRIX2DFILESUPPORT_H 70 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/Matrix2DStatics.cpp: -------------------------------------------------------------------------------- 1 | #include "Matrix2D.h" 2 | 3 | template<> PMSMemMgr* Matrix2D::pmsmm = 0; 4 | template<> PMSMemMgr* Matrix2D::pmsmm = 0; 5 | 6 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/NodeIDList.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _NODE_ID_LIST_H 3 | #define _NODE_ID_LIST_H 4 | 5 | #include 6 | #include 7 | 8 | // **************************************************************************** 9 | // Type: NodeIDList 10 | // 11 | // Purpose: 12 | // Defines a list of strings for holding host name information 13 | // associated with a particular system configuration. 14 | // 15 | // Programmer: Gabriel Marin 16 | // Creation: August 25, 2009 17 | // 18 | // Modifications: 19 | // 20 | // **************************************************************************** 21 | 22 | namespace SHOC { 23 | const int MAGIC_KEY_NODE_ID_LIST = 0x1071badc; 24 | typedef std::list NodeIDList; 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/Option.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "Option.h" 3 | using namespace std; 4 | 5 | void Option::print() { 6 | 7 | cout << "Long Name: " << longName << endl; 8 | cout << "Short Name: " << shortLetter << endl; 9 | cout << "Default Value: " << defaultValue << endl; 10 | cout << "Actual Value: " << value << endl; 11 | cout << "Type: " << type << endl; 12 | cout << "helpText: " << helpText << endl; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/Option.h: -------------------------------------------------------------------------------- 1 | #ifndef OPTION_H 2 | #define OPTION_H 3 | 4 | #include 5 | 6 | using namespace std; 7 | 8 | enum OptionType {OPT_FLOAT, OPT_INT, OPT_STRING, OPT_BOOL, 9 | OPT_VECFLOAT, OPT_VECINT, OPT_VECSTRING}; 10 | 11 | // **************************************************************************** 12 | // Class: Option 13 | // 14 | // Purpose: 15 | // Encapsulation of a single option, to be used by an option parser. 16 | // 17 | // Programmer: Kyle Spafford 18 | // Creation: August 4, 2009 19 | // 20 | // **************************************************************************** 21 | class Option { 22 | 23 | public: 24 | 25 | string longName; 26 | char shortLetter; 27 | string defaultValue; 28 | string value; 29 | OptionType type; 30 | string helpText; 31 | 32 | void print(); 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/PMSMemMgr.h: -------------------------------------------------------------------------------- 1 | #ifndef PMSMEMMGR_H 2 | #define PMSMEMMGR_H 3 | 4 | template 5 | class PMSMemMgr 6 | { 7 | public: 8 | virtual T* AllocHostBuffer( size_t nItems ) = 0; 9 | virtual void ReleaseHostBuffer( T* buf ) = 0; 10 | }; 11 | 12 | 13 | template 14 | class DefaultPMSMemMgr : public PMSMemMgr 15 | { 16 | public: 17 | virtual T* AllocHostBuffer( size_t nItems ) 18 | { 19 | return new T[nItems]; 20 | } 21 | 22 | virtual void ReleaseHostBuffer( T* buf ) 23 | { 24 | delete[] buf; 25 | } 26 | }; 27 | 28 | #endif // PMSMEMMGR_H 29 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/ProgressBar.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "ProgressBar.h" 3 | 4 | // initialize static members of the ProgressBar class. 5 | const char ProgressBar::barDone[81] = "================================================================================"; 6 | 7 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/QTC/libdata.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIBDATA_H_ 2 | #define _LIBDATA_H_ 3 | #include 4 | 5 | float *generate_synthetic_data(float **rslt_mtrx, 6 | int **indr_mtrx, 7 | int *max_degree, 8 | float threshold, 9 | int N, 10 | bool useFullLayout); 11 | int read_BLAST_data(float **rslt_mtrx, 12 | int **indr_mtrx, 13 | int *max_degree, 14 | float threshold, 15 | const char *fname, 16 | int maxN, 17 | bool useFullLayout); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/QTC/qtc_common.h: -------------------------------------------------------------------------------- 1 | #ifndef _QTC_COMMON_H_ 2 | #define _QTC_COMMON_H_ 3 | 4 | #define GLOBAL_MEMORY 0x0 5 | #define TEXTUR_MEMORY 0x1 6 | #define COMPACT_STORAGE_MATRIX 0x00 7 | #define FULL_STORAGE_MATRIX 0x10 8 | 9 | #ifdef MIN 10 | # undef MIN 11 | #endif 12 | #define MIN(_X, _Y) ( ((_X) < (_Y)) ? (_X) : (_Y) ) 13 | 14 | #ifdef MAX 15 | # undef MAX 16 | #endif 17 | #define MAX(_X, _Y) ( ((_X) > (_Y)) ? (_X) : (_Y) ) 18 | 19 | #define INVALID_POINT_MARKER -42 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/SerialStencilUtil.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "SerialStencilUtil.h" 4 | #include "ValidateMatrix2D.h" 5 | 6 | 7 | template 8 | void 9 | SerialStencilValidater::ValidateResult( const Matrix2D& exp, 10 | const Matrix2D& data, 11 | double valErrThreshold, 12 | unsigned int nValErrsToPrint ) const 13 | { 14 | Validate val( valErrThreshold ); 15 | std::vector > validationErrors = val( exp, data ); 16 | std::ostringstream valResultStr; 17 | 18 | valResultStr << validationErrors.size() << " validation errors"; 19 | if( (validationErrors.size() > 0) && (nValErrsToPrint > 0) ) 20 | { 21 | this->PrintValidationErrors( valResultStr, validationErrors, nValErrsToPrint ); 22 | } 23 | std::cout << valResultStr.str() << std::endl; 24 | } 25 | 26 | 27 | 28 | // Modifications: 29 | // Jeremy Meredith, Wed Nov 10 14:20:47 EST 2010 30 | // Split timing reports into detailed and summary. For 31 | // serial code, we report all trial values. 32 | // 33 | void 34 | SerialStencilTimingReporter::ReportTimings( ResultDatabase& resultDB ) const 35 | { 36 | resultDB.DumpDetailed( std::cout ); 37 | } 38 | 39 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/SerialStencilUtil.h: -------------------------------------------------------------------------------- 1 | #ifndef STENCIL_UTILS_SERIAL_H 2 | #define STENCIL_UTILS_SERIAL_H 3 | 4 | #include "StencilUtil.h" 5 | 6 | 7 | // **************************************************************************** 8 | // Class: SerialStencilValidater 9 | // 10 | // Purpose: 11 | // Single-processor version of stencil validator. 12 | // 13 | // Programmer: Phil Roth 14 | // Creation: October 29, 2009 15 | // 16 | // **************************************************************************** 17 | template 18 | class SerialStencilValidater : public StencilValidater 19 | { 20 | public: 21 | virtual void ValidateResult( const Matrix2D& exp, 22 | const Matrix2D& data, 23 | double valErrThreshold, 24 | unsigned int nValErrsToPrint ) const; 25 | }; 26 | 27 | 28 | // **************************************************************************** 29 | // Class: SerialStencilTimingReporter 30 | // 31 | // Purpose: 32 | // Single-processor version of stencil timing reporter. 33 | // 34 | // Programmer: Phil Roth 35 | // Creation: October 29, 2009 36 | // 37 | // **************************************************************************** 38 | class SerialStencilTimingReporter : public StencilTimingReporter 39 | { 40 | public: 41 | virtual void ReportTimings( ResultDatabase& resultDB ) const; 42 | }; 43 | 44 | 45 | #endif // STENCIL_UTILS_SERIAL_H 46 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/SerializableObject.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SERIALIZABLE_OBJECT_H 3 | #define _SERIALIZABLE_OBJECT_H 4 | 5 | #include 6 | #include 7 | 8 | // **************************************************************************** 9 | // Class: SerializableObject 10 | // 11 | // Purpose: 12 | // Abstract class with two pure virtual methods for serializing and 13 | // unserializing an object to string. 14 | // 15 | // Notes: 16 | // All Devices, Platforms, Node Containers and Multi-Node Containers 17 | // that are sent over the network must implement this interface. 18 | // 19 | // Programmer: Gabriel Marin 20 | // Creation: August 21, 2009 21 | // 22 | // Modifications: 23 | // 24 | // **************************************************************************** 25 | class SerializableObject 26 | { 27 | public: 28 | SerializableObject() {} 29 | virtual void writeObject (std::ostringstream &oss) const = 0; 30 | virtual void readObject (std::istringstream &iss) = 0; 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/StencilFactory.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "StencilFactory.h" 3 | #include "InvalidArgValue.h" 4 | 5 | 6 | template 7 | void 8 | StencilFactory::CheckOptions( const OptionParser& options ) const 9 | { 10 | // number of iterations must be positive 11 | unsigned int nIters = (unsigned int)options.getOptionInt( "num-iters" ); 12 | if( nIters == 0 ) 13 | { 14 | throw InvalidArgValue( "number of iterations must be positive" ); 15 | } 16 | 17 | // no restrictions on weight values, just that we have them 18 | } 19 | 20 | template 21 | void 22 | StencilFactory::ExtractOptions( const OptionParser& options, 23 | T& wCenter, 24 | T& wCardinal, 25 | T& wDiagonal ) 26 | { 27 | wCenter = options.getOptionFloat( "weight-center" ); 28 | wCardinal = options.getOptionFloat( "weight-cardinal" ); 29 | wDiagonal = options.getOptionFloat( "weight-diagonal" ); 30 | } 31 | 32 | 33 | template 34 | std::vector 35 | StencilFactory::GetStandardProblemSize( int sizeClass ) 36 | { 37 | const int probSizes[4] = { 512, 1024, 2048, 4096 }; 38 | if (!(sizeClass >= 0 && sizeClass < 5)) 39 | { 40 | throw InvalidArgValue( "Size class must be between 1-4" ); 41 | } 42 | 43 | std::vector ret( 2, probSizes[sizeClass - 1] ); 44 | return ret; 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/StencilUtil.cpp: -------------------------------------------------------------------------------- 1 | #include "StencilUtil.h" 2 | 3 | 4 | template 5 | void 6 | StencilValidater::PrintValidationErrors( std::ostream& s, 7 | const std::vector >& validationErrors, 8 | unsigned int nValErrsToPrint ) const 9 | { 10 | unsigned int nErrorsPrinted = 0; 11 | for( typename std::vector >::const_iterator iter = validationErrors.begin(); 12 | iter != validationErrors.end(); 13 | iter++ ) 14 | { 15 | if( nErrorsPrinted <= nValErrsToPrint ) 16 | { 17 | s << "out[" << iter->i 18 | << "][" << iter->j 19 | << "]=" << iter->val 20 | << ", expected " << iter->exp 21 | << ", relErr " << iter->relErr 22 | << '\n'; 23 | } 24 | nErrorsPrinted++; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/StencilUtil.h: -------------------------------------------------------------------------------- 1 | #ifndef STENCIL_UTILS_H 2 | #define STENCIL_UTILS_H 3 | 4 | #include "Matrix2D.h" 5 | #include "ResultDatabase.h" 6 | #include "ValidateMatrix2D.h" 7 | 8 | 9 | // **************************************************************************** 10 | // Class: StencilValidater 11 | // 12 | // Purpose: 13 | // Validate results of stencil operations and print errors. 14 | // 15 | // Programmer: Phil Roth 16 | // Creation: October 29, 2009 17 | // 18 | // **************************************************************************** 19 | template 20 | class StencilValidater 21 | { 22 | protected: 23 | void PrintValidationErrors( std::ostream& s, 24 | const std::vector >& validationErrors, 25 | unsigned int nValErrsToPrint ) const; 26 | public: 27 | virtual void ValidateResult( const Matrix2D& exp, 28 | const Matrix2D& data, 29 | double valErrThreshold, 30 | unsigned int nValErrsToPrint ) const = 0; 31 | }; 32 | 33 | 34 | // **************************************************************************** 35 | // Class: StencilTimingReporter 36 | // 37 | // Purpose: 38 | // Report timing results of stencil operations. 39 | // 40 | // Programmer: Phil Roth 41 | // Creation: October 29, 2009 42 | // 43 | // **************************************************************************** 44 | class StencilTimingReporter 45 | { 46 | public: 47 | virtual void ReportTimings( ResultDatabase& resultDB ) const = 0; 48 | }; 49 | 50 | 51 | #endif // STENCIL_UTILS_H 52 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/ValidateMatrix2D.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "ValidateMatrix2D.h" 4 | 5 | 6 | template 7 | std::vector > 8 | Validate::operator()( const Matrix2D& s, const Matrix2D& t ) 9 | { 10 | std::vector > ret; 11 | 12 | // ensure matrices are same shape 13 | assert( (s.GetNumRows() == t.GetNumRows()) && (s.GetNumColumns() == t.GetNumColumns()) ); 14 | 15 | for( unsigned int i = 0; i < s.GetNumRows(); i++ ) 16 | { 17 | for( unsigned int j = 0; j < s.GetNumColumns(); j++ ) 18 | { 19 | T expVal = s.GetConstData()[i][j]; 20 | T actualVal = t.GetConstData()[i][j]; 21 | T delta = fabsf( actualVal - expVal ); 22 | T relError = (expVal != 0.0f) ? delta / expVal : 0.0f; 23 | 24 | if( relError > relErrThreshold ) 25 | { 26 | ret.push_back( ValidationErrorInfo( i, j, actualVal, expVal, relError ) ); 27 | } 28 | } 29 | } 30 | 31 | return ret; 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/libSHOCCommon.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenACCUserGroup/openacc-users-group/76f649b8e92ab2187a55e2bf130517ee09d71573/Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/common/libSHOCCommon.a -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/config/common.mk: -------------------------------------------------------------------------------- 1 | # === Basics === 2 | #CC = gcc 3 | #CXX = g++ 4 | #LD = g++ 5 | #AR = ar 6 | #RANLIB = ranlib 7 | 8 | # In CPPFLAGS, note src/common is from the SHOC source tree, so we must 9 | # use $(srcdir). In contrast, the files in config used in the build are 10 | # generated as part of the configuration, so we want to find them in the 11 | # build tree - hence we do not use $(srcdir) for that -I specification. 12 | #CPPFLAGS += -I$(top_srcdir)/src/common -I$(top_builddir)/config 13 | CPPFLAGS += -I$(top_srcdir)/src/common -I$(top_builddir)/config 14 | #CFLAGS += -g -O2 15 | #CXXFLAGS += -g -O2 16 | NVCXXFLAGS = -g -O2 17 | #ARFLAGS = rcv 18 | #LDFLAGS = -L$(top_builddir)/src/common 19 | LDFLAGS += -L$(top_builddir)/src/common 20 | LIBS = 21 | 22 | USE_MPI = no 23 | MPICXX = 24 | MPI_CPPFLAGS = -DPARALLEL 25 | 26 | OCL_CPPFLAGS = -I$(top_srcdir)/src/opencl/common 27 | OCL_LDFLAGS = -L$(top_builddir)/src/opencl/common 28 | OCL_LIBS = -lSHOCCommonOpenCL -lSHOCCommon -framework OpenCL 29 | 30 | NVCC = 31 | CUDA_CXX = 32 | CUDA_INC = -I -I$(top_srcdir)/src/cuda/common 33 | CUDA_LDFLAGS = -L$(top_builddir)/src/cuda/common 34 | CUDA_CPPFLAGS = -I$(top_srcdir)/src/cuda/common 35 | 36 | USE_CUDA = no 37 | ifeq ($(USE_CUDA),yes) 38 | CUDA_LIBS := -lSHOCCommon $(shell $(top_srcdir)/config/find_cuda_libs.sh ) 39 | else 40 | CUDA_LIBS = 41 | endif 42 | 43 | OPENACC_CPPFLAGS = -I$(top_srcdir)/src/openacc/common 44 | 45 | 46 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/config/common.mk.in: -------------------------------------------------------------------------------- 1 | # === Basics === 2 | #CC = @CC@ 3 | #CXX = @CXX@ 4 | #LD = @CXX@ 5 | #AR = @AR@ 6 | #RANLIB = @RANLIB@ 7 | 8 | # In CPPFLAGS, note src/common is from the SHOC source tree, so we must 9 | # use $(srcdir). In contrast, the files in config used in the build are 10 | # generated as part of the configuration, so we want to find them in the 11 | # build tree - hence we do not use $(srcdir) for that -I specification. 12 | #CPPFLAGS += -I$(top_srcdir)/src/common -I$(top_builddir)/config @CPPFLAGS@ 13 | CPPFLAGS += -I$(top_srcdir)/src/common -I$(top_builddir)/config 14 | #CFLAGS += @CFLAGS@ 15 | #CXXFLAGS += @CXXFLAGS@ 16 | NVCXXFLAGS = @NVCXXFLAGS@ 17 | #ARFLAGS = rcv 18 | #LDFLAGS = @LDFLAGS@ -L$(top_builddir)/src/common 19 | LDFLAGS += -L$(top_builddir)/src/common 20 | LIBS = @LIBS@ 21 | 22 | USE_MPI = @USE_MPI@ 23 | MPICXX = @MPICXX@ 24 | MPI_CPPFLAGS = -DPARALLEL 25 | 26 | OCL_CPPFLAGS = -I$(top_srcdir)/src/opencl/common 27 | OCL_LDFLAGS = -L$(top_builddir)/src/opencl/common 28 | OCL_LIBS = -lSHOCCommonOpenCL -lSHOCCommon @OPENCL_LIBS@ 29 | 30 | NVCC = @NVCC@ 31 | CUDA_CXX = @NVCC@ 32 | CUDA_INC = -I@CUDA_INCDIR@ -I$(top_srcdir)/src/cuda/common 33 | CUDA_LDFLAGS = -L$(top_builddir)/src/cuda/common 34 | CUDA_CPPFLAGS = @CUDA_CPPFLAGS@ -I$(top_srcdir)/src/cuda/common 35 | 36 | USE_CUDA = @USE_CUDA@ 37 | ifeq ($(USE_CUDA),yes) 38 | CUDA_LIBS := -lSHOCCommon $(shell $(top_srcdir)/config/find_cuda_libs.sh @NVCC@) 39 | else 40 | CUDA_LIBS = 41 | endif 42 | 43 | OPENACC_CPPFLAGS = -I$(top_srcdir)/src/openacc/common 44 | 45 | 46 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/config/conf-atlanta.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | OCL_ROOT=/opt/AMDAPP 4 | 5 | # A "good" set of optimization flags is compiler dependent. 6 | # These might be reasonable flags to start from. 7 | # 8 | # GNU 9 | OPTFLAGS="-g -O2" 10 | 11 | # Intel 12 | #OPTFLAGS="-g -xHOST -O3 -ip -no-prec-div" 13 | #export CXX=icpc 14 | #export CC=icc 15 | 16 | # PGI 17 | #OPTFLAGS="-g -fastsse" 18 | #export CXX=pgcpp 19 | #export CC=pgcc 20 | 21 | 22 | # do the actual configuration 23 | sh ./configure \ 24 | CPPFLAGS="-I$OCL_ROOT/include" \ 25 | CXXFLAGS="$OPTFLAGS" \ 26 | CFLAGS="$OPTFLAGS" \ 27 | LDFLAGS="$OPTFLAGS -L$OCL_ROOT/lib/x86_64" \ 28 | --without-cuda \ 29 | --disable-stability 30 | 31 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/config/conf-cation.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | sh ./configure \ 4 | CPPFLAGS="-I/opt/cuda-4.0/cuda/include" \ 5 | LDFLAGS="-L/opt/cuda-4.0/cuda/lib64" 6 | 7 | 8 | # other useful options 9 | # --disable-stability 10 | 11 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/config/conf-crossarm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Configure SHOC for cross-compilation using ARM cross compilers. 5 | # Gives an example of how to cross compile, should be adaptable to 6 | # other cross compilation targets. 7 | # 8 | # Assumes we are using CodeSourcery Lite ARM cross compilers. 9 | # Assumes cross-compilers, cross-linkers, etc. are in the PATH. 10 | # Assumes CodeSourcery sysroot is in /opt/libc. 11 | # 12 | # Assumes no CUDA support on target system. 13 | # 14 | # Since OpenCL is library based, you have to explicitly specify CPPFLAGS to 15 | # find the OpenCL headers. You may also need to specify LDFLAGS, depending on 16 | # whether the OpenCL libraries are installed in a location searched by 17 | # the linker such as /usr/lib. 18 | # 19 | # Does not (yet?) support MPI. 20 | # 21 | sh ./configure \ 22 | CPPFLAGS="-I$HOME/private/Projects/ARM/ARM-OpenCL-1.1/include" \ 23 | LDFLAGS="-L$HOME/private/Projects/ARM/ARM-OpenCL-1.1/lib -Wl,-rpath=/opt/libc/lib:/opt/libc/usr/lib -Wl,--dynamic-linker=/opt/libc/lib/ld-linux.so.3" \ 24 | --host=arm-none-linux-gnueabi \ 25 | --with-opencl \ 26 | --without-cuda \ 27 | --without-mpi 28 | 29 | 30 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/config/conf-ion.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # note: "ion" is an Ubuntu 12.04 system with gcc 4.6.x 3 | 4 | PATH="/usr/local/cuda42/cuda/bin:$PATH" 5 | 6 | ./configure \ 7 | CPPFLAGS="-I/usr/local/cuda42/cuda/include/" \ 8 | CUDA_CPPFLAGS="-DUSE_CLOCK_GETTIME -gencode=arch=compute_11,code=sm_11 -gencode=arch=compute_20,code=sm_20 -gencode=arch=compute_30,code=sm_30" 9 | 10 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/config/conf-keeneland.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # A "good" set of optimization flags is compiler dependent. 4 | # These might be reasonable flags to start from. 5 | # 6 | # GNU 7 | OPTFLAGS="-g -O2" 8 | 9 | # Intel 10 | #OPTFLAGS="-g -xHOST -O3 -ip -no-prec-div" 11 | #export CXX=icpc 12 | #export CC=icc 13 | 14 | # PGI 15 | #OPTFLAGS="-g -fastsse" 16 | #export CXX=pgcpp 17 | #export CC=pgcc 18 | 19 | 20 | sh ./configure \ 21 | CPPFLAGS="-I/sw/kfs/cuda/4.2/linux_binary/include" \ 22 | CUDA_CPPFLAGS="-gencode=arch=compute_20,code=sm_20 -gencode=arch=compute_20,code=compute_20" \ 23 | CXXFLAGS="$OPTFLAGS" \ 24 | CFLAGS="$OPTFLAGS" \ 25 | LDFLAGS="$OPTFLAGS" 26 | 27 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/config/conf-lens.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | 4 | CUDA_ROOT=/sw/analysis-x64/cuda/3.2/sl5.0_binary 5 | 6 | # do the actual configuration 7 | sh ./configure \ 8 | CPPFLAGS="-I$CUDA_ROOT/include" \ 9 | PATH"=$CUDA_ROOT/bin:$PATH" \ 10 | --disable-stability 11 | 12 | 13 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/config/conf-linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | 4 | # do the actual configuration 5 | # 6 | # the configure script looks for CUDA using the PATH, but since OpenCL 7 | # is library based, you have to explicitly specify CPPFLAGS to find 8 | # the OpenCL headers. You may also need to specify LDFLAGS, depending on 9 | # whether the OpenCL libraries are installed in a location searched by 10 | # the linker such as /usr/lib. 11 | # 12 | sh ./configure \ 13 | CPPFLAGS="-I/usr/local/cuda/include" 14 | 15 | 16 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/config/conf-llano.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | OCL_ROOT=/opt/AMDAPP 4 | 5 | # do the actual configuration 6 | sh ./configure \ 7 | CPPFLAGS="-I$OCL_ROOT/include" \ 8 | LDFLAGS="-L$OCL_ROOT/lib/x86_64" \ 9 | --without-cuda \ 10 | --disable-stability 11 | 12 | 13 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/config/conf-newark.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | 4 | # A "good" set of optimization flags is compiler dependent. 5 | # These might be reasonable flags to start from. 6 | # 7 | # GNU 8 | PATH="/opt/cuda/6.0/cuda/bin:$PATH" 9 | OPTFLAGS="-g -O2" 10 | 11 | # Intel 12 | #OPTFLAGS="-g -xHOST -O3 -ip -no-prec-div" 13 | #export CXX=icpc 14 | #export CC=icc 15 | 16 | # PGI 17 | #OPTFLAGS="-g -fastsse" 18 | #export CXX=pgcpp 19 | #export CC=pgcc 20 | 21 | CPPFLAGS="-I/opt/cuda/6.0/cuda/include/" \ 22 | CUDA_CPPFLAGS="-gencode=arch=compute_20,code=sm_20 -gencode=arch=compute_30,code=sm_30" \ 23 | sh ./configure \ 24 | CXXFLAGS="$OPTFLAGS" \ 25 | CFLAGS="$OPTFLAGS" \ 26 | LDFLAGS="$OPTFLAGS" 27 | 28 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/config/conf-titan.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Titan is a Cray XK7 with NVIDIA K20X (Kepler) GPUs, one per node. 4 | 5 | # In the following, we are building with the Cray compiler drivers (named 6 | # cc for C, CC for C++). These drivers know how to find CUDA and OpenCL, 7 | # as long as the CUDA module is loaded when we configure, and they also know 8 | # how to build MPI programs. 9 | # However, during configuration the autoconf script tries to run the 10 | # executables it builds and since we expect to be building on the login node, 11 | # some of the libraries the compiler driver links in are not available 12 | # for running the program. 13 | # Thus, we must trick configure into thinking we are cross compiling. The 14 | # --host flag is how we indicate we are cross compiling. 15 | 16 | # A typical build might look like: 17 | # $ module swap PrgEnv-pgi PrgEnv-gnu 18 | # $ module load craype-accel-nvidia35 19 | # $ sh ./config/conf-titan.sh 20 | # $ make 21 | 22 | # We explicitly pass MPICXX variable because the SHOC configure script 23 | # only tries more common MPI C++ compiler names like mpicxx. 24 | 25 | # We explicitly pass a value in the CUDA_CPPFLAGS environment variable 26 | # to limit the number of CUDA architectures the SHOC build will support. 27 | # We do this mainly to reduce the amount of time it takes to build SHOC, 28 | # though it has some beneficial effect on the final sizes of the executables 29 | # compared to the default. 30 | # 31 | 32 | 33 | CC=cc \ 34 | CXX=CC \ 35 | MPICXX=CC \ 36 | sh ./configure \ 37 | CUDA_CPPFLAGS="-gencode=arch=compute_35,code=sm_35" \ 38 | --host=x86_64-unknown-linux-gnu \ 39 | --with-opencl \ 40 | --with-cuda \ 41 | --with-mpi 42 | 43 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/config/conf-valhalla.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # note: "valhalla" is an Ubuntu 12.04 system with gcc 4.6.x 3 | 4 | which nvcc 5 | if (test $? -ne 0); then 6 | echo "Error: no nvcc found. Please set your path:" 7 | echo "export PATH=\"/usr/local/cuda-6.0/bin:\$PATH\"" 8 | echo "export LD_LIBRARY_PATH=\"/usr/local/cuda-6.0/lib64:\$PATH\"" 9 | exit 1 10 | fi 11 | 12 | ./configure \ 13 | CPPFLAGS="-I/usr/local/cuda-6.0/include/" \ 14 | CUDA_CPPFLAGS="-DUSE_CLOCK_GETTIME -gencode=arch=compute_50,code=sm_50" 15 | 16 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/config/config.mk: -------------------------------------------------------------------------------- 1 | include $(top_builddir)/config/common.mk 2 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/config/config.mk.in: -------------------------------------------------------------------------------- 1 | include $(top_builddir)/config/common.mk 2 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/config/dirtargets.mk: -------------------------------------------------------------------------------- 1 | all opencl cuda: 2 | @for dir in $(SUBDIRS); do ${MAKE} -C $$dir $@; done 3 | 4 | clean: 5 | @if test -n "$(SUBDIRS)"; then \ 6 | rev=""; for dir in $(SUBDIRS); do rev="$$dir $$rev"; done; \ 7 | for dir in $$rev; do ${MAKE} -C $$dir $@; done \ 8 | fi 9 | 10 | distclean: 11 | @if test -n "$(SUBDIRS)"; then \ 12 | rev=""; for dir in $(SUBDIRS); do rev="$$dir $$rev"; done; \ 13 | for dir in $$rev; do ${MAKE} -C $$dir $@; done \ 14 | fi 15 | ${RM} Makefile 16 | 17 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/config/dirtargets.mk.in: -------------------------------------------------------------------------------- 1 | all opencl cuda: 2 | @for dir in $(SUBDIRS); do ${MAKE} -C $$dir $@; done 3 | 4 | clean: 5 | @if test -n "$(SUBDIRS)"; then \ 6 | rev=""; for dir in $(SUBDIRS); do rev="$$dir $$rev"; done; \ 7 | for dir in $$rev; do ${MAKE} -C $$dir $@; done \ 8 | fi 9 | 10 | distclean: 11 | @if test -n "$(SUBDIRS)"; then \ 12 | rev=""; for dir in $(SUBDIRS); do rev="$$dir $$rev"; done; \ 13 | for dir in $$rev; do ${MAKE} -C $$dir $@; done \ 14 | fi 15 | ${RM} Makefile 16 | 17 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/config/stamp-h1: -------------------------------------------------------------------------------- 1 | timestamp for config/config.h 2 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/openacc/common/PMSMemMgmt.h: -------------------------------------------------------------------------------- 1 | #ifndef PMSMEMMGMT_H 2 | #define PMSMEMMGMT_H 3 | 4 | #include 5 | 6 | // Programming Model-Specific Memory Management 7 | // Some programming models for heterogeneous systems provide 8 | // memory management functions for allocating memory on the host 9 | // and on the device. These functions provide an abstract interface 10 | // to that programming-model-specific interface. 11 | 12 | template 13 | T* 14 | pmsAllocHostBuffer( size_t nItems ) 15 | { 16 | return new T[nItems]; 17 | } 18 | 19 | 20 | template 21 | void 22 | pmsFreeHostBuffer( T* buf ) 23 | { 24 | delete[] buf; 25 | } 26 | 27 | #endif // PMSMEMMGMT_H 28 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/openacc/level1/md/Makefile.acc: -------------------------------------------------------------------------------- 1 | SHELL=/bin/sh 2 | BENCHMARK=md 3 | PXM=acc 4 | 5 | include ../../../crpl_conf/make.def 6 | include ../../../crpl_conf/make.common 7 | 8 | # List the files that are .c or .cpp as .o 9 | OBJS = MD.o MDFuncs.o 10 | # a.o b.o c.o\ 11 | # d.o e.o f.o 12 | 13 | # base compilation rules 14 | ${PROGRAM}: #config 15 | ${MAKE} exec; 16 | 17 | exec: $(COMMON_OBJS) $(OBJS) 18 | ${CLINK} ${CLINKFLAGS} -o ${PROGRAM} ${OBJS} ${COMMON_OBJS} ${C_LIB} 19 | 20 | # c files rule 21 | .c.o: 22 | ${CCOMPILE} ${DEFINES} $< 23 | 24 | # c++ files rule 25 | .cpp.o: 26 | ${CCOMPILE} ${DEFINES} $< 27 | 28 | # List of rules per object (.o) 29 | MD.o: MD.cpp 30 | MDFuncs.o: MDFuncs.cpp 31 | #a.o: a.c some.h 32 | 33 | clean: 34 | - rm -f *.o *~ $(BINDIR)/$(BENCHMARK).$(PXM) ${OBJS} ${COMMON_OBJS} 35 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/openacc/level1/md/Makefile.omp: -------------------------------------------------------------------------------- 1 | SHELL=/bin/sh 2 | BENCHMARK=md 3 | PXM=omp 4 | 5 | include ../../../crpl_conf/make.def 6 | include ../../../crpl_conf/make.common 7 | 8 | # List the files that are .c or .cpp as .o 9 | OBJS = MD.o MDFuncs.o 10 | # a.o b.o c.o\ 11 | # d.o e.o f.o 12 | 13 | # base compilation rules 14 | ${PROGRAM}: #config 15 | ${MAKE} exec; 16 | 17 | exec: $(COMMON_OBJS) $(OBJS) 18 | ${CLINK} ${CLINKFLAGS} -o ${PROGRAM} ${OBJS} ${COMMON_OBJS} ${C_LIB} 19 | 20 | # c files rule 21 | .c.o: 22 | ${CCOMPILE} ${DEFINES} $< 23 | 24 | # c++ files rule 25 | .cpp.o: 26 | ${CCOMPILE} ${DEFINES} $< 27 | 28 | # List of rules per object (.o) 29 | MD.o: MD.cpp 30 | MDFuncs.o: MDFuncs.cpp 31 | #a.o: a.c some.h 32 | #b.o: exact_solution.c header.h npbparams.h 33 | 34 | clean: 35 | - rm -f *.o *~ $(BINDIR)/$(BENCHMARK).$(PXM) ${OBJS} ${COMMON_OBJS} 36 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/openacc/level1/md/constants.h: -------------------------------------------------------------------------------- 1 | #ifndef CONSTANTS_H__ 2 | #define CONSTANTS_H__ 3 | 4 | // Problem Constants 5 | static const float cutsq = 16.0f; // Square of cutoff distance 6 | static const int maxNeighbors = 128; // Max number of nearest neighbors 7 | static const double domainEdge = 20.0; // Edge length of the cubic domain 8 | static const float lj1 = 1.5; // LJ constants 9 | static const float lj2 = 2.0; 10 | static const float EPSILON = 0.1f; // Relative Error between CPU/GPU 11 | 12 | // Float vector types 13 | typedef struct { 14 | float x; 15 | float y; 16 | float z; 17 | } float3; 18 | 19 | typedef struct { 20 | float x; 21 | float y; 22 | float z; 23 | float w; 24 | } float4; 25 | 26 | typedef struct { 27 | double x; 28 | double y; 29 | double z; 30 | } double3; 31 | 32 | typedef struct { 33 | double x; 34 | double y; 35 | double z; 36 | double w; 37 | } double4; 38 | 39 | 40 | #endif // CONSTANTS_H__ 41 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/openacc/level1/reduction/Makefile.acc: -------------------------------------------------------------------------------- 1 | SHELL=/bin/sh 2 | BENCHMARK=reduction 3 | PXM=acc 4 | 5 | include ../../../crpl_conf/make.def 6 | include ../../../crpl_conf/make.common 7 | 8 | # List the files that are .c or .cpp as .o 9 | OBJS = Reduction.o \ 10 | ReduceFuncs.o 11 | # a.o b.o c.o\ 12 | # d.o e.o f.o 13 | 14 | # base compilation rules 15 | ${PROGRAM}: #config 16 | ${MAKE} exec; 17 | 18 | exec: $(COMMON_OBJS) $(OBJS) 19 | ${CLINK} ${CLINKFLAGS} -o ${PROGRAM} ${OBJS} ${COMMON_OBJS} ${C_LIB} 20 | 21 | # c files rule 22 | .c.o: 23 | ${CCOMPILE} ${DEFINES} $< 24 | 25 | # c++ files rule 26 | .cpp.o: 27 | ${CCOMPILE} ${DEFINES} $< 28 | 29 | # List of rules per object (.o) 30 | Reduction.o: Reduction.cpp 31 | ReduceFuncs.o: ReduceFuncs.cpp 32 | #a.o: a.c some.h 33 | #b.o: exact_solution.c header.h npbparams.h 34 | 35 | clean: 36 | - rm -f *.o *~ $(BINDIR)/$(BENCHMARK).$(PXM) ${OBJS} ${COMMON_OBJS} 37 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/openacc/level1/reduction/Makefile.omp: -------------------------------------------------------------------------------- 1 | SHELL=/bin/sh 2 | BENCHMARK=reduction 3 | PXM=omp 4 | 5 | include ../../../crpl_conf/make.def 6 | include ../../../crpl_conf/make.common 7 | 8 | # List the files that are .c or .cpp as .o 9 | OBJS = Reduction.o \ 10 | ReduceFuncs.o 11 | # a.o b.o c.o\ 12 | # d.o e.o f.o 13 | 14 | # base compilation rules 15 | ${PROGRAM}: #config 16 | ${MAKE} exec; 17 | 18 | exec: $(COMMON_OBJS) $(OBJS) 19 | ${CLINK} ${CLINKFLAGS} -o ${PROGRAM} ${OBJS} ${COMMON_OBJS} ${C_LIB} 20 | 21 | # c files rule 22 | .c.o: 23 | ${CCOMPILE} ${DEFINES} $< 24 | 25 | # c++ files rule 26 | .cpp.o: 27 | ${CCOMPILE} ${DEFINES} $< 28 | 29 | # List of rules per object (.o) 30 | Reduction.o: Reduction.cpp 31 | ReduceFuncs.o: ReduceFuncs.cpp 32 | #a.o: a.c some.h 33 | #b.o: exact_solution.c header.h npbparams.h 34 | 35 | clean: 36 | - rm -f *.o *~ $(BINDIR)/$(BENCHMARK).$(PXM) ${OBJS} ${COMMON_OBJS} 37 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/openacc/level1/stencil2d/CommonOpenACCStencilFactory.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "CommonOpenACCStencilFactory.h" 5 | #include "InvalidArgValue.h" 6 | 7 | 8 | 9 | 10 | template 11 | void 12 | CommonOpenACCStencilFactory::CheckOptions( const OptionParser& opts ) const 13 | { 14 | // let base class check its options first 15 | StencilFactory::CheckOptions( opts ); 16 | 17 | // check our options 18 | std::vector arrayDims = opts.getOptionVecInt( "customSize" ); 19 | assert( arrayDims.size() == 2 ); 20 | // If both of these are zero, we're using a non-custom size, skip this test 21 | if (arrayDims[0] == 0 && arrayDims[0] == 0) 22 | { 23 | return; 24 | } 25 | 26 | // TODO any other tests we need to do on the custom size? 27 | // this is unlike OpenCL and CUDA, where the local dimensions 28 | // must evenly divide the global dimensions 29 | } 30 | 31 | 32 | template 33 | void 34 | CommonOpenACCStencilFactory::ExtractOptions( const OptionParser& options, 35 | T& wCenter, 36 | T& wCardinal, 37 | T& wDiagonal ) 38 | { 39 | // let base class extract its options 40 | StencilFactory::ExtractOptions( options, wCenter, wCardinal, wDiagonal ); 41 | 42 | // nothing else to do, since we do not have local work group dimensions 43 | } 44 | 45 | 46 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/openacc/level1/stencil2d/CommonOpenACCStencilFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef COMMONOPENACCSTENCILFACTORY_H 2 | #define COMMONOPENACCSTENCILFACTORY_H 3 | 4 | #include "StencilFactory.h" 5 | 6 | // **************************************************************************** 7 | // Class: CommonOpenACCStencilFactory 8 | // 9 | // Purpose: 10 | // OpenACC implementation of the stencil factory. 11 | // 12 | // Programmer: Phil Roth 13 | // Creation: 2012-12-06 14 | // 15 | // **************************************************************************** 16 | template 17 | class CommonOpenACCStencilFactory : public StencilFactory 18 | { 19 | protected: 20 | void ExtractOptions( const OptionParser& options, 21 | T& wCenter, 22 | T& wCardinal, 23 | T& wDiagonal ); 24 | 25 | public: 26 | CommonOpenACCStencilFactory( std::string _sname ) 27 | : StencilFactory( _sname ) 28 | { 29 | // nothing else to do 30 | } 31 | 32 | virtual void CheckOptions( const OptionParser& options ) const; 33 | }; 34 | 35 | #endif // COMMONOPENACCSTENCILFACTORY_H 36 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/openacc/level1/stencil2d/MPIOpenACCStencil.h: -------------------------------------------------------------------------------- 1 | #ifndef MPIOPENACCSTENCIL_H 2 | #define MPIOPENACCSTENCIL_H 3 | 4 | #include 5 | #include 6 | #include "OpenACCStencil.h" 7 | #include "MPI2DGridProgram.h" 8 | 9 | 10 | // **************************************************************************** 11 | // Class: MPIOpenACCStencil 12 | // 13 | // Purpose: 14 | // MPI implementation of OpenACC stencil 15 | // 16 | // Programmer: Phil Roth 17 | // Creation: 2012-12-10 18 | // 19 | // **************************************************************************** 20 | template 21 | class MPIOpenACCStencil : public OpenACCStencil, public MPI2DGridProgram 22 | { 23 | private: 24 | std::ofstream ofs; 25 | bool dumpData; 26 | 27 | T* eData; 28 | T* wData; 29 | 30 | void DoPreIterBlockWork( Matrix2D& mtx ); 31 | 32 | static void PreIterBlockFuncCB( void* cbData ); 33 | 34 | public: 35 | MPIOpenACCStencil( T wCenter, 36 | T wCardinal, 37 | T wDiagonal, 38 | size_t _mpiGridRows, 39 | size_t _mpiGridCols, 40 | unsigned int _nItersPerHaloExchange, 41 | bool _dumpData = false ); 42 | virtual ~MPIOpenACCStencil( void ); 43 | 44 | virtual void operator()( Matrix2D&, unsigned int nIters ); 45 | }; 46 | 47 | #endif // MPIOPENACCSTENCIL_H 48 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/openacc/level1/stencil2d/MPIOpenACCStencilFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef MPIOPENACCSTENCILFACTORY_H 2 | #define MPIOPENACCSTENCILFACTORY_H 3 | 4 | #include "CommonOpenACCStencilFactory.h" 5 | 6 | // **************************************************************************** 7 | // Class: MPIOpenACCStencilFactory 8 | // 9 | // Purpose: 10 | // MPI implementation of the OpenACC stencil factory. 11 | // 12 | // Programmer: Phil Roth 13 | // Creation: December 10, 2012 14 | // 15 | // **************************************************************************** 16 | template 17 | class MPIOpenACCStencilFactory : public CommonOpenACCStencilFactory 18 | { 19 | public: 20 | MPIOpenACCStencilFactory( void ) 21 | : CommonOpenACCStencilFactory( "MPIOpenACCStencil" ) 22 | { 23 | // nothing else to do 24 | } 25 | 26 | virtual Stencil* BuildStencil( const OptionParser& options ); 27 | virtual void CheckOptions( const OptionParser& options ) const; 28 | }; 29 | 30 | #endif // MPIOPENACCSTENCILFACTORY_H 31 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/openacc/level1/stencil2d/Makefile.acc: -------------------------------------------------------------------------------- 1 | SHELL=/bin/sh 2 | BENCHMARK=stencil2d 3 | PXM=acc 4 | 5 | include ../../../crpl_conf/make.def 6 | include ../../../crpl_conf/make.common 7 | 8 | # List the files that are .c or .cpp as .o 9 | OBJS = Stencil2Dmain.o StencilFuncs.o 10 | # a.o b.o c.o\ 11 | # d.o e.o f.o 12 | 13 | # base compilation rules 14 | ${PROGRAM}: #config 15 | ${MAKE} exec; 16 | 17 | exec: $(COMMON_OBJS) $(OBJS) 18 | ${CLINK} ${CLINKFLAGS} -o ${PROGRAM} ${OBJS} ${COMMON_OBJS} ${C_LIB} 19 | 20 | # c files rule 21 | .c.o: 22 | ${CCOMPILE} ${DEFINES} $< 23 | 24 | # c++ files rule 25 | .cpp.o: 26 | ${CCOMPILE} ${DEFINES} $< 27 | 28 | # List of rules per object (.o) 29 | Stencil2Dmain.o: Stencil2Dmain.cpp 30 | StencilFuncs.o: StencilFuncs.cpp 31 | #a.o: a.c some.h 32 | #b.o: exact_solution.c header.h npbparams.h 33 | 34 | clean: 35 | - rm -f *.o *~ $(BINDIR)/$(BENCHMARK).$(PXM) ${OBJS} ${COMMON_OBJS} 36 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/openacc/level1/stencil2d/Makefile.omp: -------------------------------------------------------------------------------- 1 | SHELL=/bin/sh 2 | BENCHMARK=stencil2d 3 | PXM=omp 4 | 5 | include ../../../crpl_conf/make.def 6 | include ../../../crpl_conf/make.common 7 | 8 | # List the files that are .c or .cpp as .o 9 | OBJS = Stencil2Dmain.o StencilFuncs.o 10 | # a.o b.o c.o\ 11 | # d.o e.o f.o 12 | 13 | # base compilation rules 14 | ${PROGRAM}: #config 15 | ${MAKE} exec; 16 | 17 | exec: $(COMMON_OBJS) $(OBJS) 18 | ${CLINK} ${CLINKFLAGS} -o ${PROGRAM} ${OBJS} ${COMMON_OBJS} ${C_LIB} 19 | 20 | # c files rule 21 | .c.o: 22 | ${CCOMPILE} ${DEFINES} $< 23 | 24 | # c++ files rule 25 | .cpp.o: 26 | ${CCOMPILE} ${DEFINES} $< 27 | 28 | # List of rules per object (.o) 29 | Stencil2Dmain.o: Stencil2Dmain.cpp 30 | StencilFuncs.o: StencilFuncs.cpp 31 | #a.o: a.c some.h 32 | #b.o: exact_solution.c header.h npbparams.h 33 | 34 | clean: 35 | - rm -f *.o *~ $(BINDIR)/$(BENCHMARK).$(PXM) ${OBJS} ${COMMON_OBJS} 36 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/openacc/level1/stencil2d/OpenACCStencilFactory.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "OpenACCStencilFactory.h" 5 | #include "OpenACCStencil.h" 6 | 7 | 8 | 9 | template 10 | Stencil* 11 | OpenACCStencilFactory::BuildStencil( const OptionParser& options ) 12 | { 13 | // get options for base class 14 | T wCenter; 15 | T wCardinal; 16 | T wDiagonal; 17 | this->ExtractOptions( options, 18 | wCenter, 19 | wCardinal, 20 | wDiagonal ); 21 | 22 | // build the stencil object 23 | return new OpenACCStencil( wCenter, 24 | wCardinal, 25 | wDiagonal ); 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/SHOC/openacc/level1/stencil2d/OpenACCStencilFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENACCSTENCILFACTORY_H 2 | #define OPENACCSTENCILFACTORY_H 3 | 4 | #include "CommonOpenACCStencilFactory.h" 5 | 6 | template 7 | class OpenACCStencilFactory : public CommonOpenACCStencilFactory 8 | { 9 | public: 10 | OpenACCStencilFactory( void ) 11 | : CommonOpenACCStencilFactory( "OpenACCStencil" ) 12 | { 13 | // nothing else to do 14 | } 15 | 16 | virtual Stencil* BuildStencil( const OptionParser& options ); 17 | }; 18 | 19 | #endif // OPENACCSTENCILFACTORY_H 20 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/acc/BT.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/acc 5 | 6 | #compiler 7 | export PGI_ACC_TIME=1 8 | export CC=pgcc 9 | export ACCEL_INFO=pgaccelinfo 10 | export TA=tesla:cc35 11 | export EXTRA_CFLAGS="-tp penryn-64" 12 | export EXTRA_CLINKFLAGS="-tp penryn-64" 13 | #export TEST=-n 14 | 15 | #benchmark setup 16 | CLASSES=S W A B C D 17 | BENCHMARK_SUITE=nas_acc 18 | export BENCHMARK_NAME=BT 19 | export BENCHMARK_EXEC=bt 20 | export BENCHMARK_FOLDER=$PWD/../NAS/BT 21 | export DEFINES="-DCRPL_COMP=0" 22 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/acc/CG.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/acc 5 | 6 | #compiler 7 | export PGI_ACC_TIME=1 8 | export CC=pgcc 9 | export ACCEL_INFO=pgaccelinfo 10 | export TA=tesla:cc35 11 | export EXTRA_CFLAGS="-tp penryn-64" 12 | export EXTRA_CLINKFLAGS="-tp penryn-64" 13 | #export TEST=-n 14 | 15 | #benchmark setup 16 | CLASSES=S W A B C D 17 | BENCHMARK_SUITE=nas_acc 18 | export BENCHMARK_NAME=CG 19 | export BENCHMARK_EXEC=cg 20 | export BENCHMARK_FOLDER=$PWD/../NAS/CG 21 | export DEFINES="-DCRPL_COMP=0" 22 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/acc/EP.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/acc 5 | 6 | #compiler 7 | export PGI_ACC_TIME=1 8 | export CC=pgcc 9 | export ACCEL_INFO=pgaccelinfo 10 | export TA=tesla:cc35 11 | export EXTRA_CFLAGS="-tp penryn-64" 12 | export EXTRA_CLINKFLAGS="-tp penryn-64" 13 | #export TEST=-n 14 | 15 | #benchmark setup 16 | CLASSES=S W A B C D 17 | BENCHMARK_SUITE=nas_acc 18 | export BENCHMARK_NAME=EP 19 | export BENCHMARK_EXEC=ep 20 | export BENCHMARK_FOLDER=$PWD/../NAS/EP 21 | export DEFINES="-DCRPL_COMP=0" 22 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/acc/FT.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/acc 5 | 6 | #compiler 7 | export PGI_ACC_TIME=1 8 | export CC=pgcc 9 | export ACCEL_INFO=pgaccelinfo 10 | export TA=tesla:cc35,nofma 11 | export EXTRA_CFLAGS="-tp penryn-64" 12 | export EXTRA_CLINKFLAGS="-tp penryn-64" 13 | #export TEST=-n 14 | 15 | #benchmark setup 16 | CLASSES=S W A B C D 17 | BENCHMARK_SUITE=nas_acc 18 | export BENCHMARK_NAME=FT 19 | export BENCHMARK_EXEC=ft 20 | export BENCHMARK_FOLDER=$PWD/../NAS/FT 21 | export DEFINES="-DCRPL_COMP=0" 22 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/acc/LU.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/acc 5 | 6 | #compiler 7 | export PGI_ACC_TIME=1 8 | export CC=pgcc 9 | export ACCEL_INFO=pgaccelinfo 10 | export TA=tesla:cc35 11 | export EXTRA_CFLAGS="-tp penryn-64" 12 | export EXTRA_CLINKFLAGS="-tp penryn-64" 13 | #export TEST=-n 14 | 15 | #benchmark setup 16 | CLASSES=S W A B C D 17 | BENCHMARK_SUITE=nas_acc 18 | export BENCHMARK_NAME=LU 19 | export BENCHMARK_EXEC=lu 20 | export BENCHMARK_FOLDER=$PWD/../NAS/LU-HP 21 | export DEFINES="-DCRPL_COMP=0" 22 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/acc/MG.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/acc 5 | 6 | #compiler 7 | export PGI_ACC_TIME=1 8 | export CC=pgcc 9 | export ACCEL_INFO=pgaccelinfo 10 | export TA=tesla:cc35 11 | export EXTRA_CFLAGS="-tp penryn-64" 12 | export EXTRA_CLINKFLAGS="-tp penryn-64" 13 | #export TEST=-n 14 | 15 | #benchmark setup 16 | CLASSES=S W A B C D 17 | BENCHMARK_SUITE=nas_acc 18 | export BENCHMARK_NAME=MG 19 | export BENCHMARK_EXEC=mg 20 | export BENCHMARK_FOLDER=$PWD/../NAS/MG 21 | export DEFINES="-DCRPL_COMP=0" 22 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/acc/SP.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/acc 5 | 6 | #compiler 7 | export PGI_ACC_TIME=1 8 | export CC=pgcc 9 | export ACCEL_INFO=pgaccelinfo 10 | export TA=tesla:cc35 11 | export EXTRA_CFLAGS="-tp penryn-64" 12 | export EXTRA_CLINKFLAGS="-tp penryn-64" 13 | #export TEST=-n 14 | 15 | #benchmark setup 16 | CLASSES=S W A B C D 17 | BENCHMARK_SUITE=nas_acc 18 | export BENCHMARK_NAME=SP 19 | export BENCHMARK_EXEC=sp 20 | export BENCHMARK_FOLDER=$PWD/../NAS/SP 21 | export DEFINES="-DCRPL_COMP=0" 22 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/acc/md.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/acc 5 | 6 | #compiler 7 | export PGI_ACC_TIME=1 8 | export CC=pgc++ 9 | export ACCEL_INFO=pgaccelinfo 10 | export TA=tesla:cc35 11 | export EXTRA_CFLAGS="-tp penryn-64" 12 | export EXTRA_CLINKFLAGS="-tp penryn-64" 13 | #export TEST=-n 14 | 15 | #benchmark setup 16 | CLASSES=1 2 3 4 17 | BENCHMARK_SUITE=shoc 18 | export BENCHMARK_NAME=md 19 | export BENCHMARK_EXEC=md.acc 20 | export BENCHMARK_EXEC_ARGS="-d 0 -n 1 -r 1000" 21 | export PXM=acc 22 | export BENCHMARK_FOLDER=$PWD/../SHOC/openacc/level1/md 23 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/acc/reduction.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/acc 5 | 6 | #compiler 7 | export PGI_ACC_TIME=1 8 | export CC=pgc++ 9 | export ACCEL_INFO=pgaccelinfo 10 | export TA=tesla:cc35 11 | export EXTRA_CFLAGS="-tp penryn-64" 12 | export EXTRA_CLINKFLAGS="-tp penryn-64" 13 | #export TEST=-n 14 | 15 | #benchmark setup 16 | CLASSES=1 2 3 4 17 | BENCHMARK_SUITE=shoc 18 | export BENCHMARK_NAME=reduction 19 | export BENCHMARK_EXEC=reduction.acc 20 | export BENCHMARK_EXEC_ARGS="-d 0 -n 1 --iterations 10000" 21 | export PXM=acc 22 | export BENCHMARK_FOLDER=$PWD/../SHOC/openacc/level1/reduction 23 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/acc/stencil.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/acc 5 | 6 | #compiler 7 | export PGI_ACC_TIME=1 8 | export CC=pgc++ 9 | export ACCEL_INFO=pgaccelinfo 10 | export TA=tesla:cc35 11 | export EXTRA_CFLAGS="-tp penryn-64" 12 | export EXTRA_CLINKFLAGS="-tp penryn-64" 13 | #export TEST=-n 14 | 15 | #benchmark setup 16 | CLASSES=1 2 3 4 17 | BENCHMARK_SUITE=shoc 18 | export BENCHMARK_NAME=stencil2d 19 | export BENCHMARK_EXEC=stencil2d.acc 20 | export BENCHMARK_EXEC_ARGS="-d 0 -n 1" 21 | export PXM=acc 22 | export BENCHMARK_FOLDER=$PWD/../SHOC/openacc/level1/stencil2d 23 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/acc_multicore/BT.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/acc_multicore 5 | 6 | #compiler 7 | export PGI_ACC_TIME=1 8 | export CC=pgcc 9 | export ACCEL_INFO=pgaccelinfo 10 | export TA=multicore 11 | export EXTRA_CFLAGS="-tp penryn-64" 12 | export EXTRA_CLINKFLAGS="-tp penryn-64" 13 | #export TEST=-n 14 | 15 | #benchmark setup 16 | CLASSES=S W A B C D 17 | BENCHMARK_SUITE=nas_acc 18 | THREADS=1 4 8 16 20 19 | ENV_THREADS=ACC_NUM_CORES 20 | export BENCHMARK_NAME=BT 21 | export BENCHMARK_EXEC=bt 22 | export BENCHMARK_FOLDER=$PWD/../NAS/BT 23 | export DEFINES="-DCRPL_COMP=0" 24 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/acc_multicore/CG.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/acc_multicore 5 | 6 | #compiler 7 | export PGI_ACC_TIME=1 8 | export CC=pgcc 9 | export ACCEL_INFO=pgaccelinfo 10 | export TA=multicore 11 | export EXTRA_CFLAGS="-tp penryn-64" 12 | export EXTRA_CLINKFLAGS="-tp penryn-64" 13 | #export TEST=-n 14 | 15 | #benchmark setup 16 | CLASSES=S W A B C D 17 | BENCHMARK_SUITE=nas_acc 18 | THREADS=1 4 8 16 20 19 | ENV_THREADS=ACC_NUM_CORES 20 | export BENCHMARK_NAME=CG 21 | export BENCHMARK_EXEC=cg 22 | export BENCHMARK_FOLDER=$PWD/../NAS/CG 23 | export DEFINES="-DCRPL_COMP=0" 24 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/acc_multicore/EP.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/acc_multicore 5 | 6 | #compiler 7 | export PGI_ACC_TIME=1 8 | export CC=pgcc 9 | export ACCEL_INFO=pgaccelinfo 10 | export TA=multicore 11 | export EXTRA_CFLAGS="-tp penryn-64" 12 | export EXTRA_CLINKFLAGS="-tp penryn-64" 13 | #export TEST=-n 14 | 15 | #benchmark setup 16 | CLASSES=S W A B C D 17 | BENCHMARK_SUITE=nas_acc 18 | THREADS=1 4 8 16 20 19 | ENV_THREADS=ACC_NUM_CORES 20 | export BENCHMARK_NAME=EP 21 | export BENCHMARK_EXEC=ep 22 | export BENCHMARK_FOLDER=$PWD/../NAS/EP 23 | export DEFINES="-DCRPL_COMP=0" 24 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/acc_multicore/FT.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/acc_multicore 5 | 6 | #compiler 7 | export PGI_ACC_TIME=1 8 | export CC=pgcc 9 | export ACCEL_INFO=pgaccelinfo 10 | export TA=multicore 11 | export EXTRA_CFLAGS="-tp penryn-64" 12 | export EXTRA_CLINKFLAGS="-tp penryn-64" 13 | #export TEST=-n 14 | 15 | #benchmark setup 16 | CLASSES=S W A B C D 17 | BENCHMARK_SUITE=nas_acc 18 | THREADS=1 4 8 16 20 19 | ENV_THREADS=ACC_NUM_CORES 20 | export BENCHMARK_NAME=FT 21 | export BENCHMARK_EXEC=ft 22 | export BENCHMARK_FOLDER=$PWD/../NAS/FT 23 | export DEFINES="-DCRPL_COMP=0" 24 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/acc_multicore/LU.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/acc_multicore 5 | 6 | #compiler 7 | export PGI_ACC_TIME=1 8 | export CC=pgcc 9 | export ACCEL_INFO=pgaccelinfo 10 | export TA=multicore 11 | export EXTRA_CFLAGS="-tp penryn-64" 12 | export EXTRA_CLINKFLAGS="-tp penryn-64" 13 | #export TEST=-n 14 | 15 | #benchmark setup 16 | CLASSES=S W A B C D 17 | BENCHMARK_SUITE=nas_acc 18 | THREADS=1 4 8 16 20 19 | ENV_THREADS=ACC_NUM_CORES 20 | export BENCHMARK_NAME=LU 21 | export BENCHMARK_EXEC=lu 22 | export BENCHMARK_FOLDER=$PWD/../NAS/LU-HP 23 | export DEFINES="-DCRPL_COMP=0" 24 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/acc_multicore/MG.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/acc_multicore 5 | 6 | #compiler 7 | export PGI_ACC_TIME=1 8 | export CC=pgcc 9 | export ACCEL_INFO=pgaccelinfo 10 | export TA=multicore 11 | export EXTRA_CFLAGS="-tp penryn-64" 12 | export EXTRA_CLINKFLAGS="-tp penryn-64" 13 | #export TEST=-n 14 | 15 | #benchmark setup 16 | CLASSES=S W A B C D 17 | BENCHMARK_SUITE=nas_acc 18 | THREADS=1 4 8 16 20 19 | ENV_THREADS=ACC_NUM_CORES 20 | export BENCHMARK_NAME=MG 21 | export BENCHMARK_EXEC=mg 22 | export BENCHMARK_FOLDER=$PWD/../NAS/MG 23 | export DEFINES="-DCRPL_COMP=0" 24 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/acc_multicore/SP.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/acc_multicore 5 | 6 | #compiler 7 | export PGI_ACC_TIME=1 8 | export CC=pgcc 9 | export ACCEL_INFO=pgaccelinfo 10 | export TA=multicore 11 | export EXTRA_CFLAGS="-tp penryn-64" 12 | export EXTRA_CLINKFLAGS="-tp penryn-64" 13 | #export TEST=-n 14 | 15 | #benchmark setup 16 | CLASSES=S W A B C D 17 | BENCHMARK_SUITE=nas_acc 18 | THREADS=1 4 8 16 20 19 | ENV_THREADS=ACC_NUM_CORES 20 | export BENCHMARK_NAME=SP 21 | export BENCHMARK_EXEC=sp 22 | export BENCHMARK_FOLDER=$PWD/../NAS/SP 23 | export DEFINES="-DCRPL_COMP=0" 24 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/acc_multicore/md.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/acc_multicore 5 | 6 | #compiler 7 | export PGI_ACC_TIME=1 8 | export CC=pgc++ 9 | export ACCEL_INFO=pgaccelinfo 10 | export TA=multicore 11 | export EXTRA_CFLAGS="-tp penryn-64" 12 | export EXTRA_CLINKFLAGS="-tp penryn-64" 13 | #export TEST=-n 14 | 15 | #benchmark setup 16 | CLASSES=1 2 3 4 17 | BENCHMARK_SUITE=shoc 18 | THREADS=1 4 8 16 20 19 | ENV_THREADS=ACC_NUM_CORES 20 | export BENCHMARK_NAME=md 21 | export BENCHMARK_EXEC=md.acc 22 | export BENCHMARK_EXEC_ARGS="-d 0 -n 1 -r 1000" 23 | export PXM=acc 24 | export BENCHMARK_FOLDER=$PWD/../SHOC/openacc/level1/md 25 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/acc_multicore/reduction.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/acc_multicore 5 | 6 | #compiler 7 | export PGI_ACC_TIME=1 8 | export CC=pgc++ 9 | export ACCEL_INFO=pgaccelinfo 10 | export TA=multicore 11 | export EXTRA_CFLAGS="-tp penryn-64" 12 | export EXTRA_CLINKFLAGS="-tp penryn-64" 13 | #export TEST=-n 14 | 15 | #benchmark setup 16 | CLASSES=1 2 3 4 17 | BENCHMARK_SUITE=shoc 18 | THREADS=1 4 8 16 20 19 | ENV_THREADS=ACC_NUM_CORES 20 | export BENCHMARK_NAME=reduction 21 | export BENCHMARK_EXEC=reduction.acc 22 | export BENCHMARK_EXEC_ARGS="-d 0 -n 1 --iterations 10000" 23 | export PXM=acc 24 | export BENCHMARK_FOLDER=$PWD/../SHOC/openacc/level1/reduction 25 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/acc_multicore/stencil.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/acc_multicore 5 | 6 | #compiler 7 | export PGI_ACC_TIME=1 8 | export CC=pgc++ 9 | export ACCEL_INFO=pgaccelinfo 10 | export TA=multicore 11 | export EXTRA_CFLAGS="-tp penryn-64" 12 | export EXTRA_CLINKFLAGS="-tp penryn-64" 13 | #export TEST=-n 14 | 15 | #benchmark setup 16 | CLASSES=1 2 3 4 17 | BENCHMARK_SUITE=shoc 18 | THREADS=1 4 8 16 20 19 | ENV_THREADS=ACC_NUM_CORES 20 | export BENCHMARK_NAME=stencil2d 21 | export BENCHMARK_EXEC=stencil2d.acc 22 | export BENCHMARK_EXEC_ARGS="-d 0 -n 1" 23 | export PXM=acc 24 | export BENCHMARK_FOLDER=$PWD/../SHOC/openacc/level1/stencil2d 25 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/cuda/BT.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/cuda 5 | 6 | #compiler 7 | export ACCEL_INFO="" 8 | 9 | #benchmark setup 10 | CLASSES=S W A B C D 11 | BENCHMARK_SUITE=nas_cuda 12 | export BENCHMARK_NAME=BT 13 | export BENCHMARK_EXEC=bt 14 | export BENCHMARK_FOLDER=$PWD/../NPB-CUDA/BT 15 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/cuda/LU.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/cuda 5 | 6 | #compiler 7 | export ACCEL_INFO="" 8 | 9 | #benchmark setup 10 | CLASSES=S W A B C D 11 | BENCHMARK_SUITE=nas_cuda 12 | export BENCHMARK_NAME=LU 13 | export BENCHMARK_EXEC=lu 14 | export BENCHMARK_FOLDER=$PWD/../NPB-CUDA/LU 15 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/cuda/SP.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/cuda 5 | 6 | #compiler 7 | export ACCEL_INFO="" 8 | 9 | #benchmark setup 10 | CLASSES=S W A B C D 11 | BENCHMARK_SUITE=nas_cuda 12 | export BENCHMARK_NAME=SP 13 | export BENCHMARK_EXEC=sp 14 | export BENCHMARK_FOLDER=$PWD/../NPB-CUDA/SP 15 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/omp/BT.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/omp 5 | 6 | #compiler 7 | export CC=pgcc 8 | export ACCEL_INFO="" 9 | export EXTRA_CFLAGS="-tp penryn-64" 10 | export EXTRA_CLINKFLAGS="-tp penryn-64" 11 | #export TEST=-n 12 | 13 | #benchmark setup 14 | CLASSES=S W A B C D 15 | BENCHMARK_SUITE=nas_omp 16 | THREADS=1 4 8 16 20 17 | ENV_THREADS=OMP_NUM_THREADS 18 | export BENCHMARK_NAME=BT 19 | export BENCHMARK_EXEC=bt 20 | export BENCHMARK_FOLDER=$PWD/../NPB-OMP-C/BT 21 | export DEFINES="" 22 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/omp/CG.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/omp 5 | 6 | #compiler 7 | export CC=pgcc 8 | export ACCEL_INFO="" 9 | export EXTRA_CFLAGS="-tp penryn-64" 10 | export EXTRA_CLINKFLAGS="-tp penryn-64" 11 | #export TEST=-n 12 | 13 | #benchmark setup 14 | CLASSES=S W A B C D 15 | BENCHMARK_SUITE=nas_omp 16 | THREADS=1 4 8 16 20 17 | ENV_THREADS=OMP_NUM_THREADS 18 | export BENCHMARK_NAME=CG 19 | export BENCHMARK_EXEC=cg 20 | export BENCHMARK_FOLDER=$PWD/../NPB-OMP-C/CG 21 | export DEFINES="" 22 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/omp/EP.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/omp 5 | 6 | #compiler 7 | export CC=pgcc 8 | export ACCEL_INFO="" 9 | export EXTRA_CFLAGS="-tp penryn-64" 10 | export EXTRA_CLINKFLAGS="-tp penryn-64" 11 | #export TEST=-n 12 | 13 | #benchmark setup 14 | CLASSES=S W A B C D 15 | BENCHMARK_SUITE=nas_omp 16 | THREADS=1 4 8 16 20 17 | ENV_THREADS=OMP_NUM_THREADS 18 | export BENCHMARK_NAME=EP 19 | export BENCHMARK_EXEC=ep 20 | export BENCHMARK_FOLDER=$PWD/../NPB-OMP-C/EP 21 | export DEFINES="" 22 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/omp/FT.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/omp 5 | 6 | #compiler 7 | export CC=pgcc 8 | export ACCEL_INFO="" 9 | export EXTRA_CFLAGS="-tp penryn-64" 10 | export EXTRA_CLINKFLAGS="-tp penryn-64" 11 | #export TEST=-n 12 | 13 | #benchmark setup 14 | CLASSES=S W A B C D 15 | BENCHMARK_SUITE=nas_omp 16 | THREADS=1 4 8 16 20 17 | ENV_THREADS=OMP_NUM_THREADS 18 | export BENCHMARK_NAME=FT 19 | export BENCHMARK_EXEC=ft 20 | export BENCHMARK_FOLDER=$PWD/../NPB-OMP-C/FT 21 | export DEFINES="" 22 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/omp/LU.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/omp 5 | 6 | #compiler 7 | export CC=pgcc 8 | export ACCEL_INFO="" 9 | export EXTRA_CFLAGS="-tp penryn-64" 10 | export EXTRA_CLINKFLAGS="-tp penryn-64" 11 | #export TEST=-n 12 | 13 | #benchmark setup 14 | CLASSES=S W A B C D 15 | BENCHMARK_SUITE=nas_omp 16 | THREADS=1 4 8 16 20 17 | ENV_THREADS=OMP_NUM_THREADS 18 | export BENCHMARK_NAME=LU 19 | export BENCHMARK_EXEC=lu 20 | export BENCHMARK_FOLDER=$PWD/../NPB-OMP-C/LU 21 | export DEFINES="" 22 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/omp/MG.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/omp 5 | 6 | #compiler 7 | export CC=pgcc 8 | export ACCEL_INFO="" 9 | export EXTRA_CFLAGS="-tp penryn-64" 10 | export EXTRA_CLINKFLAGS="-tp penryn-64" 11 | #export TEST=-n 12 | 13 | #benchmark setup 14 | CLASSES=S W A B C D 15 | BENCHMARK_SUITE=nas_omp 16 | THREADS=1 4 8 16 20 17 | ENV_THREADS=OMP_NUM_THREADS 18 | export BENCHMARK_NAME=MG 19 | export BENCHMARK_EXEC=mg 20 | export BENCHMARK_FOLDER=$PWD/../NPB-OMP-C/MG 21 | export DEFINES="" 22 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/omp/SP.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/omp 5 | 6 | #compiler 7 | export CC=pgcc 8 | export ACCEL_INFO="" 9 | export EXTRA_CFLAGS="-tp penryn-64" 10 | export EXTRA_CLINKFLAGS="-tp penryn-64" 11 | #export TEST=-n 12 | 13 | #benchmark setup 14 | CLASSES=S W A B C D 15 | BENCHMARK_SUITE=nas_omp 16 | THREADS=1 4 8 16 20 17 | ENV_THREADS=OMP_NUM_THREADS 18 | export BENCHMARK_NAME=SP 19 | export BENCHMARK_EXEC=sp 20 | export BENCHMARK_FOLDER=$PWD/../NPB-OMP-C/SP 21 | export DEFINES="" 22 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/omp/md.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/omp 5 | 6 | #compiler 7 | export CC=pgc++ 8 | export ACCEL_INFO="" 9 | export EXTRA_CFLAGS="-tp penryn-64" 10 | export EXTRA_CLINKFLAGS="-tp penryn-64" 11 | #export TEST=-n 12 | 13 | #benchmark setup 14 | CLASSES=1 2 3 4 15 | BENCHMARK_SUITE=shoc 16 | THREADS=1 4 8 16 20 17 | ENV_THREADS=OMP_NUM_THREADS 18 | export BENCHMARK_NAME=md 19 | export BENCHMARK_EXEC=md.omp 20 | export BENCHMARK_EXEC_ARGS="-d 0 -n 1 -r 1000" 21 | export PXM=omp 22 | export BENCHMARK_FOLDER=$PWD/../SHOC/openacc/level1/md 23 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/omp/reduction.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/omp 5 | 6 | #compiler 7 | export CC=pgc++ 8 | export ACCEL_INFO="" 9 | export EXTRA_CFLAGS="-tp penryn-64" 10 | export EXTRA_CLINKFLAGS="-tp penryn-64" 11 | #export TEST=-n 12 | 13 | #benchmark setup 14 | CLASSES=1 2 3 4 15 | BENCHMARK_SUITE=shoc 16 | THREADS=1 4 8 16 20 17 | ENV_THREADS=OMP_NUM_THREADS 18 | export BENCHMARK_NAME=reduction 19 | export BENCHMARK_EXEC=reduction.omp 20 | export BENCHMARK_EXEC_ARGS="-d 0 -n 1 --iterations 10000" 21 | export PXM=omp 22 | export BENCHMARK_FOLDER=$PWD/../SHOC/openacc/level1/reduction 23 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/conf_files/omp/stencil.conf: -------------------------------------------------------------------------------- 1 | # modules 2 | 3 | #experiments folder 4 | export EXPERIMENTS_HOME=$PWD/results/omp 5 | 6 | #compiler 7 | export CC=pgc++ 8 | export ACCEL_INFO="" 9 | export EXTRA_CFLAGS="-tp penryn-64" 10 | export EXTRA_CLINKFLAGS="-tp penryn-64" 11 | #export TEST=-n 12 | 13 | #benchmark setup 14 | CLASSES=1 2 3 4 15 | BENCHMARK_SUITE=shoc 16 | THREADS=1 4 8 16 20 17 | ENV_THREADS=OMP_NUM_THREADS 18 | export BENCHMARK_NAME=stencil2d 19 | export BENCHMARK_EXEC=stencil2d.omp 20 | export BENCHMARK_EXEC_ARGS="-d 0 -n 1" 21 | export PXM=omp 22 | export BENCHMARK_FOLDER=$PWD/../SHOC/openacc/level1/stencil2d 23 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/create_app.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | USAGE="./create_app.sh . MACR0=-Dkey=val" 4 | 5 | if [ "$#" -lt "2" ]; then 6 | echo $USAGE 7 | exit -1 8 | fi 9 | 10 | CPP_PATH=$PWD/pcc-0.1.0 11 | 12 | FOLDER_ORG=$1 13 | FOLDER_TAR=$2 14 | 15 | ARGS_SET=("${@:3:$#}") 16 | echo Extra args: ${ARGS_SET[@]} 17 | 18 | echo Working with Orig_folder: $FOLDER_ORG and Target_folder: $FOLDER_TAR 19 | 20 | mkdir -p $FOLDER_TAR 21 | 22 | # processing .c files 23 | for file in `ls $FOLDER_ORG | grep '.c'`; do 24 | echo Processing $file 25 | python $CPP_PATH/cpp.py $FOLDER_ORG/$file $ARGS_SET 2&> $FOLDER_TAR/$file 26 | done 27 | 28 | # processing .h files 29 | for file in `ls $FOLDER_ORG | grep '.h'`; do 30 | echo Processing $file 31 | python $CPP_PATH/cpp.py $FOLDER_ORG/$file $ARGS_SET 2&> $FOLDER_TAR/$file 32 | done 33 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/NAS_SHOC_OpenACC_2.5/scripts/record_cpu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # author: sergiop@udel.edu 3 | 4 | if [ ! "$#" -eq "2" ]; then 5 | echo "./record_cpu.sh " 6 | exit -1 7 | fi 8 | 9 | APP=$1 10 | LOG=$2 11 | 12 | rm .cpu_test 13 | touch .cpu_test 14 | 15 | until [ "`cat .cpu_test | wc -l`" -gt "0" ]; do 16 | top -d 1 -n 5 -b | grep $APP >> $LOG 17 | done 18 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/#README.m#: -------------------------------------------------------------------------------- 1 | d -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/#README.md#: -------------------------------------------------------------------------------- 1 | PolyBench/ACC - OpenACC 2 | ======================= 3 | 4 | ##Contacts 5 | * Tristan Vanderbruggen (tristan@udel.edu) 6 | * William Killian (killian@udel.edu) 7 | 8 | ##Usage 9 | 10 | * Set environment variables PATH and LD_LIBRARY_PATH for RoseACC 11 | * Run *make* (it will only build the parallelized benchmarks) 12 | 13 | ##Status 14 | 15 | Benchmarks in bold have been parallelized. Benchmarks marked with [*] have reductions. 16 | 17 | ####datamining 18 | * correlation 19 | * covariance 20 | 21 | ####linear-algebra/kernels 22 | * **2mm** [*] 23 | * **3mm** [*] 24 | * **atax** [*] 25 | * **bicg** [*] 26 | * cholesky 27 | * doitgen 28 | * gemm 29 | * gemver 30 | * gesummv 31 | * mvt 32 | * symm 33 | * syr2k 34 | * syrk 35 | * trisolv 36 | * trmm 37 | 38 | ####linear-algebra/solvers 39 | * durbin 40 | * dynprog 41 | * gramschmidt 42 | * lu 43 | * ludcmp 44 | 45 | ####stencils 46 | * adi 47 | * convolution-2d 48 | * convolution-3d 49 | * fdtd-2d 50 | * jacobi-1d-imper 51 | * jacobi-2d-imper 52 | * seidel-2d 53 | 54 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/AUTHORS: -------------------------------------------------------------------------------- 1 | **Authors of PolyBench/GPU-OpenACC** 2 | 3 | William Killian 4 | * Who annotated all test files to include a subset of OpenACC Directives 5 | 6 | Scott Grauer-Gray 7 | * Who provided 2D- and 3D-convolution kernel code 8 | 9 | Louis-Noel Pouchet 10 | * Who provided packaging and harmonization of all test files, the PolyBench infrastructure and machinery, and several reference C files. 11 | 12 | Uday Bondugula 13 | * Who provided many of the original reference C files, including Fortran to C translation. 14 | 15 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | make -C datamining all 4 | make -C linear-algebra all 5 | make -C medley all 6 | make -C stencils all 7 | 8 | check: 9 | make -C datamining check 10 | make -C linear-algebra check 11 | make -C medley check 12 | make -C stencils check 13 | 14 | clean: 15 | make -C datamining clean 16 | make -C linear-algebra clean 17 | make -C medley clean 18 | make -C stencils clean 19 | 20 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/README: -------------------------------------------------------------------------------- 1 | PolyBench/GPU-OpenACC 1.0 2 | 3 | Copyright (c) 2013 the University of Delaware. 4 | Contact: William Killian 5 | 6 | Copyright (c) 2011-2012 the Ohio State University. 7 | Contact: Louis-Noel Pouchet 8 | 9 | ::linear-algebra:: 10 | linear-algebra/kernels: 11 | linear-algebra/kernels/2mm/2mm.c 12 | linear-algebra/kernels/3mm/3mm.c 13 | linear-algebra/kernels/atax/atax.c 14 | linear-algebra/kernels/bicg/bicg.c 15 | linear-algebra/kernels/cholesky/cholesky.c 16 | linear-algebra/kernels/doitgen/doitgen.c 17 | linear-algebra/kernels/gemm/gemm.c 18 | linear-algebra/kernels/gemver/gemver.c 19 | linear-algebra/kernels/gesummv/gesummv.c 20 | linear-algebra/kernels/mvt/mvt.c 21 | linear-algebra/kernels/symm/symm.c 22 | linear-algebra/kernels/syr2k/syr2k.c 23 | linear-algebra/kernels/syrk/syrk.c 24 | linear-algebra/kernels/trisolv/trisolv.c 25 | linear-algebra/kernels/trmm/trmm.c 26 | 27 | linear-algebra/solvers: 28 | linear-algebra/solvers/durbin/durbin.c 29 | linear-algebra/solvers/dynprog/dynprog.c 30 | linear-algebra/solvers/gramschmidt/gramschmidt.c 31 | linear-algebra/solvers/lu/lu.c 32 | linear-algebra/solvers/ludcmp/ludcmp.c 33 | 34 | ::datamining:: 35 | datamining/correlation/correlation.c 36 | datamining/covariance/covariance.c 37 | 38 | ::medley:: 39 | medley/floyd-warshall/floyd-warshall.c 40 | medley/reg_detect/reg_detect.c 41 | 42 | ::stencils:: 43 | stencils/adi/adi.c 44 | stencils/convolution-2d/convolution-2d.c 45 | stencils/convolution-3d/convolution-3d.c 46 | stencils/fdtd-2d/fdtd-2d.c 47 | stencils/fdtd-apml/fdtd-apml.c 48 | stencils/jacobi-1d-imper/jacobi-1d-imper.c 49 | stencils/jacobi-2d-imper/jacobi-2d-imper.c 50 | stencils/seidel-2d/seidel-2d.c 51 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/README.md: -------------------------------------------------------------------------------- 1 | PolyBench/ACC - OpenACC 2 | ======================= 3 | 4 | ##Contacts 5 | * Tristan Vanderbruggen (tristan@udel.edu) 6 | * William Killian (killian@udel.edu) 7 | 8 | ###OpenACC (RoseACC) 9 | 10 | 1. Set up `PATH` and `LD_LIBRARY_PATH` environment variables for RoseACC (see [RoseACC's Getting Started](https://github.com/tristanvdb/RoseACC-workspace)) 11 | 2. Run `make exe` in target folder(s) with codes to generate executable(s) 12 | 3. Run the generated executable file(s). 13 | 14 | ##Usage 15 | 16 | * Set environment variables PATH and LD_LIBRARY_PATH for RoseACC 17 | * Run *make* (it will only build the parallelized benchmarks) 18 | 19 | ##Status 20 | 21 | Benchmarks in bold have been parallelized. Benchmarks marked with [*] have reductions. 22 | 23 | ####datamining 24 | * correlation 25 | * covariance 26 | 27 | ####linear-algebra/kernels 28 | * **2mm** [*] 29 | * **3mm** [*] 30 | * **atax** [*] 31 | * **bicg** [*] 32 | * cholesky 33 | * doitgen 34 | * gemm 35 | * gemver 36 | * gesummv 37 | * mvt 38 | * symm 39 | * syr2k 40 | * syrk 41 | * trisolv 42 | * trmm 43 | 44 | ####linear-algebra/solvers 45 | * durbin 46 | * dynprog 47 | * gramschmidt 48 | * lu 49 | * ludcmp 50 | 51 | ####stencils 52 | * adi 53 | * convolution-2d 54 | * convolution-3d 55 | * fdtd-2d 56 | * jacobi-1d-imper 57 | * jacobi-2d-imper 58 | * seidel-2d 59 | 60 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/datamining/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | # make -C correlation all 4 | # make -C covariance all 5 | 6 | check: 7 | # make -C correlation check 8 | # make -C covariance check 9 | 10 | clean: 11 | # make -C correlation clean 12 | # make -C covariance clean 13 | 14 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/datamining/correlation/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../utilities/options.mk 2 | -include ../../utilities/c.mk -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/datamining/correlation/correlation.h: -------------------------------------------------------------------------------- 1 | /** 2 | * correlation.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef CORRELATION_H 9 | # define CORRELATION_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(N) && !defined(M) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define N 32 21 | # define M 32 22 | # endif 23 | 24 | # ifdef SMALL_DATASET 25 | # define N 500 26 | # define M 500 27 | # endif 28 | 29 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 30 | # define N 1000 31 | # define M 1000 32 | # endif 33 | 34 | # ifdef LARGE_DATASET 35 | # define N 2000 36 | # define M 2000 37 | # endif 38 | 39 | # ifdef EXTRALARGE_DATASET 40 | # define N 4000 41 | # define M 4000 42 | # endif 43 | # endif /* !N */ 44 | 45 | # define _PB_N POLYBENCH_LOOP_BOUND(N,n) 46 | # define _PB_M POLYBENCH_LOOP_BOUND(M,m) 47 | 48 | # ifndef DATA_TYPE 49 | # define DATA_TYPE float 50 | # define DATA_PRINTF_MODIFIER "%0.2lf " 51 | # endif 52 | 53 | 54 | #endif /* !CORRELATION_H */ 55 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/datamining/covariance/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../utilities/options.mk 2 | -include ../../utilities/c.mk -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/datamining/covariance/covariance.h: -------------------------------------------------------------------------------- 1 | /** 2 | * covariance.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef COVARIANCE_H 9 | # define COVARIANCE_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(N) && !defined(M) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define N 32 21 | # define M 32 22 | # endif 23 | 24 | # ifdef SMALL_DATASET 25 | # define N 500 26 | # define M 500 27 | # endif 28 | 29 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 30 | # define N 1000 31 | # define M 1000 32 | # endif 33 | 34 | # ifdef LARGE_DATASET 35 | # define N 2000 36 | # define M 2000 37 | # endif 38 | 39 | # ifdef EXTRALARGE_DATASET 40 | # define N 4000 41 | # define M 4000 42 | # endif 43 | # endif /* !N */ 44 | 45 | # define _PB_N POLYBENCH_LOOP_BOUND(N,n) 46 | # define _PB_M POLYBENCH_LOOP_BOUND(M,m) 47 | 48 | # ifndef DATA_TYPE 49 | # define DATA_TYPE double 50 | # define DATA_PRINTF_MODIFIER "%0.2lf " 51 | # endif 52 | 53 | 54 | #endif /* !COVARIANCE_H */ 55 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | make -C kernels all 4 | make -C solvers all 5 | 6 | check: 7 | make -C kernels check 8 | make -C solvers check 9 | 10 | clean: 11 | make -C kernels clean 12 | make -C solvers clean 13 | 14 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/2mm/.gitignore: -------------------------------------------------------------------------------- 1 | 2mm 2 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/2mm/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../../utilities/options.mk 2 | -include ../../../utilities/c2.mk 3 | 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/2mm/compiler.opts: -------------------------------------------------------------------------------- 1 | -DNI=1024 -DNJ=1024 -DNK=1024 -DNL=1024 2 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/3mm/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../../utilities/options.mk 2 | -include ../../../utilities/c2.mk 3 | 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/3mm/compiler.opts: -------------------------------------------------------------------------------- 1 | -DNI=1024 -DNJ=1024 -DNK=1024 -DNL=1024 -DNM=1024 2 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | make -C 2mm all 4 | make -C 3mm all 5 | make -C atax all 6 | make -C bicg all 7 | # make -C cholesky all 8 | # make -C doitgen all 9 | # make -C gemm all 10 | # make -C gemver all 11 | # make -C gesummv all 12 | # make -C mvt all 13 | # make -C symm all 14 | # make -C syr2k all 15 | # make -C syrk all 16 | # make -C trisolv all 17 | # make -C trmm all 18 | 19 | check: 20 | make -C 2mm check 21 | make -C 3mm check 22 | make -C atax check 23 | make -C bicg check 24 | # make -C cholesky check 25 | # make -C doitgen check 26 | # make -C gemm check 27 | # make -C gemver check 28 | # make -C gesummv check 29 | # make -C mvt check 30 | # make -C symm check 31 | # make -C syr2k check 32 | # make -C syrk check 33 | # make -C trisolv check 34 | # make -C trmm check 35 | 36 | clean: 37 | make -C 2mm clean 38 | make -C 3mm clean 39 | make -C atax clean 40 | make -C bicg clean 41 | # make -C cholesky clean 42 | # make -C doitgen clean 43 | # make -C gemm clean 44 | # make -C gemver clean 45 | # make -C gesummv clean 46 | # make -C mvt clean 47 | # make -C symm clean 48 | # make -C syr2k clean 49 | # make -C syrk clean 50 | # make -C trisolv clean 51 | # make -C trmm clean 52 | 53 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/atax/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../../utilities/options.mk 2 | -include ../../../utilities/c2.mk 3 | 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/atax/atax.h: -------------------------------------------------------------------------------- 1 | /** 2 | * atax.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef ATAX_H 9 | # define ATAX_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(NX) && !defined(NY) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define NX 32 21 | # define NY 32 22 | # endif 23 | 24 | # ifdef SMALL_DATASET 25 | # define NX 500 26 | # define NY 500 27 | # endif 28 | 29 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 30 | # define NX 4000 31 | # define NY 4000 32 | # endif 33 | 34 | # ifdef LARGE_DATASET 35 | # define NX 8000 36 | # define NY 8000 37 | # endif 38 | 39 | # ifdef EXTRALARGE_DATASET 40 | # define NX 100000 41 | # define NY 100000 42 | # endif 43 | # endif /* !N */ 44 | 45 | # define _PB_NX POLYBENCH_LOOP_BOUND(NX,nx) 46 | # define _PB_NY POLYBENCH_LOOP_BOUND(NY,ny) 47 | 48 | # ifndef DATA_TYPE 49 | # define DATA_TYPE double 50 | # define DATA_PRINTF_MODIFIER "%0.2lf " 51 | # endif 52 | 53 | 54 | #endif /* !ATAX */ 55 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/bicg/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../../utilities/options.mk 2 | -include ../../../utilities/c2.mk 3 | 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/bicg/bicg.h: -------------------------------------------------------------------------------- 1 | /** 2 | * bicg.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef BICG_H 9 | # define BICG_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(NX) && !defined(NY) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define NX 32 21 | # define NY 32 22 | # endif 23 | 24 | # ifdef SMALL_DATASET 25 | # define NX 500 26 | # define NY 500 27 | # endif 28 | 29 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 30 | # define NX 4000 31 | # define NY 4000 32 | # endif 33 | 34 | # ifdef LARGE_DATASET 35 | # define NX 8000 36 | # define NY 8000 37 | # endif 38 | 39 | # ifdef EXTRALARGE_DATASET 40 | # define NX 100000 41 | # define NY 100000 42 | # endif 43 | # endif /* !N */ 44 | 45 | # define _PB_NX POLYBENCH_LOOP_BOUND(NX,nx) 46 | # define _PB_NY POLYBENCH_LOOP_BOUND(NY,ny) 47 | 48 | # ifndef DATA_TYPE 49 | # define DATA_TYPE double 50 | # define DATA_PRINTF_MODIFIER "%0.2lf " 51 | # endif 52 | 53 | 54 | #endif /* !BICG */ 55 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/cholesky/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../../utilities/options.mk 2 | -include ../../../utilities/c2.mk 3 | 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/cholesky/cholesky.h: -------------------------------------------------------------------------------- 1 | /** 2 | * cholesky.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef CHOLESKY_H 9 | # define CHOLESKY_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(N) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define N 32 21 | # endif 22 | 23 | # ifdef SMALL_DATASET 24 | # define N 128 25 | # endif 26 | 27 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 28 | # define N 1024 29 | # endif 30 | 31 | # ifdef LARGE_DATASET 32 | # define N 2000 33 | # endif 34 | 35 | # ifdef EXTRALARGE_DATASET 36 | # define N 4000 37 | # endif 38 | # endif /* !N */ 39 | 40 | # define _PB_N POLYBENCH_LOOP_BOUND(N,n) 41 | 42 | # ifndef DATA_TYPE 43 | # define DATA_TYPE double 44 | # define DATA_PRINTF_MODIFIER "%0.2lf " 45 | # endif 46 | 47 | 48 | #endif /* !CHOLESKY */ 49 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/doitgen/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../../utilities/options.mk 2 | -include ../../../utilities/c2.mk 3 | 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/doitgen/doitgen.h: -------------------------------------------------------------------------------- 1 | /** 2 | * doitgen.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef DOITGEN_H 9 | # define DOITGEN_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(NQ) && !defined(NR) && !defined(NP) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define NQ 10 21 | # define NR 10 22 | # define NP 10 23 | # endif 24 | 25 | # ifdef SMALL_DATASET 26 | # define NQ 32 27 | # define NR 32 28 | # define NP 32 29 | # endif 30 | 31 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 32 | # define NQ 128 33 | # define NR 128 34 | # define NP 128 35 | # endif 36 | 37 | # ifdef LARGE_DATASET 38 | # define NQ 256 39 | # define NR 256 40 | # define NP 256 41 | # endif 42 | 43 | # ifdef EXTRALARGE_DATASET 44 | # define NQ 1000 45 | # define NR 1000 46 | # define NP 1000 47 | # endif 48 | # endif /* !N */ 49 | 50 | # define _PB_NQ POLYBENCH_LOOP_BOUND(NQ,nq) 51 | # define _PB_NR POLYBENCH_LOOP_BOUND(NR,nr) 52 | # define _PB_NP POLYBENCH_LOOP_BOUND(NP,np) 53 | 54 | # ifndef DATA_TYPE 55 | # define DATA_TYPE double 56 | # define DATA_PRINTF_MODIFIER "%0.2lf " 57 | # endif 58 | 59 | 60 | #endif /* !DOITGEN */ 61 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/gemm/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../../utilities/options.mk 2 | -include ../../../utilities/c2.mk 3 | 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/gemm/gemm.h: -------------------------------------------------------------------------------- 1 | /** 2 | * gemm.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef GEMM_H 9 | # define GEMM_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(NI) && !defined(NJ) && !defined(NK) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define NI 32 21 | # define NJ 32 22 | # define NK 32 23 | # endif 24 | 25 | # ifdef SMALL_DATASET 26 | # define NI 128 27 | # define NJ 128 28 | # define NK 128 29 | # endif 30 | 31 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 32 | # define NI 1024 33 | # define NJ 1024 34 | # define NK 1024 35 | # endif 36 | 37 | # ifdef LARGE_DATASET 38 | # define NI 2000 39 | # define NJ 2000 40 | # define NK 2000 41 | # endif 42 | 43 | # ifdef EXTRALARGE_DATASET 44 | # define NI 4000 45 | # define NJ 4000 46 | # define NK 4000 47 | # endif 48 | # endif /* !N */ 49 | 50 | # define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni) 51 | # define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj) 52 | # define _PB_NK POLYBENCH_LOOP_BOUND(NK,nk) 53 | 54 | # ifndef DATA_TYPE 55 | # define DATA_TYPE double 56 | # define DATA_PRINTF_MODIFIER "%0.2lf " 57 | # endif 58 | 59 | 60 | #endif /* !GEMM */ 61 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/gemver/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../../utilities/options.mk 2 | -include ../../../utilities/c2.mk 3 | 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/gemver/gemver.h: -------------------------------------------------------------------------------- 1 | /** 2 | * gemver.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef GEMVER_H 9 | # define GEMVER_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # ifndef N 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define N 32 21 | # endif 22 | 23 | # ifdef SMALL_DATASET 24 | # define N 500 25 | # endif 26 | 27 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 28 | # define N 4000 29 | # endif 30 | 31 | # ifdef LARGE_DATASET 32 | # define N 8000 33 | # endif 34 | 35 | # ifdef EXTRALARGE_DATASET 36 | # define N 100000 37 | # endif 38 | # endif /* !N */ 39 | 40 | # define _PB_N POLYBENCH_LOOP_BOUND(N,n) 41 | 42 | # ifndef DATA_TYPE 43 | # define DATA_TYPE double 44 | # define DATA_PRINTF_MODIFIER "%0.2lf " 45 | # endif 46 | 47 | 48 | #endif /* !GEMVER */ 49 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/gesummv/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../../utilities/options.mk 2 | -include ../../../utilities/c2.mk 3 | 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/gesummv/gesummv.h: -------------------------------------------------------------------------------- 1 | /** 2 | * gesummv.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef GESUMMV_H 9 | # define GESUMMV_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # ifndef N 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define N 32 21 | # endif 22 | 23 | # ifdef SMALL_DATASET 24 | # define N 500 25 | # endif 26 | 27 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 28 | # define N 4000 29 | # endif 30 | 31 | # ifdef LARGE_DATASET 32 | # define N 8000 33 | # endif 34 | 35 | # ifdef EXTRALARGE_DATASET 36 | # define N 100000 37 | # endif 38 | # endif /* !N */ 39 | 40 | # define _PB_N POLYBENCH_LOOP_BOUND(N,n) 41 | 42 | # ifndef DATA_TYPE 43 | # define DATA_TYPE double 44 | # define DATA_PRINTF_MODIFIER "%0.2lf " 45 | # endif 46 | 47 | 48 | #endif /* !GESUMMV */ 49 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/mvt/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../../utilities/options.mk 2 | -include ../../../utilities/c2.mk 3 | 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/mvt/mvt.h: -------------------------------------------------------------------------------- 1 | /** 2 | * mvt.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef MVT_H 9 | # define MVT_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # ifndef N 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define N 32 21 | # endif 22 | 23 | # ifdef SMALL_DATASET 24 | # define N 500 25 | # endif 26 | 27 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 28 | # define N 4000 29 | # endif 30 | 31 | # ifdef LARGE_DATASET 32 | # define N 8000 33 | # endif 34 | 35 | # ifdef EXTRALARGE_DATASET 36 | # define N 100000 37 | # endif 38 | # endif /* !N */ 39 | 40 | # define _PB_N POLYBENCH_LOOP_BOUND(N,n) 41 | 42 | # ifndef DATA_TYPE 43 | # define DATA_TYPE double 44 | # define DATA_PRINTF_MODIFIER "%0.2lf " 45 | # endif 46 | 47 | 48 | #endif /* !MVT */ 49 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/symm/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../../utilities/options.mk 2 | -include ../../../utilities/c2.mk 3 | 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/symm/symm.h: -------------------------------------------------------------------------------- 1 | /** 2 | * symm.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef SYMM_H 9 | # define SYMM_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(NI) && !defined(NJ) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define NI 32 21 | # define NJ 32 22 | # endif 23 | 24 | # ifdef SMALL_DATASET 25 | # define NI 128 26 | # define NJ 128 27 | # endif 28 | 29 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 30 | # define NI 1024 31 | # define NJ 1024 32 | # endif 33 | 34 | # ifdef LARGE_DATASET 35 | # define NI 2000 36 | # define NJ 2000 37 | # endif 38 | 39 | # ifdef EXTRALARGE_DATASET 40 | # define NI 4000 41 | # define NJ 4000 42 | # endif 43 | # endif /* !N */ 44 | 45 | # define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni) 46 | # define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj) 47 | 48 | # ifndef DATA_TYPE 49 | # define DATA_TYPE double 50 | # define DATA_PRINTF_MODIFIER "%0.2lf " 51 | # endif 52 | 53 | 54 | #endif /* !SYMM */ 55 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/syr2k/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../../utilities/options.mk 2 | -include ../../../utilities/c2.mk 3 | 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/syr2k/syr2k.h: -------------------------------------------------------------------------------- 1 | /** 2 | * syr2k.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef SYR2K_H 9 | # define SYR2K_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(NI) && !defined(NJ) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define NI 32 21 | # define NJ 32 22 | # endif 23 | 24 | # ifdef SMALL_DATASET 25 | # define NI 128 26 | # define NJ 128 27 | # endif 28 | 29 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 30 | # define NI 1024 31 | # define NJ 1024 32 | # endif 33 | 34 | # ifdef LARGE_DATASET 35 | # define NI 2000 36 | # define NJ 2000 37 | # endif 38 | 39 | # ifdef EXTRALARGE_DATASET 40 | # define NI 4000 41 | # define NJ 4000 42 | # endif 43 | # endif /* !N */ 44 | 45 | # define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni) 46 | # define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj) 47 | 48 | # ifndef DATA_TYPE 49 | # define DATA_TYPE double 50 | # define DATA_PRINTF_MODIFIER "%0.2lf " 51 | # endif 52 | 53 | 54 | #endif /* !SYR2K */ 55 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/syrk/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../../utilities/options.mk 2 | -include ../../../utilities/c2.mk 3 | 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/syrk/syrk.h: -------------------------------------------------------------------------------- 1 | /** 2 | * syrk.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef SYRK_H 9 | # define SYRK_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(NI) && !defined(NJ) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define NI 32 21 | # define NJ 32 22 | # endif 23 | 24 | # ifdef SMALL_DATASET 25 | # define NI 128 26 | # define NJ 128 27 | # endif 28 | 29 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 30 | # define NI 1024 31 | # define NJ 1024 32 | # endif 33 | 34 | # ifdef LARGE_DATASET 35 | # define NI 2000 36 | # define NJ 2000 37 | # endif 38 | 39 | # ifdef EXTRALARGE_DATASET 40 | # define NI 4000 41 | # define NJ 4000 42 | # endif 43 | # endif /* !N */ 44 | 45 | # define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni) 46 | # define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj) 47 | 48 | # ifndef DATA_TYPE 49 | # define DATA_TYPE double 50 | # define DATA_PRINTF_MODIFIER "%0.2lf " 51 | # endif 52 | 53 | 54 | #endif /* !SYRK */ 55 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/trisolv/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../../utilities/options.mk 2 | -include ../../../utilities/c2.mk 3 | 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/trisolv/trisolv.h: -------------------------------------------------------------------------------- 1 | /** 2 | * trisolv.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef TRISOLV_H 9 | # define TRISOLV_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # ifndef N 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define N 32 21 | # endif 22 | 23 | # ifdef SMALL_DATASET 24 | # define N 500 25 | # endif 26 | 27 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 28 | # define N 4000 29 | # endif 30 | 31 | # ifdef LARGE_DATASET 32 | # define N 8000 33 | # endif 34 | 35 | # ifdef EXTRALARGE_DATASET 36 | # define N 100000 37 | # endif 38 | # endif /* !N */ 39 | 40 | # define _PB_N POLYBENCH_LOOP_BOUND(N,n) 41 | 42 | # ifndef DATA_TYPE 43 | # define DATA_TYPE double 44 | # define DATA_PRINTF_MODIFIER "%0.2lf " 45 | # endif 46 | 47 | 48 | #endif /* !TRISOLV */ 49 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/trmm/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../../utilities/options.mk 2 | -include ../../../utilities/c2.mk 3 | 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/kernels/trmm/trmm.h: -------------------------------------------------------------------------------- 1 | /** 2 | * trmm.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef TRMM_H 9 | # define TRMM_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(NI) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define NI 32 21 | # endif 22 | 23 | # ifdef SMALL_DATASET 24 | # define NI 128 25 | # endif 26 | 27 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 28 | # define NI 1024 29 | # endif 30 | 31 | # ifdef LARGE_DATASET 32 | # define NI 2000 33 | # endif 34 | 35 | # ifdef EXTRALARGE_DATASET 36 | # define NI 4000 37 | # endif 38 | # endif /* !N */ 39 | 40 | # define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni) 41 | 42 | # ifndef DATA_TYPE 43 | # define DATA_TYPE double 44 | # define DATA_PRINTF_MODIFIER "%0.2lf " 45 | # endif 46 | 47 | 48 | #endif /* !TRMM */ 49 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/solvers/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | # make -C durbin all 4 | # make -C dynprog all 5 | # make -C gramschmidt all 6 | # make -C lu all 7 | # make -C ludcmp all 8 | 9 | check: 10 | # make -C durbin check 11 | # make -C dynprog check 12 | # make -C gramschmidt check 13 | # make -C lu check 14 | # make -C ludcmp check 15 | 16 | clean: 17 | # make -C durbin clean 18 | # make -C dynprog clean 19 | # make -C gramschmidt clean 20 | # make -C lu clean 21 | # make -C ludcmp clean 22 | 23 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/solvers/durbin/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../../utilities/options.mk 2 | -include ../../../utilities/c2.mk 3 | 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/solvers/durbin/durbin.h: -------------------------------------------------------------------------------- 1 | /** 2 | * durbin.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef DURBIN_H 9 | # define DURBIN_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # ifndef N 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define N 32 21 | # endif 22 | 23 | # ifdef SMALL_DATASET 24 | # define N 500 25 | # endif 26 | 27 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 28 | # define N 4000 29 | # endif 30 | 31 | # ifdef LARGE_DATASET 32 | # define N 8000 33 | # endif 34 | 35 | # ifdef EXTRALARGE_DATASET 36 | # define N 100000 37 | # endif 38 | # endif /* !N */ 39 | 40 | # define _PB_N POLYBENCH_LOOP_BOUND(N,n) 41 | 42 | # ifndef DATA_TYPE 43 | # define DATA_TYPE double 44 | # define DATA_PRINTF_MODIFIER "%0.2lf " 45 | # endif 46 | 47 | 48 | #endif /* !DURBIN */ 49 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/solvers/dynprog/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../../utilities/options.mk 2 | -include ../../../utilities/c2.mk 3 | 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/solvers/dynprog/dynprog.h: -------------------------------------------------------------------------------- 1 | /** 2 | * dynprog.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef DYNPROG_H 9 | # define DYNPROG_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(TSTEPS) && !defined(LENGTH) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define TSTEPS 10 21 | # define LENGTH 32 22 | # endif 23 | 24 | # ifdef SMALL_DATASET 25 | # define TSTEPS 100 26 | # define LENGTH 50 27 | # endif 28 | 29 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 30 | # define TSTEPS 10000 31 | # define LENGTH 50 32 | # endif 33 | 34 | # ifdef LARGE_DATASET 35 | # define TSTEPS 1000 36 | # define LENGTH 500 37 | # endif 38 | 39 | # ifdef EXTRALARGE_DATASET 40 | # define TSTEPS 10000 41 | # define LENGTH 500 42 | # endif 43 | # endif /* !N */ 44 | 45 | # define _PB_TSTEPS POLYBENCH_LOOP_BOUND(TSTEPS,tsteps) 46 | # define _PB_LENGTH POLYBENCH_LOOP_BOUND(LENGTH,length) 47 | 48 | # ifndef DATA_TYPE 49 | # define DATA_TYPE int 50 | # define DATA_PRINTF_MODIFIER "%d " 51 | # endif 52 | 53 | 54 | #endif /* !DYNPROG */ 55 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/solvers/gramschmidt/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../../utilities/options.mk 2 | -include ../../../utilities/c2.mk 3 | 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/solvers/gramschmidt/gramschmidt.h: -------------------------------------------------------------------------------- 1 | /** 2 | * gramschmidt.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef GRAMSCHMIDT_H 9 | # define GRAMSCHMIDT_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(NI) && !defined(NJ) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define NI 32 21 | # define NJ 32 22 | # endif 23 | 24 | # ifdef SMALL_DATASET 25 | # define NI 128 26 | # define NJ 128 27 | # endif 28 | 29 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 30 | # define NI 512 31 | # define NJ 512 32 | # endif 33 | 34 | # ifdef LARGE_DATASET 35 | # define NI 2000 36 | # define NJ 2000 37 | # endif 38 | 39 | # ifdef EXTRALARGE_DATASET 40 | # define NI 4000 41 | # define NJ 4000 42 | # endif 43 | # endif /* !N */ 44 | 45 | # define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni) 46 | # define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj) 47 | 48 | # ifndef DATA_TYPE 49 | # define DATA_TYPE double 50 | # define DATA_PRINTF_MODIFIER "%0.2lf " 51 | # endif 52 | 53 | 54 | #endif /* !GRAMSCHMIDT */ 55 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/solvers/lu/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../../utilities/options.mk 2 | -include ../../../utilities/c2.mk 3 | 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/solvers/lu/lu.h: -------------------------------------------------------------------------------- 1 | /** 2 | * lu.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef LU_H 9 | # define LU_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # ifndef N 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define N 32 21 | # endif 22 | 23 | # ifdef SMALL_DATASET 24 | # define N 128 25 | # endif 26 | 27 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 28 | # define N 1024 29 | # endif 30 | 31 | # ifdef LARGE_DATASET 32 | # define N 2000 33 | # endif 34 | 35 | # ifdef EXTRALARGE_DATASET 36 | # define N 4000 37 | # endif 38 | # endif /* !N */ 39 | 40 | # define _PB_N POLYBENCH_LOOP_BOUND(N,n) 41 | 42 | # ifndef DATA_TYPE 43 | # define DATA_TYPE double 44 | # define DATA_PRINTF_MODIFIER "%0.2lf " 45 | # endif 46 | 47 | 48 | #endif /* !LU */ 49 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/solvers/ludcmp/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../../utilities/options.mk 2 | -include ../../../utilities/c2.mk 3 | 4 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/linear-algebra/solvers/ludcmp/ludcmp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * ludcmp.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef LUDCMP_H 9 | # define LUDCMP_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # ifndef N 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define N 32 21 | # endif 22 | 23 | # ifdef SMALL_DATASET 24 | # define N 128 25 | # endif 26 | 27 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 28 | # define N 1024 29 | # endif 30 | 31 | # ifdef LARGE_DATASET 32 | # define N 2000 33 | # endif 34 | 35 | # ifdef EXTRALARGE_DATASET 36 | # define N 4000 37 | # endif 38 | # endif /* !N */ 39 | 40 | # define _PB_N POLYBENCH_LOOP_BOUND(N,n) 41 | 42 | # ifndef DATA_TYPE 43 | # define DATA_TYPE double 44 | # define DATA_PRINTF_MODIFIER "%0.2lf " 45 | # endif 46 | 47 | 48 | #endif /* !LUDCMP */ 49 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/medley/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | # make -C floyd-warshall all 4 | # make -C reg_detect all 5 | 6 | check: 7 | # make -C floyd-warshall check 8 | # make -C reg_detect check 9 | 10 | clean: 11 | # make -C floyd-warshall clean 12 | # make -C reg_detect clean 13 | 14 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/medley/floyd-warshall/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../utilities/options.mk 2 | -include ../../utilities/c.mk -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/medley/floyd-warshall/floyd-warshall.h: -------------------------------------------------------------------------------- 1 | /** 2 | * floyd-warshall.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef FLOYD_WARSHALL_H 9 | # define FLOYD_WARSHALL_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # ifndef N 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define N 32 21 | # endif 22 | 23 | # ifdef SMALL_DATASET 24 | # define N 128 25 | # endif 26 | 27 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 28 | # define N 1024 29 | # endif 30 | 31 | # ifdef LARGE_DATASET 32 | # define N 2000 33 | # endif 34 | 35 | # ifdef EXTRALARGE_DATASET 36 | # define N 4000 37 | # endif 38 | # endif /* !N */ 39 | 40 | # define _PB_N POLYBENCH_LOOP_BOUND(N,n) 41 | 42 | # ifndef DATA_TYPE 43 | # define DATA_TYPE double 44 | # define DATA_PRINTF_MODIFIER "%0.2lf " 45 | # endif 46 | 47 | 48 | #endif /* !FLOYD_WARSHALL */ 49 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/medley/reg_detect/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../utilities/options.mk 2 | -include ../../utilities/c.mk -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/medley/reg_detect/reg_detect.h: -------------------------------------------------------------------------------- 1 | /** 2 | * reg_detect.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef REG_DETECT_H 9 | # define REG_DETECT_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(NITER) && !defined(LENGTH) && !defined(MAXGRID) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define NITER 10 21 | # define LENGTH 32 22 | # define MAXGRID 2 23 | # endif 24 | 25 | # ifdef SMALL_DATASET 26 | # define NITER 100 27 | # define LENGTH 50 28 | # define MAXGRID 6 29 | # endif 30 | 31 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 32 | # define NITER 10000 33 | # define LENGTH 64 34 | # define MAXGRID 6 35 | # endif 36 | 37 | # ifdef LARGE_DATASET 38 | # define NITER 1000 39 | # define LENGTH 500 40 | # define MAXGRID 12 41 | # endif 42 | 43 | # ifdef EXTRALARGE_DATASET 44 | # define NITER 10000 45 | # define LENGTH 500 46 | # define MAXGRID 12 47 | # endif 48 | # endif /* !N */ 49 | 50 | # define _PB_NITER POLYBENCH_LOOP_BOUND(NITER,niter) 51 | # define _PB_LENGTH POLYBENCH_LOOP_BOUND(LENGTH,length) 52 | # define _PB_MAXGRID POLYBENCH_LOOP_BOUND(MAXGRID,maxgrid) 53 | 54 | # ifndef DATA_TYPE 55 | # define DATA_TYPE int 56 | # define DATA_PRINTF_MODIFIER "%d " 57 | # endif 58 | 59 | 60 | #endif /* !REG_DETECT */ 61 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/stencils/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | # make -C adi all 4 | # make -C convolution-2d all 5 | # make -C convolution-3d all 6 | # make -C fdtd-2d all 7 | # make -C fdtd-apml all 8 | # make -C jacobi-1d-imper all 9 | # make -C jacobi-2d-imper all 10 | # make -C seidel-2d all 11 | 12 | check: 13 | # make -C adi check 14 | # make -C convolution-2d check 15 | # make -C convolution-3d check 16 | # make -C fdtd-2d check 17 | # make -C fdtd-apml check 18 | # make -C jacobi-1d-imper check 19 | # make -C jacobi-2d-imper check 20 | # make -C seidel-2d check 21 | 22 | clean: 23 | # make -C adi clean 24 | # make -C convolution-2d clean 25 | # make -C convolution-3d clean 26 | # make -C fdtd-2d clean 27 | # make -C fdtd-apml clean 28 | # make -C jacobi-1d-imper clean 29 | # make -C jacobi-2d-imper clean 30 | # make -C seidel-2d clean 31 | 32 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/stencils/adi/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../utilities/options.mk 2 | -include ../../utilities/c.mk -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/stencils/adi/adi.h: -------------------------------------------------------------------------------- 1 | /** 2 | * adi.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef ADI_H 9 | # define ADI_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(TSTEPS) && ! defined(N) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define TSTEPS 2 21 | # define N 32 22 | # endif 23 | 24 | # ifdef SMALL_DATASET 25 | # define TSTEPS 10 26 | # define N 500 27 | # endif 28 | 29 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 30 | # define TSTEPS 50 31 | # define N 1024 32 | # endif 33 | 34 | # ifdef LARGE_DATASET 35 | # define TSTEPS 50 36 | # define N 2000 37 | # endif 38 | 39 | # ifdef EXTRALARGE_DATASET 40 | # define TSTEPS 100 41 | # define N 4000 42 | # endif 43 | # endif /* !N */ 44 | 45 | # define _PB_TSTEPS POLYBENCH_LOOP_BOUND(TSTEPS,tsteps) 46 | # define _PB_N POLYBENCH_LOOP_BOUND(N,n) 47 | 48 | # ifndef DATA_TYPE 49 | # define DATA_TYPE double 50 | # define DATA_PRINTF_MODIFIER "%0.2lf " 51 | # endif 52 | 53 | 54 | #endif /* !ADI */ 55 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/stencils/convolution-2d/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../utilities/options.mk 2 | -include ../../utilities/c.mk -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/stencils/convolution-2d/convolution-2d.h: -------------------------------------------------------------------------------- 1 | /** 2 | * adi.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef CONV2D_H 9 | #define CONV2D_H 10 | 11 | /* Default to LARGE_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define LARGE_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(NI) && ! defined(NJ) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define NI 64 21 | # define NJ 64 22 | # endif 23 | 24 | # ifdef SMALL_DATASET 25 | # define NI 1024 26 | # define NJ 1024 27 | # endif 28 | 29 | # ifdef STANDARD_DATASET 30 | # define NI 2048 31 | # define NJ 2048 32 | # endif 33 | 34 | # ifdef LARGE_DATASET /* Default if unspecified. */ 35 | # define NI 4096 36 | # define NJ 4096 37 | # endif 38 | 39 | # ifdef EXTRALARGE_DATASET 40 | # define NI 8192 41 | # define NJ 8192 42 | # endif 43 | # endif /* !N */ 44 | 45 | # define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni) 46 | # define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj) 47 | 48 | # ifndef DATA_TYPE 49 | # define DATA_TYPE float 50 | # define DATA_PRINTF_MODIFIER "%0.2lf " 51 | # endif 52 | 53 | 54 | #endif /* !CONV2D */ 55 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/stencils/convolution-3d/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../utilities/options.mk 2 | -include ../../utilities/c.mk -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/stencils/convolution-3d/convolution-3d.h: -------------------------------------------------------------------------------- 1 | /** 2 | * adi.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef CONV3D_H 9 | #define CONV3D_H 10 | 11 | /* Default to LARGE_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define LARGE_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(NI) && ! defined(NJ) && ! defined(NK) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define NI 64 21 | # define NJ 64 22 | # define NK 64 23 | # endif 24 | 25 | # ifdef SMALL_DATASET 26 | # define NI 128 27 | # define NJ 128 28 | # define NK 128 29 | # endif 30 | 31 | # ifdef STANDARD_DATASET 32 | # define NI 192 33 | # define NJ 192 34 | # define NK 192 35 | # endif 36 | 37 | # ifdef LARGE_DATASET /* Default if unspecified. */ 38 | # define NI 256 39 | # define NJ 256 40 | # define NK 256 41 | # endif 42 | 43 | # ifdef EXTRALARGE_DATASET 44 | # define NI 384 45 | # define NJ 384 46 | # define NK 384 47 | # endif 48 | # endif /* !N */ 49 | 50 | # define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni) 51 | # define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj) 52 | # define _PB_NK POLYBENCH_LOOP_BOUND(NK,nk) 53 | 54 | # ifndef DATA_TYPE 55 | # define DATA_TYPE float 56 | # define DATA_PRINTF_MODIFIER "%0.2lf " 57 | # endif 58 | 59 | 60 | #endif /* !CONV3D */ 61 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/stencils/fdtd-2d/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../utilities/options.mk 2 | -include ../../utilities/c.mk -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/stencils/fdtd-2d/fdtd-2d.h: -------------------------------------------------------------------------------- 1 | /** 2 | * fdtd-2d.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef FDTD_2D_H 9 | # define FDTD_2D_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(NX) && ! defined(NY) && !defined(TMAX) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define TMAX 2 21 | # define NX 32 22 | # define NY 32 23 | # endif 24 | 25 | # ifdef SMALL_DATASET 26 | # define TMAX 10 27 | # define NX 500 28 | # define NY 500 29 | # endif 30 | 31 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 32 | # define TMAX 50 33 | # define NX 1000 34 | # define NY 1000 35 | # endif 36 | 37 | # ifdef LARGE_DATASET 38 | # define TMAX 50 39 | # define NX 2000 40 | # define NY 2000 41 | # endif 42 | 43 | # ifdef EXTRALARGE_DATASET 44 | # define TMAX 100 45 | # define NX 4000 46 | # define NY 4000 47 | # endif 48 | # endif /* !N */ 49 | 50 | # define _PB_TMAX POLYBENCH_LOOP_BOUND(TMAX,tmax) 51 | # define _PB_NX POLYBENCH_LOOP_BOUND(NX,nx) 52 | # define _PB_NY POLYBENCH_LOOP_BOUND(NY,ny) 53 | 54 | # ifndef DATA_TYPE 55 | # define DATA_TYPE double 56 | # define DATA_PRINTF_MODIFIER "%0.2lf " 57 | # endif 58 | 59 | 60 | #endif /* !FDTD_2D */ 61 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/stencils/fdtd-apml/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../utilities/options.mk 2 | -include ../../utilities/c.mk -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/stencils/fdtd-apml/fdtd-apml.h: -------------------------------------------------------------------------------- 1 | /** 2 | * fdtd-apml.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef FDTD_APML_H 9 | # define FDTD_AMPL_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(CZ) && ! defined(CYM) && !defined(CXM) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define CZ 32 21 | # define CYM 32 22 | # define CXM 32 23 | # endif 24 | 25 | # ifdef SMALL_DATASET 26 | # define CZ 64 27 | # define CYM 64 28 | # define CXM 64 29 | # endif 30 | 31 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 32 | # define CZ 256 33 | # define CYM 256 34 | # define CXM 256 35 | # endif 36 | 37 | # ifdef LARGE_DATASET 38 | # define CZ 512 39 | # define CYM 512 40 | # define CXM 512 41 | # endif 42 | 43 | # ifdef EXTRALARGE_DATASET 44 | # define CZ 1000 45 | # define CYM 1000 46 | # define CXM 1000 47 | # endif 48 | # endif /* !N */ 49 | 50 | # define _PB_CZ POLYBENCH_LOOP_BOUND(CZ,cz) 51 | # define _PB_CYM POLYBENCH_LOOP_BOUND(CYM,cym) 52 | # define _PB_CXM POLYBENCH_LOOP_BOUND(CXM,cxm) 53 | 54 | # ifndef DATA_TYPE 55 | # define DATA_TYPE double 56 | # define DATA_PRINTF_MODIFIER "%0.2lf " 57 | # endif 58 | 59 | 60 | #endif /* !FDTD_APML */ 61 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/stencils/jacobi-1d-imper/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../utilities/options.mk 2 | -include ../../utilities/c.mk -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/stencils/jacobi-1d-imper/jacobi-1d-imper.h: -------------------------------------------------------------------------------- 1 | /** 2 | * jacobi-1d-imper.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef JACOBI_1D_IMPER_H 9 | # define JACOBI_1D_IMPER_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(TSTEPS) && ! defined(N) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define TSTEPS 2 21 | # define N 500 22 | # endif 23 | 24 | # ifdef SMALL_DATASET 25 | # define TSTEPS 10 26 | # define N 1000 27 | # endif 28 | 29 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 30 | # define TSTEPS 100 31 | # define N 10000 32 | # endif 33 | 34 | # ifdef LARGE_DATASET 35 | # define TSTEPS 1000 36 | # define N 100000 37 | # endif 38 | 39 | # ifdef EXTRALARGE_DATASET 40 | # define TSTEPS 1000 41 | # define N 1000000 42 | # endif 43 | # endif /* !N */ 44 | 45 | # define _PB_TSTEPS POLYBENCH_LOOP_BOUND(TSTEPS,tsteps) 46 | # define _PB_N POLYBENCH_LOOP_BOUND(N,n) 47 | 48 | # ifndef DATA_TYPE 49 | # define DATA_TYPE double 50 | # define DATA_PRINTF_MODIFIER "%0.2lf " 51 | # endif 52 | 53 | 54 | #endif /* !JACOBI_1D_IMPER */ 55 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/stencils/jacobi-2d-imper/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../utilities/options.mk 2 | -include ../../utilities/c.mk -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/stencils/jacobi-2d-imper/jacobi-2d-imper.h: -------------------------------------------------------------------------------- 1 | /** 2 | * jacobi-2d-imper.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef JACOBI_2D_IMPER_H 9 | # define JACOBI_2D_IMPER_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(TSTEPS) && ! defined(N) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define TSTEPS 2 21 | # define N 32 22 | # endif 23 | 24 | # ifdef SMALL_DATASET 25 | # define TSTEPS 10 26 | # define N 500 27 | # endif 28 | 29 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 30 | # define TSTEPS 20 31 | # define N 1000 32 | # endif 33 | 34 | # ifdef LARGE_DATASET 35 | # define TSTEPS 20 36 | # define N 2000 37 | # endif 38 | 39 | # ifdef EXTRALARGE_DATASET 40 | # define TSTEPS 100 41 | # define N 4000 42 | # endif 43 | # endif /* !N */ 44 | 45 | # define _PB_TSTEPS POLYBENCH_LOOP_BOUND(TSTEPS,tsteps) 46 | # define _PB_N POLYBENCH_LOOP_BOUND(N,n) 47 | 48 | # ifndef DATA_TYPE 49 | # define DATA_TYPE double 50 | # define DATA_PRINTF_MODIFIER "%0.2lf " 51 | # endif 52 | 53 | 54 | #endif /* !JACOBI_2D_IMPER */ 55 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/stencils/seidel-2d/Makefile: -------------------------------------------------------------------------------- 1 | -include ../../utilities/options.mk 2 | -include ../../utilities/c.mk -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/stencils/seidel-2d/seidel-2d.h: -------------------------------------------------------------------------------- 1 | /** 2 | * seidel-2d.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef SEIDEL_2D_H 9 | # define SEIDEL_2D_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(TSTEPS) && ! defined(N) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define TSTEPS 2 21 | # define N 32 22 | # endif 23 | 24 | # ifdef SMALL_DATASET 25 | # define TSTEPS 10 26 | # define N 500 27 | # endif 28 | 29 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 30 | # define TSTEPS 20 31 | # define N 1000 32 | # endif 33 | 34 | # ifdef LARGE_DATASET 35 | # define TSTEPS 20 36 | # define N 2000 37 | # endif 38 | 39 | # ifdef EXTRALARGE_DATASET 40 | # define TSTEPS 100 41 | # define N 4000 42 | # endif 43 | # endif /* !N */ 44 | 45 | # define _PB_TSTEPS POLYBENCH_LOOP_BOUND(TSTEPS,tsteps) 46 | # define _PB_N POLYBENCH_LOOP_BOUND(N,n) 47 | 48 | # ifndef DATA_TYPE 49 | # define DATA_TYPE double 50 | # define DATA_PRINTF_MODIFIER "%0.2lf " 51 | # endif 52 | 53 | 54 | #endif /* !SEIDEL_2D */ 55 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/utilities/benchmark_list: -------------------------------------------------------------------------------- 1 | ./datamining/correlation/correlation.c 2 | ./datamining/covariance/covariance.c 3 | ./linear-algebra/kernels/2mm/2mm.c 4 | ./linear-algebra/kernels/3mm/3mm.c 5 | ./linear-algebra/kernels/atax/atax.c 6 | ./linear-algebra/kernels/bicg/bicg.c 7 | ./linear-algebra/kernels/cholesky/cholesky.c 8 | ./linear-algebra/kernels/doitgen/doitgen.c 9 | ./linear-algebra/kernels/gemm/gemm.c 10 | ./linear-algebra/kernels/gemver/gemver.c 11 | ./linear-algebra/kernels/gesummv/gesummv.c 12 | ./linear-algebra/kernels/mvt/mvt.c 13 | ./linear-algebra/kernels/symm/symm.c 14 | ./linear-algebra/kernels/syr2k/syr2k.c 15 | ./linear-algebra/kernels/syrk/syrk.c 16 | ./linear-algebra/kernels/trisolv/trisolv.c 17 | ./linear-algebra/kernels/trmm/trmm.c 18 | ./linear-algebra/solvers/durbin/durbin.c 19 | ./linear-algebra/solvers/dynprog/dynprog.c 20 | ./linear-algebra/solvers/gramschmidt/gramschmidt.c 21 | ./linear-algebra/solvers/lu/lu.c 22 | ./linear-algebra/solvers/ludcmp/ludcmp.c 23 | ./medley/floyd-warshall/floyd-warshall.c 24 | ./medley/reg_detect/reg_detect.c 25 | ./stencils/adi/adi.c 26 | ./stencils/fdtd-2d/fdtd-2d.c 27 | ./stencils/fdtd-apml/fdtd-apml.c 28 | ./stencils/jacobi-1d-imper/jacobi-1d-imper.c 29 | ./stencils/jacobi-2d-imper/jacobi-2d-imper.c 30 | ./stencils/seidel-2d/seidel-2d.c 31 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/utilities/c.mk: -------------------------------------------------------------------------------- 1 | UTIL_DIR = ../../utilities 2 | -include $(UTIL_DIR)/common.mk -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/utilities/c2.mk: -------------------------------------------------------------------------------- 1 | UTIL_DIR = ../../../utilities 2 | -include $(UTIL_DIR)/common.mk -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/utilities/common.mk: -------------------------------------------------------------------------------- 1 | INCPATHS = -I$(UTIL_DIR) 2 | 3 | BENCHMARK = $(shell basename `pwd`) 4 | EXE = $(BENCHMARK) 5 | OBJ = rose_$(BENCHMARK).c 6 | SRC = $(BENCHMARK).c 7 | HEADERS = $(BENCHMARK).h 8 | 9 | DEPS := Makefile.dep 10 | DEP_FLAG := -MM 11 | 12 | .PHONY: all exe clean veryclean 13 | 14 | all : exe 15 | 16 | exe : $(EXE) 17 | 18 | $(OBJ) : $(SRC) 19 | $(ACC) $(ACCFLAGS) $(ACC_INC_PATH) $(INCPATHS) $^ 20 | 21 | $(EXE) : $(OBJ) $(BENCHMARK)-data.c $(UTIL_DIR)/polybench.c 22 | $(CC) -o $@ $(CFLAGS) $(ACC_INC_PATH) $(ACC_LIB_PATH) $(INCPATHS) $^ $(ACC_LIBS) 23 | 24 | check: exe 25 | ./$(EXE) 26 | 27 | clean : 28 | -rm -vf __hmpp* -vf $(EXE) *~ 29 | -rm -rf rose_$(BENCHMARK).c $(BENCHMARK)-data.c $(BENCHMARK).cl $(BENCHMARK) 30 | 31 | veryclean : clean 32 | -rm -vf $(DEPS) 33 | 34 | $(DEPS): $(SRC) $(HEADERS) 35 | $(CC) $(INCPATHS) $(DEP_FLAG) $(SRC) > $(DEPS) 36 | 37 | -include $(DEPS) 38 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/utilities/create_cpped_version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ## create_cpped_version.sh for in /Users/pouchet 3 | ## 4 | ## Made by Louis-Noel Pouchet 5 | ## Contact: 6 | ## 7 | ## Started on Mon Oct 31 16:20:01 2011 Louis-Noel Pouchet 8 | ## Last update Mon Oct 31 20:42:35 2011 Louis-Noel Pouchet 9 | ## 10 | 11 | if [ $# -lt 1 ]; then 12 | echo "Usage: create_cpped_version.sh [gcc -E flags]"; 13 | exit 1; 14 | fi; 15 | args="$2"; 16 | file="$1"; 17 | head -n 12 $file > .__poly_top.c; 18 | tail -n +12 $file > .__poly_bottom.c; 19 | filename=`echo "$file" | sed -e "s/\(.*\).c/\1/1"`; 20 | filenameorig=`basename $file`; 21 | benchdir=`dirname "$file"`; 22 | gcc -E .__poly_bottom.c -I $benchdir $args 2>/dev/null > .__tmp_poly.c 23 | sed -e "/^[ ]*;[ ]*$/d" .__tmp_poly.c | sed -e "s~.__poly_bottom.c~$filenameorig~g" > .__poly_bottom.c; 24 | cat .__poly_top.c > $filename.preproc.c; 25 | echo "#include \n" >> $filename.preproc.c; 26 | cat .__poly_bottom.c >> $filename.preproc.c; 27 | rm -f .__tmp_poly.c .__poly_bottom.c .__poly_top.c; 28 | 29 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/utilities/options.mk: -------------------------------------------------------------------------------- 1 | 2 | # COMPILER OPTIONS -- ACCELERATOR 3 | ######################################## 4 | 5 | # Accelerator Compiler 6 | ACC = roseacc 7 | 8 | # Accelerator Compiler flags 9 | ACCFLAGS=--roseacc:desc_format=static_data --roseacc:compile=false 10 | 11 | ACC_INC_PATH=`openacc --incpath` 12 | ACC_LIB_PATH=`openacc --libpath` 13 | ACC_LIBS=`openacc --libs` 14 | 15 | # COMPILER OPTIONS -- HOST 16 | ######################################## 17 | 18 | # Compiler 19 | CC = gcc 20 | 21 | # Compiler flags 22 | CFLAGS = -O2 23 | 24 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/utilities/papi_counters.list: -------------------------------------------------------------------------------- 1 | // Counters must be delimited with ',' including the last one. 2 | // C/C++ comments are allowed. 3 | // Both native and standard PAPI events are supported. 4 | "PAPI_TOT_CYC", 5 | "L1D:REPL", 6 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/PolyBench-ACC/utilities/template-for-new-benchmark.h: -------------------------------------------------------------------------------- 1 | /** 2 | * template.h: This file is part of the PolyBench/C 3.2 test suite. 3 | * 4 | * 5 | * Contact: Louis-Noel Pouchet 6 | * Web address: http://polybench.sourceforge.net 7 | */ 8 | #ifndef TEMPLATE_H 9 | # define TEMPLATE_H 10 | 11 | /* Default to STANDARD_DATASET. */ 12 | # if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET) 13 | # define STANDARD_DATASET 14 | # endif 15 | 16 | /* Do not define anything if the user manually defines the size. */ 17 | # if !defined(N) 18 | /* Define the possible dataset sizes. */ 19 | # ifdef MINI_DATASET 20 | # define N 32 21 | # endif 22 | 23 | # ifdef SMALL_DATASET 24 | # define N 128 25 | # endif 26 | 27 | # ifdef STANDARD_DATASET /* Default if unspecified. */ 28 | # define N 1024 29 | # endif 30 | 31 | # ifdef LARGE_DATASET 32 | # define N 2000 33 | # endif 34 | 35 | # ifdef EXTRALARGE_DATASET 36 | # define N 4000 37 | # endif 38 | # endif /* !N */ 39 | 40 | # define _PB_N POLYBENCH_LOOP_BOUND(N,n) 41 | 42 | # ifndef DATA_TYPE 43 | # define DATA_TYPE double 44 | # define DATA_PRINTF_MODIFIER "%0.2lf " 45 | # endif 46 | 47 | 48 | #endif /* !TEMPLATE */ 49 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/Readme: -------------------------------------------------------------------------------- 1 | All Sample Codes will go into this folder 2 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/Tutorial1/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | BSD 3-Clause License 3 | 4 | Copyright (c) 2017, NVIDIA Corp. 5 | Michael Wolfe mwolfe@nvidia.com 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | 11 | * Redistributions of source code must retain the above copyright notice, this 12 | list of conditions and the following disclaimer. 13 | 14 | * Redistributions in binary form must reproduce the above copyright notice, 15 | this list of conditions and the following disclaimer in the documentation 16 | and/or other materials provided with the distribution. 17 | 18 | * Neither the name of the copyright holder nor the names of its 19 | contributors may be used to endorse or promote products derived from 20 | this software without specific prior written permission. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 23 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 26 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 30 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/Tutorial1/README.md: -------------------------------------------------------------------------------- 1 | These are small examples used in OpenACC tutorials. 2 | The original programs were written by Michael Wolfe from the references listed. 3 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/Tutorial1/pi/Makefile: -------------------------------------------------------------------------------- 1 | choose: 2 | @echo make c++ or make fortran or make both 3 | 4 | CPP=pgc++ 5 | FC=pgfortran 6 | TIMER=/usr/bin/time 7 | OPT= 8 | NOPT=-fast -Minfo=opt $(OPT) 9 | STEPS=1000 10 | 11 | c++: pic.exe 12 | $(TIMER) ./pic.exe $(STEPS) 13 | pic.exe: pic.cpp 14 | $(CPP) -o $@ $< $(NOPT) 15 | 16 | fortran: pif.exe 17 | $(TIMER) ./pif.exe $(STEPS) 18 | pif.exe: pif.f90 19 | $(FC) -o $@ $< $(NOPT) 20 | 21 | both: c++ fortran 22 | 23 | clean: 24 | rm -f *.o *.exe *.s a.out 25 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/Tutorial1/pi/README.md: -------------------------------------------------------------------------------- 1 | # Compute PI 2 | 3 | See discussion for Improved Say of Determining Pi at 4 | http://mb-soft.com/public3/pi.html (retrieved March 2017) 5 | If we integrate 1/(1+x^2) for x=0:1, we get pi/4 6 | 7 | These two programs (same program in C++ and Fortran) 8 | numerically estimate the integral by dividing the range 0:1 9 | into nsteps sections. 10 | 11 | make c++ to build and run the C++ version 12 | make fortran to build and run the Fortran version 13 | 14 | makefile default: 15 | TIMER=/usr/bin/time to measure execution time 16 | STEPS=1000 number of sections to divide the region 0:1 into 17 | OPT= selected optimizations to, say, select target environment 18 | NOPT=-fast -Minfo normal optimizations, depends on the compilers used and target 19 | CPP=pgc++ C++ compiler 20 | FC=pgfortran Fortran compiler 21 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/Tutorial1/pi/pic.cpp: -------------------------------------------------------------------------------- 1 | // C++ program to estimate value of pi 2 | // See discussion for Improved Say of Determining Pi at 3 | // http://mb-soft.com/public3/pi.html (retrieved March 2017) 4 | // If we integrate 1/(1+x^2) for x=0:1, we get pi/4 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | using std::cout; 11 | 12 | int main(int argc, char* argv[]) 13 | { 14 | long i, nsteps; 15 | double pi, step, sum = 0.0; 16 | nsteps = 0; 17 | if (argc > 1) 18 | nsteps = atol(argv[1]); 19 | if (nsteps <= 0) 20 | nsteps = 100; 21 | step = (1.0)/((double)nsteps); 22 | for (i = 0; i < nsteps; ++i) { 23 | double x = ((double)i+0.5)*step; 24 | sum += 1.0 / (1.0 + x * x); 25 | } 26 | pi = 4.0 * step * sum; 27 | cout << std::fixed; 28 | cout << "pi is " << std::setprecision(17) << pi << "\n"; 29 | } 30 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/Tutorial1/pi/pif.f90: -------------------------------------------------------------------------------- 1 | ! Fortran program to estimate value of pi 2 | ! See discussion for Improved Say of Determining Pi at 3 | ! http://mb-soft.com/public3/pi.html (retrieved March 2017) 4 | ! If we integrate 1/(1+x^2) for x=0:1, we get pi/4 5 | 6 | program piprogram 7 | implicit none 8 | integer(8) :: i, nsteps 9 | doubleprecision :: pi, step, sum, x 10 | character*10 :: cnsteps 11 | nsteps = 0 12 | if (command_argument_count() > 0) then 13 | call get_command_argument(1, cnsteps) 14 | read(cnsteps,'(i)') nsteps 15 | endif 16 | if (nsteps <= 0) nsteps = 100 17 | step = 1.0d0 / nsteps 18 | do i = 1, nsteps 19 | x = (i - 0.5) * step 20 | sum = sum + 1.0 / (1.0 + x*x) 21 | enddo 22 | pi = 4.0 * step * sum 23 | print '(a,f20.17)', 'pi is ', pi 24 | end program 25 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/Tutorial1/solver/Makefile: -------------------------------------------------------------------------------- 1 | choose: 2 | @echo make c++ or make fortran or make both 3 | 4 | CPP=pgc++ 5 | FC=pgfortran 6 | TIMER=/usr/bin/time 7 | OPT= 8 | NOPT=-fast -Minfo=opt $(OPT) 9 | ARGS=1000 10 | 11 | c++: jsolvec.exe 12 | $(TIMER) ./jsolvec.exe $(ARGS) 13 | jsolvec.exe: jsolvec.cpp 14 | $(CPP) -o $@ $< $(NOPT) 15 | 16 | fortran: jsolvef.exe 17 | $(TIMER) ./jsolvef.exe $(STEPS) 18 | jsolvef.exe: jsolvef.F90 19 | $(FC) -o $@ $< $(NOPT) 20 | 21 | both: c++ fortran 22 | 23 | clean: 24 | rm -f *.o *.exe *.s *.mod a.out 25 | -------------------------------------------------------------------------------- /Contributed_Sample_Codes/Tutorial1/solver/README.md: -------------------------------------------------------------------------------- 1 | # Jacobi Iterative Method for solving a system of equations 2 | 3 | See discussion for the Jacobi Method at 4 | https://en.wikipedia.org/wiki/Jacobi_method (retrieved March 2017) 5 | 6 | We solve for vector x in Ax = b 7 | Rewrite the matrix A as a 8 | lower triangular (L), 9 | upper triangular (U), 10 | and diagonal matrix (D). 11 | 12 | Ax = (L + D + U)x = b 13 | 14 | rearrange to get: Dx = b - (L+U)x --> x = (b-(L+U)x)/D 15 | 16 | we can do this iteratively: x_new = (b-(L+U)x_old)/D 17 | 18 | These two programs (same program in C++ and Fortran) 19 | iteratively solve the equation by computing xnew from 20 | xold, until the difference between two consecutive 21 | iterations has reached a tolerance. The programs then 22 | compute Ax and compare that against b as a correctness check. 23 | 24 | make c++ to build and run the C++ version 25 | make fortran to build and run the Fortran version 26 | 27 | makefile default: 28 | TIMER=/usr/bin/time to measure execution time 29 | ARGS=1000 size of the vector; additional arguments are maximum iterations and print frequency 30 | OPT= selected optimizations to, say, select target environment 31 | NOPT=-fast -Minfo normal optimizations, depends on the compilers used and target 32 | CPP=pgc++ C++ compiler 33 | FC=pgfortran Fortran compiler 34 | --------------------------------------------------------------------------------