Skip to content
Snippets Groups Projects
Commit c7ee3931 authored by Prakalp Srivastava's avatar Prakalp Srivastava
Browse files

Fixed a bug in calculating opencl timers average

parent 18e12d80
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,7 @@ import StringIO
import re
import actions
import csv
import copy
import globals
def invalid_option_message(progname, cmd, args):
......@@ -257,9 +258,9 @@ def time_options(progname, cmd, args):
return val
def compileTimings(timings):
label_f = 'Final'
label_pb = 'Parboil'
if len(timings) == 4:
label_f = 'Final'
label_pb = 'Parboil'
label_ptx = 'NVPTX_Timer'
label_x86 = 'X86_Timer'
label_gen = 'GenVISC_Timer'
......@@ -279,13 +280,13 @@ def time_options(progname, cmd, args):
timings[label_f]['WorkGroup Size Calculation'] = addTime([(label_ptx, 'Misc')], timings)
timings[label_f]['Kernel'] = addTime([(label_ptx, 'Kernel')], timings)
timings[label_f]['Read Output'] = addTime([(label_ptx, 'Read_Output'), (label_pb, 'Copy')], timings)
timings[label_f]['Free Memory'] = addTime([(label_ptx, 'Mem_Free'), (label_ptx, 'Mem_Untrack')], timings)
timings[label_f]['Free Memory'] = addTime([(label_ptx, 'Mem_Free'), (label_pb, 'Mem_Untrack')], timings)
timings[label_f]['Clear Context'] = addTime([(label_ptx, 'Clear_Ctx')], timings)
timings[label_f]['Timer Wall Time'] = addTime([(label_pb, 'Timer Wall Time')], timings)
else:
if len(timings) == 1:
label_f = 'Final'
label_pb = 'Parboil'
timings[label_f] = timings[label_pb]
timings[label_f] = copy.deepcopy(timings[label_pb])
timings[label_f]['Timer Wall - IO'] = timings[label_f]['Timer Wall Time'] - timings[label_f]['IO']
def parseLogForTimer():
timings = {}
......@@ -302,10 +303,13 @@ def time_options(progname, cmd, args):
if timerName != 'NVPTX_Timer' and timerName != 'X86_Timer' and timerName != 'GenVISC_Timer':
print "Warning: Found unknown timer " + timerName
continue
m = re.search('(?P<timerID>[a-zA-Z _]+) *: *(?P<value>[0-9]*\.[0-9]*) *$', line)
m = re.search('(?P<timerID>[a-zA-Z _/]+) *: *(?P<value>[0-9]*\.[0-9]*) *$', line)
if m:
if timings[timerName] is not None:
timings[timerName][m.group('timerID').strip()] = float(m.group('value').strip())
#print timings[timerName][m.group('timerID').strip()]
#print m.group('value').strip()
#print
else:
print "Error: Found unknown timer:" + timerName
if timings is not {}:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment