Skip to content
Snippets Groups Projects
Commit 1858ff16 authored by Marcel Koch's avatar Marcel Koch
Browse files

adds function to get ssc marks

parent 05a2c7d3
No related branches found
No related tags found
No related merge requests found
......@@ -170,12 +170,16 @@ def init_region_timer(region):
post_include("HP_DECLARE_TIMER({});".format(region), filetag="driver")
def get_region_marks(region):
return _sde_marks.setdefault(region, (2 * (len(_sde_marks) + 1), 2 * (len(_sde_marks) + 1) + 1))
def start_region_timer(region):
if get_option("use_likwid"):
return ["LIKWID_MARKER_START(\"{}\");".format(region)]
elif get_option("use_sde"):
_sde_marks[region + '_start'] = len(_sde_marks)
return ["__SSC_MARK(0x{});".format(_sde_marks[region + '_start'])]
marks = get_region_marks(region)
return ["__SSC_MARK(0x{});".format(marks[0])]
else:
return ["HP_TIMER_START({});".format(region)]
......@@ -184,10 +188,9 @@ def stop_region_timer(region):
if get_option("use_likwid"):
return ["LIKWID_MARKER_STOP(\"{}\");".format(region)]
elif get_option("use_sde"):
_sde_marks[region + '_stop'] = len(_sde_marks)
return ["__SSC_MARK(0x{});".format(_sde_marks[region + '_stop']),
"std::cout << \"Timed region {}: {} <--> {}\" << std::endl;".format(region, _sde_marks[region + '_start'],
_sde_marks[region + '_stop'])]
marks = get_region_marks(region)
return ["__SSC_MARK(0x{});".format(marks[1]),
"std::cout << \"Timed region {}: {} <--> {}\" << std::endl;".format(region, *marks)]
else:
timestream = name_timing_stream()
return ["HP_TIMER_STOP({});".format(region),
......
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