Commit af5340d8 authored by Sergey Shalnov's avatar Sergey Shalnov Committed by Scott Cyphers

A backend property request (#2281)

* A backend property request

* Update backend.hpp

* PR2281. Add get property function to CPU backend

* Update backend.hpp
parent e8b1ece5
......@@ -124,6 +124,16 @@ public:
/// \returns true if the op is supported, false otherwise.
virtual bool is_supported(const Node& node) const;
/// \brief A set of properties supported by a backend
enum class Property
{
memory_attach /// New tensor can use attached memory
};
/// \brief Test if a backend particular property is supported
/// \param prop is the feature to test.
/// \returns true if the property is supported, false otherwise.
virtual bool is_supported_property(const Property prop) const { return false; }
void validate(std::shared_ptr<const Function> func,
const std::vector<std::shared_ptr<runtime::Tensor>>& outputs,
const std::vector<std::shared_ptr<runtime::Tensor>>& inputs);
......
......@@ -150,3 +150,13 @@ bool runtime::cpu::CPU_Backend::is_supported(const Node& op) const
{
return true;
}
bool runtime::cpu::CPU_Backend::is_supported_property(const Property prop) const
{
if (prop == Property::memory_attach)
{
return true;
}
return false;
}
......@@ -59,6 +59,7 @@ namespace ngraph
get_performance_data(std::shared_ptr<Function> func) const override;
bool is_supported(const Node& node) const override;
bool is_supported_property(const Property prop) const override;
private:
class FunctionInstance
......
......@@ -2106,3 +2106,13 @@ void runtime::intelgpu::IntelGPUBackend::print_call_performance(
cout.flags(saved_stream_flags); // Restore stream configuration to leave it in original state
}
bool runtime::intelgpu::IntelGPUBackend::is_supported_property(const Property prop) const
{
if (prop == Property::memory_attach)
{
return true;
}
return false;
}
......@@ -58,6 +58,8 @@ public:
std::vector<PerformanceCounter>
get_performance_data(std::shared_ptr<Function> func) const override;
bool is_supported_property(const Property prop) const override;
private:
class FunctionInstance
{
......
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