Commit e873255d authored by Robert Kimball's avatar Robert Kimball

add backend remove_compiled_function

parent 1132afe5
...@@ -144,6 +144,10 @@ bool runtime::Backend::is_supported_property(const Property prop) const ...@@ -144,6 +144,10 @@ bool runtime::Backend::is_supported_property(const Property prop) const
return false; return false;
} }
void runtime::Backend::remove_compiled_function(std::shared_ptr<Executable> exec)
{
}
bool runtime::Backend::call_with_validate( bool runtime::Backend::call_with_validate(
std::shared_ptr<Executable> exec, std::shared_ptr<Executable> exec,
const std::vector<std::shared_ptr<runtime::Tensor>>& outputs, const std::vector<std::shared_ptr<runtime::Tensor>>& outputs,
......
...@@ -101,6 +101,8 @@ public: ...@@ -101,6 +101,8 @@ public:
/// \returns true if the property is supported, false otherwise. /// \returns true if the property is supported, false otherwise.
virtual bool is_supported_property(const Property prop) const; virtual bool is_supported_property(const Property prop) const;
virtual void remove_compiled_function(std::shared_ptr<Executable> exec);
/// The following methods are temporary hacks to reduce the number of changes in this PR /// The following methods are temporary hacks to reduce the number of changes in this PR
/// They will be removed in a follow-on PR /// They will be removed in a follow-on PR
bool call_with_validate(std::shared_ptr<Executable> handle, bool call_with_validate(std::shared_ptr<Executable> handle,
......
...@@ -121,6 +121,18 @@ bool runtime::cpu::CPU_Executable::call(const vector<shared_ptr<runtime::Tensor> ...@@ -121,6 +121,18 @@ bool runtime::cpu::CPU_Executable::call(const vector<shared_ptr<runtime::Tensor>
return rc; return rc;
} }
void runtime::cpu::CPU_Backend::remove_compiled_function(shared_ptr<Executable> exec)
{
for (auto it = m_exec_map.begin(); it != m_exec_map.end(); ++it)
{
if (it->second == exec)
{
m_exec_map.erase(it);
break;
}
}
}
vector<runtime::PerformanceCounter> runtime::cpu::CPU_Executable::get_performance_data() const vector<runtime::PerformanceCounter> runtime::cpu::CPU_Executable::get_performance_data() const
{ {
vector<runtime::PerformanceCounter> rc; vector<runtime::PerformanceCounter> rc;
......
...@@ -49,6 +49,8 @@ namespace ngraph ...@@ -49,6 +49,8 @@ namespace ngraph
compile(std::shared_ptr<Function> func, compile(std::shared_ptr<Function> func,
bool enable_performance_counters = false) override; bool enable_performance_counters = false) override;
void remove_compiled_function(shared_ptr<Executable> exec) override;
bool is_supported(const Node& node) const override; bool is_supported(const Node& node) const override;
bool is_supported_property(const Property prop) const override; bool is_supported_property(const Property prop) const override;
......
...@@ -1903,9 +1903,16 @@ bool runtime::intelgpu::IntelGPUExecutable::call(const vector<shared_ptr<runtime ...@@ -1903,9 +1903,16 @@ bool runtime::intelgpu::IntelGPUExecutable::call(const vector<shared_ptr<runtime
return true; return true;
} }
void runtime::intelgpu::IntelGPUBackend::remove_compiled_function(shared_ptr<Function> func) void runtime::intelgpu::IntelGPUBackend::remove_compiled_function(shared_ptr<Executable> exec)
{ {
ocl_networks.erase(func); for (auto it = ocl_networks.begin(); it != ocl_networks.end(); ++it)
{
if (it->second == exec)
{
ocl_networks.erase(it);
break;
}
}
} }
// The cldnn::network contains something like "generic_layer_0_Parameter_254_0" names // The cldnn::network contains something like "generic_layer_0_Parameter_254_0" names
......
...@@ -50,7 +50,7 @@ public: ...@@ -50,7 +50,7 @@ public:
std::shared_ptr<runtime::Executable> compile(std::shared_ptr<Function> func, std::shared_ptr<runtime::Executable> compile(std::shared_ptr<Function> func,
bool enable_timing = false) override; bool enable_timing = false) override;
void remove_compiled_function(std::shared_ptr<Function> func); void remove_compiled_function(std::shared_ptr<runtime::Executable> exec) override;
bool is_supported_property(const Property prop) const override; bool is_supported_property(const Property prop) const override;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment