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
|
#ifndef DISABLE_FTZ
|
||||||
//Very important to get good performance - enable FTZ, converts denormals to 0
|
//Very important to get good performance - enable FTZ, converts denormals to 0
|
||||||
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
|
_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
|
#endif
|
||||||
m_sumNumReads = 0;
|
m_sumNumReads = 0;
|
||||||
m_sumSquareNumReads = 0;
|
m_sumSquareNumReads = 0;
|
||||||
|
|
|
||||||
|
|
@ -272,7 +272,7 @@ public class Sandbox {
|
||||||
//System.err.println(e);
|
//System.err.println(e);
|
||||||
//}
|
//}
|
||||||
Sandbox t = new Sandbox();
|
Sandbox t = new Sandbox();
|
||||||
t.doEverythingNative(args[0]);
|
//t.doEverythingNative(args[0]);
|
||||||
//t.parseSandboxFile(args[0]);
|
t.parseSandboxFile(args[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,14 @@ using namespace std;
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
#define BATCH_SIZE 5
|
#define BATCH_SIZE 10000
|
||||||
if(argc < 2)
|
if(argc < 2)
|
||||||
{
|
{
|
||||||
cerr << "Needs path to input file as argument\n";
|
cerr << "Needs path to input file as argument\n";
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
do_compute(argv[1]);
|
do_compute(argv[1]);
|
||||||
#if 0
|
return 0;
|
||||||
bool use_old_read_testcase = false;
|
bool use_old_read_testcase = false;
|
||||||
if(argc >= 3 && string(argv[2]) == "1")
|
if(argc >= 3 && string(argv[2]) == "1")
|
||||||
use_old_read_testcase = true;
|
use_old_read_testcase = true;
|
||||||
|
|
@ -56,7 +56,6 @@ int main(int argc, char** argv)
|
||||||
testcase tc_in;
|
testcase tc_in;
|
||||||
int break_value = 0;
|
int break_value = 0;
|
||||||
tc_vector.clear();
|
tc_vector.clear();
|
||||||
g_load_time_initializer.open_sandbox();
|
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
break_value = use_old_read_testcase ? read_testcase(&tc_in, fptr) :
|
break_value = use_old_read_testcase ? read_testcase(&tc_in, fptr) :
|
||||||
|
|
@ -144,8 +143,6 @@ int main(int argc, char** argv)
|
||||||
fclose(fptr);
|
fclose(fptr);
|
||||||
else
|
else
|
||||||
ifptr.close();
|
ifptr.close();
|
||||||
g_load_time_initializer.close_sandbox();
|
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,9 +79,13 @@ int read_testcase(testcase *tc, FILE* ifp)
|
||||||
int x, size = 0;
|
int x, size = 0;
|
||||||
ssize_t read;
|
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)
|
if (read == -1)
|
||||||
|
{
|
||||||
|
free(line);
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
tc->hap = (char *) malloc(size);
|
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 };
|
long long accum_values[NUM_PAPI_COUNTERS] = { 0, 0, 0, 0 };
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#define BATCH_SIZE 100000
|
#define BATCH_SIZE 10000
|
||||||
bool use_old_read_testcase = true;
|
bool use_old_read_testcase = true;
|
||||||
unsigned chunk_size = 100;
|
unsigned chunk_size = 100;
|
||||||
std::ifstream ifptr;
|
std::ifstream ifptr;
|
||||||
|
|
@ -459,12 +463,12 @@ void do_compute(char* filename)
|
||||||
#endif
|
#endif
|
||||||
for(unsigned i=0;i<num_testcases;++i)
|
for(unsigned i=0;i<num_testcases;++i)
|
||||||
{
|
{
|
||||||
delete tc_vector[i].rs;
|
free(tc_vector[i].rs);
|
||||||
delete tc_vector[i].hap;
|
free(tc_vector[i].hap);
|
||||||
delete tc_vector[i].q;
|
free(tc_vector[i].q);
|
||||||
delete tc_vector[i].i;
|
free(tc_vector[i].i);
|
||||||
delete tc_vector[i].d;
|
free(tc_vector[i].d);
|
||||||
delete tc_vector[i].c;
|
free(tc_vector[i].c);
|
||||||
}
|
}
|
||||||
total_count += num_testcases;
|
total_count += num_testcases;
|
||||||
num_testcases = 0;
|
num_testcases = 0;
|
||||||
|
|
@ -473,10 +477,10 @@ void do_compute(char* filename)
|
||||||
results_vec.clear();
|
results_vec.clear();
|
||||||
//curr_batch_size = rand()%BATCH_SIZE + 4; //min batch size
|
//curr_batch_size = rand()%BATCH_SIZE + 4; //min batch size
|
||||||
curr_batch_size = BATCH_SIZE;
|
curr_batch_size = BATCH_SIZE;
|
||||||
|
}
|
||||||
if(break_value < 0)
|
if(break_value < 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
baseline_results.clear();
|
baseline_results.clear();
|
||||||
results_vec.clear();
|
results_vec.clear();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue