Skip to content

Commit 9238a09

Browse files
author
michael boulton
committed
Printing out average time of kernel calls
1 parent 7eb37d3 commit 9238a09

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

kernel_files/tea_leaf_cg_cl.cl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ __kernel void tea_leaf_cg_solve_calc_ur
8787
__global double * __restrict const rrn)
8888
{
8989
__kernel_indexes;
90+
9091
__local double rrn_shared[BLOCK_SZ];
9192
rrn_shared[lid] = 0.0;
9293

kernel_files/tea_leaf_ppcg_cl.cl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ __kernel void tea_leaf_ppcg_solve_calc_sd
110110
sd[THARR2D(0, 0, 0)] = alpha[step]*sd[THARR2D(0, 0, 0)]
111111
+ beta[step]*r[THARR2D(0, 0, 0)]*Mi[THARR2D(0, 0, 0)];
112112
}
113-
else
113+
else if (PRECONDITIONER == TL_PREC_NONE)
114114
{
115115
sd[THARR2D(0, 0, 0)] = alpha[step]*sd[THARR2D(0, 0, 0)]
116116
+ beta[step]*r[THARR2D(0, 0, 0)];

ocl_errors.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,14 @@ CloverChunk::~CloverChunk
215215
{
216216
fprintf(stdout, "@@@@@ PROFILING @@@@@\n");
217217

218-
for (std::map<std::string, double>::iterator ii = kernel_times.begin();
219-
ii != kernel_times.end(); ii++)
218+
std::map<std::string, double>::iterator ii = kernel_times.begin();
219+
std::map<std::string, int>::iterator jj = kernel_calls.begin();
220+
221+
for (ii = kernel_times.begin(), jj = kernel_calls.begin();
222+
ii != kernel_times.end(); ii++, jj++)
220223
{
221-
fprintf(stdout, "%30s : %.3f\n", (*ii).first.c_str(), (*ii).second);
224+
fprintf(stdout, "%30s : %10.3f ms (%.2f μs avg.)\n",
225+
ii->first.c_str(), ii->second, 1e3*ii->second/jj->second);
222226
}
223227
}
224228
}

0 commit comments

Comments
 (0)