diff options
author | Anthony LaTorre <tlatorre9@gmail.com> | 2011-08-19 22:12:21 -0400 |
---|---|---|
committer | Anthony LaTorre <tlatorre9@gmail.com> | 2011-08-19 22:12:21 -0400 |
commit | a3564a8cd0e1a9b2f5492f4094363e7c8b40f21e (patch) | |
tree | bc9e915228808f8a59819f84d49e03b504c8f7f9 | |
parent | d9ee27818663771116e1d9f4d3b59634bdbd782c (diff) | |
download | chroma-a3564a8cd0e1a9b2f5492f4094363e7c8b40f21e.tar.gz chroma-a3564a8cd0e1a9b2f5492f4094363e7c8b40f21e.tar.bz2 chroma-a3564a8cd0e1a9b2f5492f4094363e7c8b40f21e.zip |
ignore first kernel call in benchmarks
-rw-r--r-- | benchmark.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/benchmark.py b/benchmark.py index 0f72811..441b85f 100644 --- a/benchmark.py +++ b/benchmark.py @@ -55,7 +55,10 @@ def ray_trace(gpu, number=1000): gpu.kernels.ray_trace(np.int32(pixels_gpu.size), origins_gpu, directions_gpu, pixels_gpu, block=(gpu.nthreads_per_block,1,1), grid=(pixels_gpu.size//gpu.nthreads_per_block+1,1)) gpu.context.synchronize() elapsed = time.time() - t0 - run_times.append(elapsed) + + if i > 0: + # first kernel call incurs some driver overhead + run_times.append(elapsed) return pixels_gpu.size/ufloat((np.mean(run_times),np.std(run_times))) @@ -82,7 +85,10 @@ def propagate(gpu, number=10, nphotons=500000): gpu.propagate() gpu.context.synchronize() elapsed = time.time() - t0 - run_times.append(elapsed) + + if i > 0: + # first kernel call incurs some driver overhead + run_times.append(elapsed) return nphotons/ufloat((np.mean(run_times),np.std(run_times))) |