29 #ifndef _CCL_PROFILER_H_
30 #define _CCL_PROFILER_H_
520 CCLProf* prof,
const char* event_name);
577 CCLProf* prof,
int agg_sort,
int ovlp_sort);
struct ccl_prof_info CCLProfInfo
Event profiling info.
Sort event profiling info instances by end time.
cl_bool ccl_prof_export_info_file(CCLProf *prof, const char *filename, CCLErr **err)
Helper function which exports profiling info to a given file, automatically opening and closing the f...
const char * queue_name
Name of command queue which generated this event.
cl_ulong t_submit
Device time counter in nanoseconds when the command identified by event that has been enqueued is sub...
Sort event profiling info instances by queued time.
struct ccl_prof_overlap CCLProfOverlap
Representation of an overlap of events.
void ccl_prof_iter_overlap_init(CCLProf *prof, int sort)
Initialize an iterator for overlap instances.
double ccl_prof_time_elapsed(CCLProf *prof)
If profiling has started but not stopped, returns the time since the profiling started.
cl_ulong duration
Overlap duration in nanoseconds.
CCLProfAggSort
Sort criteria for aggregate event info instances.
cl_ulong ccl_prof_get_duration(CCLProf *prof)
Get duration of all events in nanoseconds.
Representation of an overlap of events.
Sort overlaps by event name.
const char * event_name
Name of event which the instant refers to.
cl_bool ccl_prof_calc(CCLProf *prof, CCLErr **err)
Determine aggregate statistics for the given profile object.
void ccl_prof_iter_agg_init(CCLProf *prof, int sort)
Initialize an iterator for profiled aggregate event instances.
cl_bool zero_start
Start at instant 0 (TRUE, default), or start at oldest instant returned by OpenCL (FALSE)...
Sort ascending (default).
Sort overlaps by overlap duration.
Command queue wrapper class.
CCLProf * ccl_prof_new()
Create a new profile object.
Sort event profiling info instances by event name.
const char * evname_delim
Event name delimiter, defaults to empty string.
cl_ulong t_start
Device time in nanoseconds when the command identified by event starts execution on the device...
cl_ulong ccl_prof_get_eff_duration(CCLProf *prof)
Get effective duration of all events in nanoseconds, i.e.
Sort event profiling info instances by submit time.
void ccl_prof_stop(CCLProf *prof)
Stops the global profiler timer.
Sort event instants by event id.
const CCLProfInfo * ccl_prof_iter_info_next(CCLProf *prof)
Return the next event profiling info instance.
void ccl_prof_start(CCLProf *prof)
Starts the global profiler timer.
const char * ccl_prof_get_summary(CCLProf *prof, int agg_sort, int ovlp_sort)
Get a summary with the profiling info.
const CCLProfAgg * ccl_prof_get_agg(CCLProf *prof, const char *event_name)
Return aggregate statistics for events with the given name.
const CCLProfOverlap * ccl_prof_iter_overlap_next(CCLProf *prof)
Return the next overlap instance.
Sort aggregate event data instances by name.
cl_command_type command_type
Type of command which produced the event.
cl_uint id
Event instant ID.
Sort event profiling info instances by start time.
struct ccl_prof_inst CCLProfInst
Event instant.
CCLProfOverlapSort
Sort criteria for overlaps (CCLProfOverlap).
struct ccl_prof_export_options CCLProfExportOptions
Export options.
Sort aggregate event data instances by time.
void ccl_prof_destroy(CCLProf *prof)
Destroy a profile object.
cl_bool ccl_prof_export_info(CCLProf *prof, FILE *stream, CCLErr **err)
Export event profiling information to a given stream.
void ccl_prof_iter_inst_init(CCLProf *prof, int sort)
Initialize an iterator for event instant instances.
const char * queue_delim
Queue name delimiter, defaults to empty string.
CCLProfExportOptions ccl_prof_get_export_opts()
Get current export options.
void ccl_prof_set_export_opts(CCLProfExportOptions export_opts)
Set export options using a CCLProfExportOptions struct.
cl_ulong t_queued
Device time in nanoseconds when the command identified by event is enqueued in a command-queue by the...
const CCLProfInst * ccl_prof_iter_inst_next(CCLProf *prof)
Return the next event instant instance.
Convert OpenCL error codes to readable strings (function header).
void ccl_prof_add_queue(CCLProf *prof, const char *cq_name, CCLQueue *cq)
Add a command queue wrapper for profiling.
const char * event2_name
Name of second overlapping event.
cl_ulong instant
Event instant in nanoseconds from current device time counter.
Sort event profiling info instances by queue name.
struct ccl_prof_agg CCLProfAgg
Aggregate event info.
void ccl_prof_iter_info_init(CCLProf *prof, int sort)
Initialize an iterator for event profiling info instances.
GError CCLErr
Error handling class.
Common cf4ocl definitions.
const char * event1_name
Name of first overlapping event.
const char * separator
Field separator, defaults to tab (\t).
CCLProfInfoSort
Sort criteria for event profiling info instances.
void ccl_prof_print_summary(CCLProf *prof)
Print a summary of the profiling info.
CCLProfSortOrder
Sort order for the profile module iterators.
double relative_time
Relative time of events with name equal to CCLProfAgg::event_name.
Profile class, contains profiling information of OpenCL queues and events.
CCLProfInstSort
Sort criteria for event instants (CCLProfInst).
cl_ulong t_end
Device time in nanoseconds when the command identified by event has finished execution on the device...
CCLProfInstType type
Type of event instant (CCL_PROF_INST_TYPE_START or CCL_PROF_INST_TYPE_END).
const char * newline
Newline character, Defaults to Unix newline (\n).
cl_ulong absolute_time
Total (absolute) time of events with name equal to CCLProfAgg::event_name.
CCLProfInstType
Type of event instant (CCLProfInst).
Definition of a wrapper class and its methods for OpenCL queue objects.
const CCLProfAgg * ccl_prof_iter_agg_next(CCLProf *prof)
Return the next aggregate statistic instance.
Sort event instants by instant.