1. Moved break statement in utils.cc to correct position
2. Tested sandbox with regions 3. Lots of profiling code from previous commit exists
This commit is contained in:
parent
acda6ca27b
commit
78642944c0
|
|
@ -10,6 +10,9 @@ LoadTimeInitializer::LoadTimeInitializer() //will be called when library is loa
|
|||
#ifndef DISABLE_FTZ
|
||||
//Very important to get good performance - enable FTZ, converts denormals to 0
|
||||
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
|
||||
cout << "FTZ enabled - may decrease accuracy if denormal numbers encountered\n";
|
||||
#else
|
||||
cout << "FTZ is not set - may slow down performance if denormal numbers encountered\n";
|
||||
#endif
|
||||
m_sumNumReads = 0;
|
||||
m_sumSquareNumReads = 0;
|
||||
|
|
|
|||
|
|
@ -272,7 +272,7 @@ public class Sandbox {
|
|||
//System.err.println(e);
|
||||
//}
|
||||
Sandbox t = new Sandbox();
|
||||
t.doEverythingNative(args[0]);
|
||||
//t.parseSandboxFile(args[0]);
|
||||
//t.doEverythingNative(args[0]);
|
||||
t.parseSandboxFile(args[0]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@ using namespace std;
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
#define BATCH_SIZE 5
|
||||
#define BATCH_SIZE 10000
|
||||
if(argc < 2)
|
||||
{
|
||||
cerr << "Needs path to input file as argument\n";
|
||||
exit(0);
|
||||
}
|
||||
do_compute(argv[1]);
|
||||
#if 0
|
||||
return 0;
|
||||
bool use_old_read_testcase = false;
|
||||
if(argc >= 3 && string(argv[2]) == "1")
|
||||
use_old_read_testcase = true;
|
||||
|
|
@ -56,7 +56,6 @@ int main(int argc, char** argv)
|
|||
testcase tc_in;
|
||||
int break_value = 0;
|
||||
tc_vector.clear();
|
||||
g_load_time_initializer.open_sandbox();
|
||||
while(1)
|
||||
{
|
||||
break_value = use_old_read_testcase ? read_testcase(&tc_in, fptr) :
|
||||
|
|
@ -144,8 +143,6 @@ int main(int argc, char** argv)
|
|||
fclose(fptr);
|
||||
else
|
||||
ifptr.close();
|
||||
g_load_time_initializer.close_sandbox();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -79,9 +79,13 @@ int read_testcase(testcase *tc, FILE* ifp)
|
|||
int x, size = 0;
|
||||
ssize_t read;
|
||||
|
||||
read = getline(&line, (size_t *) &size, ifp == 0 ? stdin : ifp);
|
||||
|
||||
read = getline(&line, (size_t *) &size, ifp == 0 ? stdin : ifp);
|
||||
if (read == -1)
|
||||
return -1;
|
||||
{
|
||||
free(line);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
tc->hap = (char *) malloc(size);
|
||||
|
|
@ -326,7 +330,7 @@ void do_compute(char* filename)
|
|||
long long accum_values[NUM_PAPI_COUNTERS] = { 0, 0, 0, 0 };
|
||||
|
||||
#endif
|
||||
#define BATCH_SIZE 100000
|
||||
#define BATCH_SIZE 10000
|
||||
bool use_old_read_testcase = true;
|
||||
unsigned chunk_size = 100;
|
||||
std::ifstream ifptr;
|
||||
|
|
@ -396,25 +400,25 @@ void do_compute(char* filename)
|
|||
#ifdef CHECK_UNDERFLOW
|
||||
if (result_avxf < MIN_ACCEPTED)
|
||||
#else
|
||||
if(false)
|
||||
if(false)
|
||||
#endif
|
||||
{
|
||||
{
|
||||
#ifdef COUNT_EXCEPTIONS
|
||||
if(fp_exception)
|
||||
++fp_single_exceptions_reexecute;
|
||||
if(fp_exception)
|
||||
++fp_single_exceptions_reexecute;
|
||||
#endif
|
||||
double result_avxd = g_compute_full_prob_double(&(tc_vector[i]), 0);
|
||||
result = log10(result_avxd) - log10(ldexp(1.0, 1020.0));
|
||||
++num_double_executions;
|
||||
}
|
||||
else
|
||||
{
|
||||
double result_avxd = g_compute_full_prob_double(&(tc_vector[i]), 0);
|
||||
result = log10(result_avxd) - log10(ldexp(1.0, 1020.0));
|
||||
++num_double_executions;
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef COUNT_EXCEPTIONS
|
||||
if(fp_exception)
|
||||
++fp_single_exceptions_continue;
|
||||
if(fp_exception)
|
||||
++fp_single_exceptions_continue;
|
||||
#endif
|
||||
result = (double)(log10f(result_avxf) - log10f(ldexpf(1.f, 120.f)));
|
||||
}
|
||||
result = (double)(log10f(result_avxf) - log10f(ldexpf(1.f, 120.f)));
|
||||
}
|
||||
results_vec[i] = result;
|
||||
}
|
||||
#ifdef USE_PAPI
|
||||
|
|
@ -459,12 +463,12 @@ void do_compute(char* filename)
|
|||
#endif
|
||||
for(unsigned i=0;i<num_testcases;++i)
|
||||
{
|
||||
delete tc_vector[i].rs;
|
||||
delete tc_vector[i].hap;
|
||||
delete tc_vector[i].q;
|
||||
delete tc_vector[i].i;
|
||||
delete tc_vector[i].d;
|
||||
delete tc_vector[i].c;
|
||||
free(tc_vector[i].rs);
|
||||
free(tc_vector[i].hap);
|
||||
free(tc_vector[i].q);
|
||||
free(tc_vector[i].i);
|
||||
free(tc_vector[i].d);
|
||||
free(tc_vector[i].c);
|
||||
}
|
||||
total_count += num_testcases;
|
||||
num_testcases = 0;
|
||||
|
|
@ -473,9 +477,9 @@ void do_compute(char* filename)
|
|||
results_vec.clear();
|
||||
//curr_batch_size = rand()%BATCH_SIZE + 4; //min batch size
|
||||
curr_batch_size = BATCH_SIZE;
|
||||
if(break_value < 0)
|
||||
break;
|
||||
}
|
||||
if(break_value < 0)
|
||||
break;
|
||||
}
|
||||
|
||||
baseline_results.clear();
|
||||
|
|
|
|||
Loading…
Reference in New Issue