From: 윤지영/On-Device Lab(SR)/Staff Engineer/삼성전자 Date: Tue, 2 Jul 2019 10:03:37 +0000 (+0900) Subject: [kbenchmark] Update summary view of html file (#5519) X-Git-Tag: submit/tizen/20190809.050447~609 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b2a439a8c328c6c2b8573befba761c29e306c6a4;p=platform%2Fcore%2Fml%2Fnnfw.git [kbenchmark] Update summary view of html file (#5519) * [kbenchmark] Update summary view of html file This patch generates a summary view of html file. This will help you to see at a glance which graph shows which kernel performs well in the current layer. Signed-off-by: Jiyoung Yun * Change the location of the html_report_template.g.h++ that needs copy to cmake/packages/Nonius directory --- diff --git a/cmake/packages/Nonius/html_report_template.g.h++ b/cmake/packages/Nonius/html_report_template.g.h++ new file mode 100644 index 0000000..fa159c6 --- /dev/null +++ b/cmake/packages/Nonius/html_report_template.g.h++ @@ -0,0 +1,433 @@ +"\n" +"\n" +" \n" +" \n" +" {$title} - nonius report\n" +" \n" +" \n" +" \n" +" \n" +"
\n" +" \n" +"
\n" +" \n" +, +" \n" +"
\n" +"
\n" +"
\n" +"
Generated with nonius
\n" +" \n" +" \n" +"\n" diff --git a/cmake/packages/NoniusConfig.cmake b/cmake/packages/NoniusConfig.cmake index 35f373a..2b5778e 100644 --- a/cmake/packages/NoniusConfig.cmake +++ b/cmake/packages/NoniusConfig.cmake @@ -12,6 +12,14 @@ function(_Nonius_import) target_include_directories(nonius INTERFACE "${NoniusSource_DIR}/include") endif(NOT TARGET nonius) + if(BUILD_KBENCHMARK) + # Copy html_report_template.g.h++ file to externals/nonius. + # This header file is modified to show the html summary view according to the layer in kbenchmark. + execute_process(COMMAND ${CMAKE_COMMAND} -E copy + "${CMAKE_CURRENT_LIST_DIR}/Nonius/html_report_template.g.h++" + "${NoniusSource_DIR}/include/nonius/detail") + endif(BUILD_KBENCHMARK) + set(Nonius_FOUND TRUE PARENT_SCOPE) endfunction(_Nonius_import) diff --git a/tools/kbenchmark/Driver.cc b/tools/kbenchmark/Driver.cc index 376a851..f2874d5 100644 --- a/tools/kbenchmark/Driver.cc +++ b/tools/kbenchmark/Driver.cc @@ -129,7 +129,7 @@ int main(int argc, char *argv[]) cfg.output_file = temp_name + ext; } - nonius::parameters op_params = opl[cf.name()]->params(c.second); + nonius::parameters op_params = opl[cf.name()]->params(c.first, c.second); cfg.params.map = cfg.params.map.merged(op_params); nonius::go(cfg, benchmarks); diff --git a/tools/kbenchmark/Operation.h b/tools/kbenchmark/Operation.h index 386f08a..4bf1e8c 100644 --- a/tools/kbenchmark/Operation.h +++ b/tools/kbenchmark/Operation.h @@ -29,7 +29,7 @@ class Operation public: Operation() = default; - virtual nonius::parameters params(OperationInfo &info) = 0; + virtual nonius::parameters params(int layer_num, OperationInfo &info) = 0; }; } // namespace kbenchmark diff --git a/tools/kbenchmark/operations/Convolution.h b/tools/kbenchmark/operations/Convolution.h index 2f3b60b..a3dc416 100644 --- a/tools/kbenchmark/operations/Convolution.h +++ b/tools/kbenchmark/operations/Convolution.h @@ -30,10 +30,12 @@ class Convolution final : public Operation public: Convolution() = default; - nonius::parameters params(OperationInfo &info) override + nonius::parameters params(int layer_num, OperationInfo &info) override { nonius::parameters params; + params.insert({"LAYER", nonius::param{layer_num}}); + params.insert({"BATCH", nonius::param{1}}); auto _input = get_key_dims({"input"}, info);