| Top |
|
|
(*UfoProfilerFunc) () |
| UfoProfiler * | ufo_profiler_new () |
|
|
ufo_profiler_call () |
|
|
ufo_profiler_call_blocking () |
|
|
ufo_profiler_register_event () |
|
|
ufo_profiler_foreach () |
|
|
ufo_profiler_start () |
|
|
ufo_profiler_stop () |
|
|
ufo_profiler_trace_event () |
|
|
ufo_profiler_enable_tracing () |
|
|
ufo_profiler_get_trace_events () |
|
|
ufo_profiler_elapsed () |
| struct | UfoProfiler |
| struct | UfoProfilerClass |
| enum | UfoTraceEventType |
| #define | UFO_TRACE_EVENT_TYPE_MASK |
| #define | UFO_TRACE_EVENT_TIME_MASK |
| UfoTraceEvent | |
| enum | UfoProfilerTimer |
The UfoProfiler provides a drop-in replacement for a manual
clEnqueueNDRangeKernel()
Each UfoTaskNode is assigned a profiler with ufo_task_node_set_profiler() by
the managing UfoBaseScheduler. Task implementations should call
ufo_task_node_get_profiler() to receive their profiler and make profiled
kernel calls with ufo_profiler_call().
void (*UfoProfilerFunc) (const,gchar *kernel,gconstpointer queue,gulong queued,gulong submitted,gulong start,gulong end);gpointer user_data
Specifies the type of functions passed to ufo_profiler_foreach().
kernel |
Kernel name |
|
queue |
OpenCL command queue |
|
queued |
Queuing timestamp in ns |
|
submitted |
Submit timestamp in ns |
|
start |
Start timestamp in ns |
|
end |
End timestamp in ns |
|
user_data |
User data passed to |
void ufo_profiler_call (UfoProfiler *profiler,,gpointer command_queue,gpointer kernel,guint work_dimconst,gsize *global_work_sizeconst);gsize *local_work_size
Execute the kernel
using the command queue and execution parameters. The
event associated with the clEnqueueNDRangeKernel()
profiler |
A UfoProfiler object. |
|
command_queue |
A |
|
kernel |
A |
|
work_dim |
Number of working dimensions. |
|
global_work_size |
Sizes of global dimensions. The array must have at least
|
|
local_work_size |
Sizes of local work group dimensions. The array must have
at least |
void ufo_profiler_call_blocking (UfoProfiler *profiler,,gpointer command_queue,gpointer kernel,guint work_dimconst,gsize *global_work_sizeconst);gsize *local_work_size
Execute the kernel
using the command queue and execution parameters and wait
for the kernel to finish. The event associated with the
clEnqueueNDRangeKernel()
profiler |
A UfoProfiler object. |
|
command_queue |
A |
|
kernel |
A |
|
work_dim |
Number of working dimensions. |
|
global_work_size |
Sizes of global dimensions. The array must have at least
|
|
local_work_size |
Sizes of local work group dimensions. The array must have
at least |
void ufo_profiler_register_event (UfoProfiler *profiler,,gpointer command_queue,gpointer kernel);gpointer event
Register a kernel execution manually
profiler |
A UfoProfiler object |
|
command_queue |
Queue the OpenCL event was issued with |
|
kernel |
An OpenCL kernel the event stems from |
|
event |
An OpenCL event |
void ufo_profiler_foreach (UfoProfiler *profiler,UfoProfilerFunc func,);gpointer user_data
Iterates through the recorded events and calls func
on each entry.
profiler |
A UfoProfiler object |
|
func |
The function to be called for an entry. |
[scope call] |
user_data |
User parameters |
void ufo_profiler_start (UfoProfiler *profiler,UfoProfilerTimer timer);
Start timer
. The timer is not reset but accumulates the time elapsed between
ufo_profiler_start() and ufo_profiler_stop() calls.
void ufo_profiler_stop (UfoProfiler *profiler,UfoProfilerTimer timer);
Stop timer
. The timer is not reset but accumulates the time elapsed between
ufo_profiler_start() and ufo_profiler_stop() calls.
void ufo_profiler_trace_event (UfoProfiler *profiler,UfoTraceEventType type);
Register a new trace event. The given event type, the thread id and the global time is stored when this function is called.
void ufo_profiler_enable_tracing (UfoProfiler *profiler,);gboolean enable
Enable or disable tracing of profiler
. Calls to ufo_profiler_trace_event()
will be ignored if tracing is disabled.
GList * ufo_profiler_get_trace_events (UfoProfiler *profiler);
Get all events recorded with profiler
.
[skip]
gdouble ufo_profiler_elapsed (UfoProfiler *profiler,UfoProfilerTimer timer);
Get the elapsed time in seconds for timer
.
struct UfoProfiler;
The UfoProfiler collects and records OpenCL events and stores them in a convenient format on disk or prints summaries on screen.
#define UFO_TRACE_EVENT_TYPE_MASK (UFO_TRACE_EVENT_PROCESS | UFO_TRACE_EVENT_GENERATE)
#define UFO_TRACE_EVENT_TIME_MASK (UFO_TRACE_EVENT_BEGIN | UFO_TRACE_EVENT_END)
typedef struct {
UfoTraceEventType type;
gpointer thread_id;
gdouble timestamp;
} UfoTraceEvent;
UfoTraceEventType |
Type of the event |
|
ID of thread in which the event was issued |
||
Arbitrary timestamp of the event |
Use these values to select a specific timer when calling
ufo_profiler_start(), ufo_profiler_stop() and ufo_profiler_elapsed().