diff options
Diffstat (limited to 'src/run.cpp')
-rw-r--r-- | src/run.cpp | 353 |
1 files changed, 0 insertions, 353 deletions
diff --git a/src/run.cpp b/src/run.cpp index 4eaa8cd..dc4ec96 100644 --- a/src/run.cpp +++ b/src/run.cpp @@ -44,9 +44,6 @@ typedef benchmark (*generator)(int64 chains_per_thread, static benchmark chase_pointers(int64 chains_per_thread, int64 bytes_per_line, int64 bytes_per_chain, int64 stride, int64 loop_length, int32 prefetch_hint); -static benchmark follow_streams(int64 chains_per_thread, - int64 bytes_per_line, int64 bytes_per_chain, - int64 stride, int64 loop_length, int32 prefetch_hint); Lock Run::global_mutex; int64 Run::_ops_per_chain = 0; @@ -110,9 +107,6 @@ int Run::run() { root[i] = reverse_mem_init(chain_memory[i]); } gen = chase_pointers; - } else if (this->exp->access_pattern == Experiment::STREAM) { - root[i] = stream_mem_init(chain_memory[i]); - gen = follow_streams; } } @@ -455,350 +449,3 @@ static benchmark chase_pointers(int64 chains_per_thread, // memory loading per t return fn; } - -// NOT WRITTEN YET -- DMP -// JUST A PLACE HOLDER! -Chain* Run::stream_mem_init(Chain *mem) { -// fprintf(stderr, "made it into stream_mem_init.\n"); -// fprintf(stderr, "chains_per_thread = %ld\n", this->exp->chains_per_thread); -// fprintf(stderr, "iterations = %ld\n", this->exp->iterations); -// fprintf(stderr, "bytes_per_chain = %ld\n", this->exp->bytes_per_chain); -// fprintf(stderr, "stride = %ld\n", this->exp->stride); - int64 local_ops_per_chain = 0; - double* tmp = (double *) mem; - int64 refs_per_line = this->exp->bytes_per_line / sizeof(double); - int64 refs_per_chain = this->exp->bytes_per_chain / sizeof(double); -// fprintf(stderr, "refs_per_chain = %ld\n", refs_per_chain); - - for (int64 i = 0; i < refs_per_chain; - i += this->exp->stride * refs_per_line) { - tmp[i] = 0; - local_ops_per_chain += 1; - } - - Run::global_mutex.lock(); - Run::_ops_per_chain = local_ops_per_chain; - Run::global_mutex.unlock(); - -// fprintf(stderr, "made it out of stream_mem_init.\n"); - return mem; -} - -static int64 summ_ck = 0; -void sum_chk(double t) { - if (t != 0) - summ_ck += 1; -} - -// NOT WRITTEN YET -- DMP -// JUST A PLACE HOLDER! -static benchmark follow_streams(int64 chains_per_thread, // memory loading per thread - int64 bytes_per_line, // ignored - int64 bytes_per_chain, // ignored - int64 stride, // ignored - int64 loop_length, // ignored - int32 prefetch_hint // ignored - ) { - return 0; - /* - int64 refs_per_line = bytes_per_line / sizeof(double); - int64 refs_per_chain = bytes_per_chain / sizeof(double); - - // chase pointers - switch (chains_per_thread) { - default: - case 1: - for (int64 i = 0; i < iterations; i++) { - double t = 0; - double* a0 = (double *) root[0]; - for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) { - t += a0[j]; - } - sum_chk(t); - } - break; - case 2: - for (int64 i = 0; i < iterations; i++) { - double t = 0; - double* a0 = (double *) root[0]; - double* a1 = (double *) root[1]; - for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) { - t += a0[j] + a1[j]; - } - sum_chk(t); - } - break; - case 3: - for (int64 i = 0; i < iterations; i++) { - double t = 0; - double* a0 = (double *) root[0]; - double* a1 = (double *) root[1]; - double* a2 = (double *) root[2]; - for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) { - t += a0[j] + a1[j] + a2[j]; - } - sum_chk(t); - } - break; - case 4: - for (int64 i = 0; i < iterations; i++) { - double t = 0; - double* a0 = (double *) root[0]; - double* a1 = (double *) root[1]; - double* a2 = (double *) root[2]; - double* a3 = (double *) root[3]; - for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) { - t += a0[j] + a1[j] + a2[j] + a3[j]; - } - sum_chk(t); - } - break; - case 5: - for (int64 i = 0; i < iterations; i++) { - double t = 0; - double* a0 = (double *) root[0]; - double* a1 = (double *) root[1]; - double* a2 = (double *) root[2]; - double* a3 = (double *) root[3]; - double* a4 = (double *) root[4]; - for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) { - t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j]; - } - sum_chk(t); - } - break; - case 6: - for (int64 i = 0; i < iterations; i++) { - double t = 0; - double* a0 = (double *) root[0]; - double* a1 = (double *) root[1]; - double* a2 = (double *) root[2]; - double* a3 = (double *) root[3]; - double* a4 = (double *) root[4]; - double* a5 = (double *) root[5]; - for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) { - t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j]; - } - sum_chk(t); - } - break; - case 7: - for (int64 i = 0; i < iterations; i++) { - double t = 0; - double* a0 = (double *) root[0]; - double* a1 = (double *) root[1]; - double* a2 = (double *) root[2]; - double* a3 = (double *) root[3]; - double* a4 = (double *) root[4]; - double* a5 = (double *) root[5]; - double* a6 = (double *) root[6]; - for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) { - t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j] + a6[j]; - } - sum_chk(t); - } - break; - case 8: - for (int64 i = 0; i < iterations; i++) { - double t = 0; - double* a0 = (double *) root[0]; - double* a1 = (double *) root[1]; - double* a2 = (double *) root[2]; - double* a3 = (double *) root[3]; - double* a4 = (double *) root[4]; - double* a5 = (double *) root[5]; - double* a6 = (double *) root[6]; - double* a7 = (double *) root[7]; - for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) { - t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j] + a6[j] - + a7[j]; - } - sum_chk(t); - } - break; - case 9: - for (int64 i = 0; i < iterations; i++) { - double t = 0; - double* a0 = (double *) root[0]; - double* a1 = (double *) root[1]; - double* a2 = (double *) root[2]; - double* a3 = (double *) root[3]; - double* a4 = (double *) root[4]; - double* a5 = (double *) root[5]; - double* a6 = (double *) root[6]; - double* a7 = (double *) root[7]; - double* a8 = (double *) root[8]; - for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) { - t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j] + a6[j] - + a7[j] + a8[j]; - } - sum_chk(t); - } - break; - case 10: - for (int64 i = 0; i < iterations; i++) { - double t = 0; - double* a0 = (double *) root[0]; - double* a1 = (double *) root[1]; - double* a2 = (double *) root[2]; - double* a3 = (double *) root[3]; - double* a4 = (double *) root[4]; - double* a5 = (double *) root[5]; - double* a6 = (double *) root[6]; - double* a7 = (double *) root[7]; - double* a8 = (double *) root[8]; - double* a9 = (double *) root[9]; - for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) { - t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j] + a6[j] - + a7[j] + a8[j] + a9[j]; - } - sum_chk(t); - } - break; - case 11: - for (int64 i = 0; i < iterations; i++) { - double t = 0; - double* a0 = (double *) root[0]; - double* a1 = (double *) root[1]; - double* a2 = (double *) root[2]; - double* a3 = (double *) root[3]; - double* a4 = (double *) root[4]; - double* a5 = (double *) root[5]; - double* a6 = (double *) root[6]; - double* a7 = (double *) root[7]; - double* a8 = (double *) root[8]; - double* a9 = (double *) root[9]; - double* a10 = (double *) root[10]; - for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) { - t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j] + a6[j] - + a7[j] + a8[j] + a9[j] + a10[j]; - } - sum_chk(t); - } - break; - case 12: - for (int64 i = 0; i < iterations; i++) { - double t = 0; - double* a0 = (double *) root[0]; - double* a1 = (double *) root[1]; - double* a2 = (double *) root[2]; - double* a3 = (double *) root[3]; - double* a4 = (double *) root[4]; - double* a5 = (double *) root[5]; - double* a6 = (double *) root[6]; - double* a7 = (double *) root[7]; - double* a8 = (double *) root[8]; - double* a9 = (double *) root[9]; - double* a10 = (double *) root[10]; - double* a11 = (double *) root[11]; - for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) { - t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j] + a6[j] - + a7[j] + a8[j] + a9[j] + a10[j] + a11[j]; - } - sum_chk(t); - } - break; - case 13: - for (int64 i = 0; i < iterations; i++) { - double t = 0; - double* a0 = (double *) root[0]; - double* a1 = (double *) root[1]; - double* a2 = (double *) root[2]; - double* a3 = (double *) root[3]; - double* a4 = (double *) root[4]; - double* a5 = (double *) root[5]; - double* a6 = (double *) root[6]; - double* a7 = (double *) root[7]; - double* a8 = (double *) root[8]; - double* a9 = (double *) root[9]; - double* a10 = (double *) root[10]; - double* a11 = (double *) root[11]; - double* a12 = (double *) root[12]; - for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) { - t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j] + a6[j] - + a7[j] + a8[j] + a9[j] + a10[j] + a11[j] + a12[j]; - } - sum_chk(t); - } - break; - case 14: - for (int64 i = 0; i < iterations; i++) { - double t = 0; - double* a0 = (double *) root[0]; - double* a1 = (double *) root[1]; - double* a2 = (double *) root[2]; - double* a3 = (double *) root[3]; - double* a4 = (double *) root[4]; - double* a5 = (double *) root[5]; - double* a6 = (double *) root[6]; - double* a7 = (double *) root[7]; - double* a8 = (double *) root[8]; - double* a9 = (double *) root[9]; - double* a10 = (double *) root[10]; - double* a11 = (double *) root[11]; - double* a12 = (double *) root[12]; - double* a13 = (double *) root[13]; - for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) { - t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j] + a6[j] - + a7[j] + a8[j] + a9[j] + a10[j] + a11[j] + a12[j] - + a13[j]; - } - sum_chk(t); - } - break; - case 15: - for (int64 i = 0; i < iterations; i++) { - double t = 0; - double* a0 = (double *) root[0]; - double* a1 = (double *) root[1]; - double* a2 = (double *) root[2]; - double* a3 = (double *) root[3]; - double* a4 = (double *) root[4]; - double* a5 = (double *) root[5]; - double* a6 = (double *) root[6]; - double* a7 = (double *) root[7]; - double* a8 = (double *) root[8]; - double* a9 = (double *) root[9]; - double* a10 = (double *) root[10]; - double* a11 = (double *) root[11]; - double* a12 = (double *) root[12]; - double* a13 = (double *) root[13]; - double* a14 = (double *) root[14]; - for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) { - t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j] + a6[j] - + a7[j] + a8[j] + a9[j] + a10[j] + a11[j] + a12[j] - + a13[j] + a14[j]; - } - sum_chk(t); - } - break; - case 16: - for (int64 i = 0; i < iterations; i++) { - double t = 0; - double* a0 = (double *) root[0]; - double* a1 = (double *) root[1]; - double* a2 = (double *) root[2]; - double* a3 = (double *) root[3]; - double* a4 = (double *) root[4]; - double* a5 = (double *) root[5]; - double* a6 = (double *) root[6]; - double* a7 = (double *) root[7]; - double* a8 = (double *) root[8]; - double* a9 = (double *) root[9]; - double* a10 = (double *) root[10]; - double* a11 = (double *) root[11]; - double* a12 = (double *) root[12]; - double* a13 = (double *) root[13]; - double* a14 = (double *) root[14]; - double* a15 = (double *) root[15]; - for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) { - t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j] + a6[j] - + a7[j] + a8[j] + a9[j] + a10[j] + a11[j] + a12[j] - + a13[j] + a14[j] + a15[j]; - } - sum_chk(t); - } - break; - } - */ -} |