summaryrefslogtreecommitdiff
path: root/src/performance.h
diff options
context:
space:
mode:
authorYongjia Zhang <zhang_yong_jia@126.com>2014-04-01 17:16:46 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-04-02 10:54:40 +0800
commitebd86bf4ca91b6ac14e85a44ade4fde00178f743 (patch)
tree2650b5bcd15d762bf63bc83d2abfd85b2c870eb3 /src/performance.h
parent8bc5ac8b591a162837105c9b8dd430ab203e9dde (diff)
Add kernels performance output
if environment variable OCL_OUTPUT_KERNEL_PERF is set non-zero, then after the executable program exits, beignet will output the time information of each kernel executed. v2:fixed the patch's trailing whitespace problem. v3:if OCL_OUTPUT_KERNEL_PERF is 1, then the output will only contains time summary, if it is 2, then the output will contain time summary and detail. Add output 'Ave' and 'Dev', 'Ave' is the average time per kernel per execution round, 'Dev' is the result of 'Ave' divide a kernel's all executions' standard deviation. Signed-off-by: Yongjia Zhang <yongjia.zhang@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'src/performance.h')
-rw-r--r--src/performance.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/performance.h b/src/performance.h
new file mode 100644
index 00000000..c747743c
--- /dev/null
+++ b/src/performance.h
@@ -0,0 +1,12 @@
+#ifndef __PERFORMANCE_H__
+#define __PERFORMANCE_H__
+#include "CL/cl.h"
+
+
+extern int b_output_kernel_perf;
+void time_start(cl_context context, const char * kernel_name, cl_command_queue cq);
+void time_end(cl_context context, const char * kernel_name, cl_command_queue cq);
+void initialize_env_var();
+
+
+#endif