Skip to content

Commit

Permalink
Revert the canceld change
Browse files Browse the repository at this point in the history
  • Loading branch information
yeonbok committed Feb 21, 2022
1 parent aba5ccf commit 9674b91
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
11 changes: 4 additions & 7 deletions src/plugins/intel_gpu/include/intel_gpu/graph/program.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ struct program {
build_options const& options,
bool is_internal = false,
bool no_optimizations = false,
primitive_id parent_prim = "");
bool is_body_program = false);
/* constructor used to build a program from subset of nodes of other program (used in propagate_constants) */
program(engine& engine_ref,
std::set<std::shared_ptr<program_node>> const& nodes,
Expand All @@ -143,8 +143,7 @@ struct program {
std::vector<program_node*>& get_outputs() {
return outputs;
} // ToDo: redesign reorder-inputs pass to make it const as_well as get_engine and get options
bool is_loop_body() const { return parent_primitive != ""; }
primitive_id get_parent_primitive() const { return parent_primitive; }
bool is_loop_body() const { return is_body_program; }
bool is_debug_build() const { return options.get<build_option_type::debug>()->enabled(); }
const nodes_ordering& get_processing_order() const;
nodes_ordering& get_processing_order();
Expand Down Expand Up @@ -225,7 +224,7 @@ struct program {
const build_options& options,
bool is_internal = false,
bool no_optimizations = false,
primitive_id parent_primitive = "");
bool is_body_program = false);
static ptr build_program(engine& engine,
const std::set<std::shared_ptr<program_node>>& nodes,
const build_options& options,
Expand Down Expand Up @@ -254,9 +253,7 @@ struct program {
nodes_ordering processing_order;
std::unique_ptr<pass_manager> pm;
std::shared_ptr<kernel_selector::TuningCache> tuning_cache;

// parent primitive of loop body program
primitive_id parent_primitive = "";
bool is_body_program;

std::map<primitive_id, std::shared_ptr<program_node>> nodes_map;
std::list<primitive_id> optimized_out;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/intel_gpu/src/graph/include/loop_inst.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ struct typed_program_node<loop> : public typed_program_node_base<loop> {
auto opts = get_program().get_options();
std::vector<primitive_id> output_names_vec(output_names.begin(), output_names.end());
opts.set_option(build_option::outputs(output_names_vec));
body_program = program::build_program(get_program().get_engine(), body, opts, false, false, this->id());
body_program = program::build_program(get_program().get_engine(), body, opts, false, false, true);
}

const primitive_id& get_trip_count_id() const { return get_primitive()->trip_count_id; }
Expand Down
13 changes: 6 additions & 7 deletions src/plugins/intel_gpu/src/graph/include/program_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,6 @@ struct program_node {
virtual ~program_node() = default;

public:
static size_t unique_id_gen() {
return cur_id++;
}
static void reset_unique_id() {
cur_id = 0;
}
virtual const primitive_id& id() const { return desc->id; }
virtual primitive_type_id type() const { return desc->type; }
virtual std::shared_ptr<kernel_selector::fuse_params> get_fuse_params() const { return nullptr; }
Expand Down Expand Up @@ -359,8 +353,13 @@ struct program_node {
bool need_lockable_memory() const;

size_t get_unique_id() const { return unique_id; }

void set_unique_id() {
unique_id = unique_id_gen();
unique_id = cur_id++;
}

static void reset_unique_id() {
cur_id = 0;
}

protected:
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/intel_gpu/src/graph/program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ program::program(engine& engine_ref,
build_options const& options,
bool is_internal,
bool no_optimizations,
primitive_id parent_id)
bool is_body_program)
: _engine(engine_ref),
_stream(_engine.create_stream()),
options(options),
processing_order(),
tuning_cache(nullptr),
parent_primitive(parent_id) {
is_body_program(is_body_program) {
init_primitives();
set_options();
pm = std::unique_ptr<pass_manager>(new pass_manager(*this));
Expand Down Expand Up @@ -181,8 +181,8 @@ program::ptr program::build_program(engine& engine,
const build_options& options,
bool is_internal,
bool no_optimizations,
primitive_id parent_id) {
return std::make_shared<program>(engine, topology, options, is_internal, no_optimizations, parent_id);
bool is_body_program) {
return std::make_shared<program>(engine, topology, options, is_internal, no_optimizations, is_body_program);
}

program::ptr program::build_program(engine& engine,
Expand Down

0 comments on commit 9674b91

Please sign in to comment.