|
10 | 10 | #include <regex>
|
11 | 11 | #include <sstream>
|
12 | 12 | #include <vector>
|
| 13 | +#include <fstream> |
13 | 14 |
|
14 | 15 | namespace cldnn {
|
15 | 16 | const char *debug_configuration::prefix = "GPU_Debug: ";
|
| 17 | +std::ostream* debug_configuration::verbose_stream; |
16 | 18 |
|
17 | 19 | // Default policy is that dump_configuration will override other configuration from IE.
|
18 | 20 |
|
@@ -128,6 +130,7 @@ static void print_help_messages() {
|
128 | 130 | message_list.emplace_back("OV_GPU_Help", "Print help messages");
|
129 | 131 | message_list.emplace_back("OV_GPU_Verbose", "Verbose execution");
|
130 | 132 | message_list.emplace_back("OV_GPU_VerboseColor", "Print verbose color");
|
| 133 | + message_list.emplace_back("OV_GPU_VerboseFile", "Filename to dump verbose log"); |
131 | 134 | message_list.emplace_back("OV_GPU_ListLayers", "Print layers names");
|
132 | 135 | message_list.emplace_back("OV_GPU_PrintMultiKernelPerf", "Print execution time of each kernel in multi-kernel primitimive");
|
133 | 136 | message_list.emplace_back("OV_GPU_PrintInputDataShapes", "Print data_shapes of input layers for benchmark_app.");
|
@@ -214,6 +217,7 @@ debug_configuration::debug_configuration()
|
214 | 217 | : help(0)
|
215 | 218 | , verbose(0)
|
216 | 219 | , verbose_color(0)
|
| 220 | + , verbose_file() |
217 | 221 | , list_layers(0)
|
218 | 222 | , print_multi_kernel_perf(0)
|
219 | 223 | , print_input_data_shapes(0)
|
@@ -255,6 +259,7 @@ debug_configuration::debug_configuration()
|
255 | 259 | get_gpu_debug_env_var("Help", help);
|
256 | 260 | get_common_debug_env_var("Verbose", verbose);
|
257 | 261 | get_gpu_debug_env_var("VerboseColor", verbose_color);
|
| 262 | + get_gpu_debug_env_var("VerboseFile", verbose_file); |
258 | 263 | get_gpu_debug_env_var("ListLayers", list_layers);
|
259 | 264 | get_gpu_debug_env_var("PrintMultiKernelPerf", print_multi_kernel_perf);
|
260 | 265 | get_gpu_debug_env_var("PrintInputDataShapes", print_input_data_shapes);
|
@@ -316,6 +321,14 @@ debug_configuration::debug_configuration()
|
316 | 321 | exit(0);
|
317 | 322 | }
|
318 | 323 |
|
| 324 | + if (verbose_file.length() > 0) { |
| 325 | + static std::ofstream fout; |
| 326 | + fout.open(verbose_file); |
| 327 | + verbose_stream = &fout; |
| 328 | + } else { |
| 329 | + verbose_stream = &std::cout; |
| 330 | + } |
| 331 | + |
319 | 332 | if (dump_prof_data_iter_str.length() > 0) {
|
320 | 333 | dump_prof_data_iter_str = " " + dump_prof_data_iter_str + " ";
|
321 | 334 | std::istringstream iss(dump_prof_data_iter_str);
|
|
0 commit comments