Skip to content

Commit

Permalink
Apply comments
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Park <[email protected]>
  • Loading branch information
andrew-k-park committed Feb 26, 2024
1 parent 0a21cde commit bcff601
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/plugins/intel_gpu/src/graph/primitive_inst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2076,9 +2076,9 @@ void primitive_inst::add_profiling_data(instrumentation::pipeline_stage stage, b
#ifdef GPU_DEBUG_CONFIG
int64_t curr_iter = -1;
GPU_DEBUG_IF(debug_config->dump_prof_data_iter_params.is_enabled) {
curr_iter = get_network().get_current_iteration_num();
curr_iter = get_network().get_current_iteration_num() - 1;
}
GPU_DEBUG_IF(debug_config->is_target_dump_prof_data_iteration(curr_iter)) {
GPU_DEBUG_IF(curr_iter < 0 || debug_config->is_target_dump_prof_data_iteration(curr_iter)) {
#else
{
#endif
Expand All @@ -2089,7 +2089,7 @@ void primitive_inst::add_profiling_data(instrumentation::pipeline_stage stage, b
get_implementation_name(),
stage,
#ifdef GPU_DEBUG_CONFIG
per_iter_mode ? get_network().get_current_iteration_num() : 0,
per_iter_mode ? get_network().get_current_iteration_num() - 1 : 0,
#else
0,
#endif
Expand Down
15 changes: 8 additions & 7 deletions src/plugins/intel_gpu/src/runtime/debug_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,14 @@ debug_configuration::debug_configuration()
dump_prof_data_iter_str = " " + dump_prof_data_iter_str + " ";
std::istringstream iss(dump_prof_data_iter_str);
char dot;
int start, end;
int64_t start, end;
bool is_valid_range = false;
if (iss >> start >> dot >> dot >> end) {
if (start < end) {
if (start <= end || end == -1) {
try {
is_valid_range = true;
dump_prof_data_iter_params.start = static_cast<int64_t>(start);
dump_prof_data_iter_params.end = static_cast<int64_t>(end);
dump_prof_data_iter_params.start = start;
dump_prof_data_iter_params.end = end;
} catch(const std::exception& ex) {
is_valid_range = false;
}
Expand Down Expand Up @@ -389,10 +389,11 @@ bool debug_configuration::is_target_dump_prof_data_iteration(int64_t iteration)
if (iteration < 0)
return true;

if (!dump_prof_data_iter_params.is_enabled)
return true;
if (dump_prof_data_iter_params.start > iteration)
return false;

if (dump_prof_data_iter_params.start > iteration || dump_prof_data_iter_params.end < iteration)
if (dump_prof_data_iter_params.start <= dump_prof_data_iter_params.end &&
dump_prof_data_iter_params.end < iteration)
return false;

return true;
Expand Down

0 comments on commit bcff601

Please sign in to comment.