23 int main(
int argc,
char** argv) {
37 niterBlock = atoi(argv[1]);
42 std::ofstream fresult(
"performance_test.txt", std::ofstream::out);
44 std::cout <<
" **************************************************************"
47 std::cout <<
" Tests with the OneDRegisterAccessor:" << std::endl;
50 gettimeofday(&tv,
nullptr);
51 t0 = tv.tv_sec * 1000000 + tv.tv_usec;
52 std::cout <<
" reading block ";
53 for(
int i = 0; i < niterBlock; ++i) {
57 gettimeofday(&tv,
nullptr);
58 tdur = (tv.tv_sec * 1000000 + tv.tv_usec) - t0;
59 std::cout <<
"took " <<
static_cast<double>(tdur) / 1000. / niterBlock <<
" ms per block" << std::endl;
60 fresult <<
"1D_COOKEDus=" << std::round(
static_cast<double>(tdur) / niterBlock) << std::endl;
63 gettimeofday(&tv,
nullptr);
64 t0 = tv.tv_sec * 1000000 + tv.tv_usec;
65 std::cout <<
" raw-reading block ";
66 for(
int i = 0; i < niterBlock; ++i) {
70 gettimeofday(&tv,
nullptr);
71 tdur = (tv.tv_sec * 1000000 + tv.tv_usec) - t0;
72 std::cout <<
"took " <<
static_cast<double>(tdur) / 1000. / niterBlock <<
" ms per block" << std::endl;
73 fresult <<
"1D_RAWus=" << std::round(
static_cast<double>(tdur) / niterBlock) << std::endl;
75 std::cout <<
" **************************************************************"
78 std::cout <<
" Sum of all read data: " << sum << std::endl;