Ufo.Profiler

g GObject.Object GObject.Object Ufo.Profiler Ufo.Profiler GObject.Object->Ufo.Profiler

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

call (command_queue, kernel, work_dim, global_work_size, local_work_size)

call_blocking (command_queue, kernel, work_dim, global_work_size, local_work_size)

elapsed (timer)

enable_tracing (enable)

foreach (func, *user_data)

register_event (command_queue, kernel, event)

start (timer)

stop (timer)

trace_event (type)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Ufo.Profiler(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Ufo.ProfilerClass

The Ufo.Profiler collects and records OpenCL events and stores them in a convenient format on disk or prints summaries on screen.

classmethod new()
Returns:

A new profiler object.

Return type:

Ufo.Profiler

Create a profiler object.

call(command_queue, kernel, work_dim, global_work_size, local_work_size)
Parameters:
  • command_queue (object or None) – A %cl_command_queue

  • kernel (object or None) – A %cl_kernel

  • work_dim (int) – Number of working dimensions.

  • global_work_size (int) – Sizes of global dimensions. The array must have at least work_dim entries.

  • local_work_size (int) – Sizes of local work group dimensions. The array must have at least work_dim entries.

Execute the kernel using the command queue and execution parameters. The event associated with the clEnqueueNDRangeKernel() call is recorded and may be used for profiling purposes later on.

call_blocking(command_queue, kernel, work_dim, global_work_size, local_work_size)
Parameters:
  • command_queue (object or None) – A %cl_command_queue

  • kernel (object or None) – A %cl_kernel

  • work_dim (int) – Number of working dimensions.

  • global_work_size (int) – Sizes of global dimensions. The array must have at least work_dim entries.

  • local_work_size (int) – Sizes of local work group dimensions. The array must have at least work_dim entries.

Execute the kernel using the command queue and execution parameters and wait for the kernel to finish. The event associated with the clEnqueueNDRangeKernel() call is recorded and may be used for profiling purposes later on.

elapsed(timer)
Parameters:

timer (Ufo.ProfilerTimer) – Which timer to start

Returns:

Elapsed time in seconds.

Return type:

float

Get the elapsed time in seconds for timer.

enable_tracing(enable)
Parameters:

enable (bool) – True if tracing should be enabled

Enable or disable tracing of self. Calls to Ufo.Profiler.trace_event() will be ignored if tracing is disabled.

foreach(func, *user_data)
Parameters:

Iterates through the recorded events and calls func on each entry.

register_event(command_queue, kernel, event)
Parameters:
  • command_queue (object or None) – Queue the OpenCL event was issued with

  • kernel (object or None) – An OpenCL kernel the event stems from

  • event (object or None) – An OpenCL event

Register a kernel execution manually

start(timer)
Parameters:

timer (Ufo.ProfilerTimer) – Which timer to start

Start timer. The timer is not reset but accumulates the time elapsed between Ufo.Profiler.start() and Ufo.Profiler.stop() calls.

stop(timer)
Parameters:

timer (Ufo.ProfilerTimer) – Which timer to stop

Stop timer. The timer is not reset but accumulates the time elapsed between Ufo.Profiler.start() and Ufo.Profiler.stop() calls.

trace_event(type)
Parameters:

type (Ufo.TraceEventType) – trav event type

Register a new trace event. The given event type, the thread id and the global time is stored when this function is called.