Top | ![]() |
![]() |
![]() |
![]() |
|
(*UfoProfilerFunc) () |
UfoProfiler * | ufo_profiler_new () |
|
ufo_profiler_call () |
|
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 ufo_profiler_set_profiler()
ufo_filter_get_profiler()
ufo_profiler_call()
.
Moreover, a profiler object is used to measure wall clock time for I/O, synchronization and general CPU computation.
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_register_event (UfoProfiler *profiler
,,
gpointer command_queue,
gpointer kernel);
gpointer event
void ufo_profiler_foreach (UfoProfiler *profiler
,UfoProfilerFunc func
,);
gpointer user_data
Iterates through the recorded events and calls func
for 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
);
void ufo_profiler_enable_tracing (UfoProfiler *profiler
,);
gboolean enable
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()
.