[llvm-commits] [test-suite] r105415 - in /test-suite/trunk/MultiSource/Benchmarks/ASC_Sequoia/IRSmk: Makefile main.c utility.c
Jakob Stoklund Olesen
stoklund at 2pi.dk
Thu Jun 3 14:13:44 PDT 2010
Author: stoklund
Date: Thu Jun 3 16:13:44 2010
New Revision: 105415
URL: http://llvm.org/viewvc/llvm-project?rev=105415&view=rev
Log:
Better fix: Take input file name as a command line argument.
Modified:
test-suite/trunk/MultiSource/Benchmarks/ASC_Sequoia/IRSmk/Makefile
test-suite/trunk/MultiSource/Benchmarks/ASC_Sequoia/IRSmk/main.c
test-suite/trunk/MultiSource/Benchmarks/ASC_Sequoia/IRSmk/utility.c
Modified: test-suite/trunk/MultiSource/Benchmarks/ASC_Sequoia/IRSmk/Makefile
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/ASC_Sequoia/IRSmk/Makefile?rev=105415&r1=105414&r2=105415&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/ASC_Sequoia/IRSmk/Makefile (original)
+++ test-suite/trunk/MultiSource/Benchmarks/ASC_Sequoia/IRSmk/Makefile Thu Jun 3 16:13:44 2010
@@ -4,5 +4,6 @@
LIBS += -lm
LDFLAGS += -lm
+RUN_OPTIONS = $(PROJ_SRC_DIR)/irsmk_input
include ../../../Makefile.multisrc
Modified: test-suite/trunk/MultiSource/Benchmarks/ASC_Sequoia/IRSmk/main.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/ASC_Sequoia/IRSmk/main.c?rev=105415&r1=105414&r2=105415&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/ASC_Sequoia/IRSmk/main.c (original)
+++ test-suite/trunk/MultiSource/Benchmarks/ASC_Sequoia/IRSmk/main.c Thu Jun 3 16:13:44 2010
@@ -22,11 +22,11 @@
void allocMem(RadiationData_t *);
void init(Domain_t *, RadiationData_t *, double *, double *);
-void readInput();
+void readInput(const char *);
void rmatmult3(Domain_t *, RadiationData_t *, double *, double *);
-int main()
+int main(int argc, const char *argv[])
{
Domain_t domain;
Domain_t *domain_ptr = &domain;
@@ -50,8 +50,12 @@
printf ("\nSequoia Benchmark Version 1.0\n\n");
+ if (argc != 2) {
+ printf("Usage: %s <input>\n", argv[0]);
+ return 1;
+ }
//
- readInput();
+ readInput(argv[1]);
b = (double *)malloc(i_ub*sizeof(double));
x = (double *)malloc(x_size*sizeof(double));
Modified: test-suite/trunk/MultiSource/Benchmarks/ASC_Sequoia/IRSmk/utility.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/ASC_Sequoia/IRSmk/utility.c?rev=105415&r1=105414&r2=105415&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/ASC_Sequoia/IRSmk/utility.c (original)
+++ test-suite/trunk/MultiSource/Benchmarks/ASC_Sequoia/IRSmk/utility.c Thu Jun 3 16:13:44 2010
@@ -14,12 +14,12 @@
//--------------
// read input date
//--------------
-void readInput()
+void readInput(const char *filename)
{
FILE *fp;
- if ((fp = fopen("irsmk_input", "r"))==NULL) {
+ if ((fp = fopen(filename, "r"))==NULL) {
printf("***** ERROR \n");
- printf(" Cannot open input file irsmk_input \n");
+ printf(" Cannot open input file: %s\n", filename);
exit(1);
}
More information about the llvm-commits
mailing list