Profiling GPU Code¶
Module for profiling OpenCL GPU code execution.
-
class
syris.profiling.
DummyProfiler
¶ A profiler which does nothing for saving time.
-
add
(event, func_name='')¶ Does nothing with input arguments.
-
-
class
syris.profiling.
ProfileReconstructor
(file_name, str_units)¶ Profile reconstructor which handles the profiling file created by
Profiler
.-
get_data
(attr)¶ Get data in a dictionary aggregated to a multidictionary. attr is a record attribute which will serve as a key to the top level of result dictionary. Return a dictionary in form {attr: {event_id: Event}}.
-
-
class
syris.profiling.
Profiler
(queues, file_name)¶ An OpenCL GPU code PROFILER.
-
add
(event, func_name='')¶ Add an OpenCL event and function with name func_name into the PROFILER’s queue.
-
run
()¶ Run in a separate thread and serve the incoming events.
-
shutdown
()¶ Wait for all events to finish and then stop the PROFILER loop.
-
-
syris.profiling.
plot
(data, attribute, states, file_units, out_units, start_from=0, stop_at=1.7976931348623157e+308, delta=0.0, only_averages=False)¶ Plot the profiling information, where
- data - a dictionary in the form {id: {event_id: values}}
- attribute - (event_id, device_id, queue_id)
- states - OpenCL Event states to use as beginning and end
- file_units - units used in the profiling file
- out_units - units used for output
- start_from - plot events started after start_from
- stop_at - plot events started before stop_at
- delta - plot only events with duration >= delta
- only_averages - outputs only the average timings