Commit d172456c authored by fenglei.tian's avatar fenglei.tian

using temple

parent 8db26428
...@@ -105,7 +105,7 @@ namespace ngraph ...@@ -105,7 +105,7 @@ namespace ngraph
namespace gpu namespace gpu
{ {
template <> template <>
void CPU_Emitter::EMITTER_DECL(ngraph::op::Abs) void GPU_Emitter::EMITTER_DECL(ngraph::op::Abs)
{ {
writer << "{ // " << node->get_name() << "\n"; writer << "{ // " << node->get_name() << "\n";
writer.indent++; writer.indent++;
...@@ -118,7 +118,7 @@ template <> ...@@ -118,7 +118,7 @@ template <>
} }
template <> template <>
void CPU_Emitter::EMITTER_DECL(ngraph::op::Add) void GPU_Emitter::EMITTER_DECL(ngraph::op::Add)
{ {
writer << "{ // " << node->get_name() << "\n"; writer << "{ // " << node->get_name() << "\n";
writer.indent++; writer.indent++;
...@@ -157,9 +157,9 @@ cudnnSetOpTensorDescriptor(opTensorDesc, ...@@ -157,9 +157,9 @@ cudnnSetOpTensorDescriptor(opTensorDesc,
} }
template <> template <>
void CPU_Emitter::EMITTER_DECL(ngraph::op::Dot) void GPU_Emitter::EMITTER_DECL(ngraph::op::Dot)
{ {
const ngraph::op::Dot* dot = static_cast<const ngraph::op::Dot*>(n); const ngraph::op::Dot* dot = static_cast<const ngraph::op::Dot*>(node);
const Shape& arg0_shape = args[0].get_shape(); const Shape& arg0_shape = args[0].get_shape();
const Shape& arg1_shape = args[1].get_shape(); const Shape& arg1_shape = args[1].get_shape();
if (arg0_shape.empty() || arg1_shape.empty()) if (arg0_shape.empty() || arg1_shape.empty())
...@@ -279,7 +279,7 @@ template <> ...@@ -279,7 +279,7 @@ template <>
} }
template <> template <>
void CPU_Emitter::EMITTER_DECL(ngraph::op::Maximum) void GPU_Emitter::EMITTER_DECL(ngraph::op::Maximum)
{ {
writer << "{ // " << node->get_name() << "\n"; writer << "{ // " << node->get_name() << "\n";
writer.indent++; writer.indent++;
...@@ -318,7 +318,7 @@ cudnnSetOpTensorDescriptor(opTensorDesc, ...@@ -318,7 +318,7 @@ cudnnSetOpTensorDescriptor(opTensorDesc,
} }
template <> template <>
void CPU_Emitter::EMITTER_DECL(ngraph::op::Minimum) void GPU_Emitter::EMITTER_DECL(ngraph::op::Minimum)
{ {
writer << "{ // " << node->get_name() << "\n"; writer << "{ // " << node->get_name() << "\n";
writer.indent++; writer.indent++;
...@@ -357,7 +357,7 @@ cudnnSetOpTensorDescriptor(opTensorDesc, ...@@ -357,7 +357,7 @@ cudnnSetOpTensorDescriptor(opTensorDesc,
} }
template <> template <>
void CPU_Emitter::EMITTER_DECL(ngraph::op::Negative) void GPU_Emitter::EMITTER_DECL(ngraph::op::Negative)
{ {
writer << "{ // " << node->get_name() << "\n"; writer << "{ // " << node->get_name() << "\n";
writer.indent++; writer.indent++;
...@@ -396,9 +396,9 @@ cudnnSetOpTensorDescriptor(opTensorDesc, ...@@ -396,9 +396,9 @@ cudnnSetOpTensorDescriptor(opTensorDesc,
} }
template <> template <>
void CPU_Emitter::EMITTER_DECL(ngraph::op::Broadcast) void GPU_Emitter::EMITTER_DECL(ngraph::op::Broadcast)
{ {
auto broadcast = static_cast<const ngraph::op::Broadcast*>(n); auto broadcast = static_cast<const ngraph::op::Broadcast*>(node);
auto arg_shape = args[0].get_shape(); auto arg_shape = args[0].get_shape();
auto result_shape = out[0].get_shape(); auto result_shape = out[0].get_shape();
...@@ -460,14 +460,14 @@ template <> ...@@ -460,14 +460,14 @@ template <>
} }
template <> template <>
void CPU_Emitter::EMITTER_DECL(ngraph::op::Constant) void GPU_Emitter::EMITTER_DECL(ngraph::op::Constant)
{ {
} }
template <> template <>
void CPU_Emitter::EMITTER_DECL(ngraph::op::Reshape) void GPU_Emitter::EMITTER_DECL(ngraph::op::Reshape)
{ {
auto reshape = static_cast<const op::Reshape*>(n); auto reshape = static_cast<const op::Reshape*>(node);
writer << "{ // " << node->get_name() << "\n"; writer << "{ // " << node->get_name() << "\n";
writer.indent++; writer.indent++;
auto arg_shape = args[0].get_shape(); auto arg_shape = args[0].get_shape();
...@@ -529,12 +529,12 @@ template <> ...@@ -529,12 +529,12 @@ template <>
} }
template <> template <>
void CPU_Emitter::EMITTER_DECL(ngraph::op::FunctionCall) void GPU_Emitter::EMITTER_DECL(ngraph::op::FunctionCall)
{ {
} }
template <> template <>
void CPU_Emitter::EMITTER_DECL(ngraph::op::Multiply) void GPU_Emitter::EMITTER_DECL(ngraph::op::Multiply)
{ {
writer << "{ // " << node->get_name() << "\n"; writer << "{ // " << node->get_name() << "\n";
writer.indent++; writer.indent++;
...@@ -573,7 +573,7 @@ cudnnSetOpTensorDescriptor(opTensorDesc, ...@@ -573,7 +573,7 @@ cudnnSetOpTensorDescriptor(opTensorDesc,
} }
template <> template <>
void CPU_Emitter::EMITTER_DECL(ngraph::op::Sqrt) void GPU_Emitter::EMITTER_DECL(ngraph::op::Sqrt)
{ {
writer << "{ // " << node->get_name() << "\n"; writer << "{ // " << node->get_name() << "\n";
writer.indent++; writer.indent++;
......
...@@ -161,77 +161,74 @@ static StaticInitializers s_static_initializers; ...@@ -161,77 +161,74 @@ static StaticInitializers s_static_initializers;
#define TI(x) type_index(typeid(x)) #define TI(x) type_index(typeid(x))
static const runtime::gpu::OpMap dispatcher{ static const runtime::gpu::OpMap dispatcher{
{TI(ngraph::op::Add), &runtime::cpu::GPU_Emitter::emit<op::Add>}, {TI(ngraph::op::Add), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Add>},
{TI(ngraph::op::MatmulBias), &runtime::cpu::GPU_Emitter::emit<op::MatmulBias>}, {TI(ngraph::op::Dot), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Dot>},
{TI(ngraph::op::Dot), &runtime::cpu::GPU_Emitter::emit<op::Dot>}, {TI(ngraph::op::Multiply), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Multiply>},
{TI(ngraph::op::Multiply), &runtime::cpu::GPU_Emitter::emit<op::Multiply>}, {TI(ngraph::op::Parameter), &runtime::gpu::GPU_Emitter::nop},
{TI(ngraph::op::Parameter), &runtime::cpu::GPU_Emitter::nop}, {TI(ngraph::op::Abs), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Abs>},
{TI(ngraph::op::Abs), &runtime::cpu::GPU_Emitter::emit<op::Abs>}, {TI(ngraph::op::Concat), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Concat>},
{TI(ngraph::op::Concat), &runtime::cpu::GPU_Emitter::emit<op::Concat>}, {TI(ngraph::op::Divide), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Divide>},
{TI(ngraph::op::Divide), &runtime::cpu::GPU_Emitter::emit<op::Divide>}, {TI(ngraph::op::Equal), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Equal>},
{TI(ngraph::op::Equal), &runtime::cpu::GPU_Emitter::emit<op::Equal>}, {TI(ngraph::op::GetOutputElement), &runtime::gpu::GPU_Emitter::emit<ngraph::op::GetOutputElement>},
{TI(ngraph::op::GetOutputElement), &runtime::cpu::GPU_Emitter::emit<op::GetOutputElement>}, {TI(ngraph::op::Greater), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Greater>},
{TI(ngraph::op::Greater), &runtime::cpu::GPU_Emitter::emit<op::Greater>}, {TI(ngraph::op::GreaterEq), &runtime::gpu::GPU_Emitter::emit<ngraph::op::GreaterEq>},
{TI(ngraph::op::GreaterEq), &runtime::cpu::GPU_Emitter::emit<op::GreaterEq>}, {TI(ngraph::op::Less), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Less>},
{TI(ngraph::op::Less), &runtime::cpu::GPU_Emitter::emit<op::Less>}, {TI(ngraph::op::LessEq), &runtime::gpu::GPU_Emitter::emit<ngraph::op::LessEq>},
{TI(ngraph::op::LessEq), &runtime::cpu::GPU_Emitter::emit<op::LessEq>}, {TI(ngraph::op::Log), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Log>},
{TI(ngraph::op::Log), &runtime::cpu::GPU_Emitter::emit<op::Log>}, {TI(ngraph::op::Maximum), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Maximum>},
{TI(ngraph::op::Maximum), &runtime::cpu::GPU_Emitter::emit<op::Maximum>}, {TI(ngraph::op::Minimum), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Minimum>},
{TI(ngraph::op::Minimum), &runtime::cpu::GPU_Emitter::emit<op::Minimum>}, {TI(ngraph::op::Negative), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Negative>},
{TI(ngraph::op::Negative), &runtime::cpu::GPU_Emitter::emit<op::Negative>}, {TI(ngraph::op::NotEqual), &runtime::gpu::GPU_Emitter::emit<ngraph::op::NotEqual>},
{TI(ngraph::op::NotEqual), &runtime::cpu::GPU_Emitter::emit<op::NotEqual>}, {TI(ngraph::op::Power), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Power>},
{TI(ngraph::op::Power), &runtime::cpu::GPU_Emitter::emit<op::Power>}, {TI(ngraph::op::Select), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Select>},
{TI(ngraph::op::Select), &runtime::cpu::GPU_Emitter::emit<op::Select>}, {TI(ngraph::op::Subtract), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Subtract>},
{TI(ngraph::op::Subtract), &runtime::cpu::GPU_Emitter::emit<op::Subtract>}, {TI(ngraph::op::Broadcast), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Broadcast>},
{TI(ngraph::op::Broadcast), &runtime::cpu::GPU_Emitter::emit<op::Broadcast>}, {TI(ngraph::op::Convert), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Convert>},
{TI(ngraph::op::Convert), &runtime::cpu::GPU_Emitter::emit<op::Convert>}, {TI(ngraph::op::Constant), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Constant>},
{TI(ngraph::op::Constant), &runtime::cpu::GPU_Emitter::emit<op::Constant>}, {TI(ngraph::op::Reshape), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Reshape>},
{TI(ngraph::op::Reshape), &runtime::cpu::GPU_Emitter::emit<op::Reshape>}, {TI(ngraph::op::FunctionCall), &runtime::gpu::GPU_Emitter::emit<ngraph::op::FunctionCall>},
{TI(ngraph::op::FunctionCall), &runtime::cpu::GPU_Emitter::emit<op::FunctionCall>}, {TI(ngraph::op::Reduce), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Reduce>},
{TI(ngraph::op::Reduce), &runtime::cpu::GPU_Emitter::emit<op::Reduce>}, {TI(ngraph::op::Sign), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Sign>},
{TI(ngraph::op::Sign), &runtime::cpu::GPU_Emitter::emit<op::Sign>}, {TI(ngraph::op::Slice), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Slice>},
{TI(ngraph::op::Slice), &runtime::cpu::GPU_Emitter::emit<op::Slice>}, {TI(ngraph::op::Sum), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Sum>},
{TI(ngraph::op::Sum), &runtime::cpu::GPU_Emitter::emit<op::Sum>}, {TI(ngraph::op::Exp), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Exp>},
{TI(ngraph::op::Exp), &runtime::cpu::GPU_Emitter::emit<op::Exp>}, {TI(ngraph::op::Sin), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Sin>},
{TI(ngraph::op::Sin), &runtime::cpu::GPU_Emitter::emit<op::Sin>}, {TI(ngraph::op::Sinh), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Sinh>},
{TI(ngraph::op::Sinh), &runtime::cpu::GPU_Emitter::emit<op::Sinh>}, {TI(ngraph::op::Cos), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Cos>},
{TI(ngraph::op::Cos), &runtime::cpu::GPU_Emitter::emit<op::Cos>}, {TI(ngraph::op::Cosh), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Cosh>},
{TI(ngraph::op::Cosh), &runtime::cpu::GPU_Emitter::emit<op::Cosh>}, {TI(ngraph::op::Tan), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Tan>},
{TI(ngraph::op::Tan), &runtime::cpu::GPU_Emitter::emit<op::Tan>}, {TI(ngraph::op::Tanh), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Tanh>},
{TI(ngraph::op::Tanh), &runtime::cpu::GPU_Emitter::emit<op::Tanh>}, {TI(ngraph::op::Asin), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Asin>},
{TI(ngraph::op::Asin), &runtime::cpu::GPU_Emitter::emit<op::Asin>}, {TI(ngraph::op::Acos), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Acos>},
{TI(ngraph::op::Acos), &runtime::cpu::GPU_Emitter::emit<op::Acos>}, {TI(ngraph::op::Atan), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Atan>},
{TI(ngraph::op::Atan), &runtime::cpu::GPU_Emitter::emit<op::Atan>}, {TI(ngraph::op::ReplaceSlice), &runtime::gpu::GPU_Emitter::emit<ngraph::op::ReplaceSlice>},
{TI(ngraph::op::ReplaceSlice), &runtime::cpu::GPU_Emitter::emit<op::ReplaceSlice>}, {TI(ngraph::op::OneHot), &runtime::gpu::GPU_Emitter::emit<ngraph::op::OneHot>},
{TI(ngraph::op::OneHot), &runtime::cpu::GPU_Emitter::emit<op::OneHot>}, {TI(ngraph::op::Floor), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Floor>},
{TI(ngraph::op::Floor), &runtime::cpu::GPU_Emitter::emit<op::Floor>}, {TI(ngraph::op::Ceiling), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Ceiling>},
{TI(ngraph::op::Ceiling), &runtime::cpu::GPU_Emitter::emit<op::Ceiling>}, {TI(ngraph::op::Sqrt), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Sqrt>},
{TI(ngraph::op::Sqrt), &runtime::cpu::GPU_Emitter::emit<op::Sqrt>}, {TI(ngraph::op::Convolution), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Convolution>},
{TI(ngraph::op::Convolution), &runtime::cpu::GPU_Emitter::emit<op::Convolution>},
{TI(ngraph::op::ConvolutionBackpropFilters), {TI(ngraph::op::ConvolutionBackpropFilters),
&runtime::cpu::GPU_Emitter::emit<op::ConvolutionBackpropFilters>}, &runtime::gpu::GPU_Emitter::emit<ngraph::op::ConvolutionBackpropFilters>},
{TI(ngraph::op::ConvolutionBackpropData), {TI(ngraph::op::ConvolutionBackpropData),
&runtime::cpu::GPU_Emitter::emit<op::ConvolutionBackpropData>}, &runtime::gpu::GPU_Emitter::emit<ngraph::op::ConvolutionBackpropData>},
{TI(ngraph::runtime::cpu::op::ConvertLayout), {TI(ngraph::op::Not), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Not>},
&runtime::cpu::GPU_Emitter::emit<runtime::cpu::op::ConvertLayout>}, {TI(ngraph::op::MaxPool), &runtime::gpu::GPU_Emitter::emit<ngraph::op::MaxPool>},
{TI(ngraph::op::Not), &runtime::cpu::GPU_Emitter::emit<op::Not>}, {TI(ngraph::op::Reverse), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Reverse>},
{TI(ngraph::op::MaxPool), &runtime::cpu::GPU_Emitter::emit<op::MaxPool>}, {TI(ngraph::op::Result), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Result>},
{TI(ngraph::op::Reverse), &runtime::cpu::GPU_Emitter::emit<op::Reverse>}, {TI(ngraph::op::ReduceWindow), &runtime::gpu::GPU_Emitter::emit<ngraph::op::ReduceWindow>},
{TI(ngraph::op::Result), &runtime::cpu::GPU_Emitter::emit<op::Result>}, {TI(ngraph::op::SelectAndScatter), &runtime::gpu::GPU_Emitter::emit<ngraph::op::SelectAndScatter>},
{TI(ngraph::op::ReduceWindow), &runtime::cpu::GPU_Emitter::emit<op::ReduceWindow>}, {TI(ngraph::op::AvgPool), &runtime::gpu::GPU_Emitter::emit<ngraph::op::AvgPool>},
{TI(ngraph::op::SelectAndScatter), &runtime::cpu::GPU_Emitter::emit<op::SelectAndScatter>}, {TI(ngraph::op::AvgPoolBackprop), &runtime::gpu::GPU_Emitter::emit<ngraph::op::AvgPoolBackprop>},
{TI(ngraph::op::AvgPool), &runtime::cpu::GPU_Emitter::emit<op::AvgPool>}, {TI(ngraph::op::Pad), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Pad>},
{TI(ngraph::op::AvgPoolBackprop), &runtime::cpu::GPU_Emitter::emit<op::AvgPoolBackprop>}, {TI(ngraph::op::BatchNorm), &runtime::gpu::GPU_Emitter::emit<ngraph::op::BatchNorm>},
{TI(ngraph::op::Pad), &runtime::cpu::GPU_Emitter::emit<op::Pad>}, {TI(ngraph::op::BatchNormBackprop), &runtime::gpu::GPU_Emitter::emit<ngraph::op::BatchNormBackprop>},
{TI(ngraph::op::BatchNorm), &runtime::cpu::GPU_Emitter::emit<op::BatchNorm>}, {TI(ngraph::op::MaxPoolBackprop), &runtime::gpu::GPU_Emitter::emit<ngraph::op::MaxPoolBackprop>},
{TI(ngraph::op::BatchNormBackprop), &runtime::cpu::GPU_Emitter::emit<op::BatchNormBackprop>}, {TI(ngraph::op::Product), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Product>},
{TI(ngraph::op::MaxPoolBackprop), &runtime::cpu::GPU_Emitter::emit<op::MaxPoolBackprop>}, {TI(ngraph::op::Max), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Max>},
{TI(ngraph::op::Product), &runtime::cpu::GPU_Emitter::emit<op::Product>}, {TI(ngraph::op::Min), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Min>},
{TI(ngraph::op::Max), &runtime::cpu::GPU_Emitter::emit<op::Max>}, {TI(ngraph::op::Relu), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Relu>},
{TI(ngraph::op::Min), &runtime::cpu::GPU_Emitter::emit<op::Min>}, {TI(ngraph::op::ReluBackprop), &runtime::gpu::GPU_Emitter::emit<ngraph::op::ReluBackprop>},
{TI(ngraph::op::Relu), &runtime::cpu::GPU_Emitter::emit<op::Relu>}, {TI(ngraph::op::Softmax), &runtime::gpu::GPU_Emitter::emit<ngraph::op::Softmax>},
{TI(ngraph::op::ReluBackprop), &runtime::cpu::GPU_Emitter::emit<op::ReluBackprop>},
{TI(ngraph::op::Softmax), &runtime::cpu::GPU_Emitter::emit<op::Softmax>},
}; };
runtime::gpu::GPU_ExternalFunction::GPU_ExternalFunction( runtime::gpu::GPU_ExternalFunction::GPU_ExternalFunction(
...@@ -375,7 +372,7 @@ using namespace std; ...@@ -375,7 +372,7 @@ using namespace std;
{ {
for (shared_ptr<Node> node : current_function->get_ordered_ops()) for (shared_ptr<Node> node : current_function->get_ordered_ops())
{ {
const op::Constant* c = dynamic_cast<op::Constant*>(node.get()); const op::Constant* c = dynamic_cast<ngraph::op::Constant*>(node.get());
if (c) if (c)
{ {
shared_ptr<descriptor::TensorView> tv = node->get_outputs()[0].get_tensor_view(); shared_ptr<descriptor::TensorView> tv = node->get_outputs()[0].get_tensor_view();
...@@ -489,7 +486,7 @@ using namespace std; ...@@ -489,7 +486,7 @@ using namespace std;
writer << "\n)\n"; writer << "\n)\n";
writer << "{\n"; writer << "{\n";
writer.indent++; writer.indent++;
handler->second(writer, &n, in, out); handler->second(this, writer, &n, in, out);
writer.indent--; writer.indent--;
writer << "}\n"; writer << "}\n";
} }
...@@ -507,7 +504,7 @@ using namespace std; ...@@ -507,7 +504,7 @@ using namespace std;
set<descriptor::TensorView*> constants; set<descriptor::TensorView*> constants;
for (shared_ptr<Node> node : current_function->get_ordered_ops()) for (shared_ptr<Node> node : current_function->get_ordered_ops())
{ {
if (dynamic_cast<op::Constant*>(node.get())) if (dynamic_cast<ngraph::op::Constant*>(node.get()))
{ {
shared_ptr<descriptor::TensorView> tv = node->get_outputs()[0].get_tensor_view(); shared_ptr<descriptor::TensorView> tv = node->get_outputs()[0].get_tensor_view();
constants.insert(tv.get()); constants.insert(tv.get());
...@@ -556,7 +553,7 @@ using namespace std; ...@@ -556,7 +553,7 @@ using namespace std;
// Add inputs to the variable name map // Add inputs to the variable name map
size_t arg_index = 0; size_t arg_index = 0;
for (shared_ptr<op::Parameter> param : current_function->get_parameters()) for (shared_ptr<ngraph::op::Parameter> param : current_function->get_parameters())
{ {
for (size_t i = 0; i < param->get_output_size(); ++i) for (size_t i = 0; i < param->get_output_size(); ++i)
{ {
...@@ -595,7 +592,7 @@ using namespace std; ...@@ -595,7 +592,7 @@ using namespace std;
shared_ptr<descriptor::TensorView> tv = op->get_output_tensor_view(); shared_ptr<descriptor::TensorView> tv = op->get_output_tensor_view();
const element::Type& et = tv->get_tensor_view_type()->get_element_type(); const element::Type& et = tv->get_tensor_view_type()->get_element_type();
bool parameter_as_output = false; bool parameter_as_output = false;
for (shared_ptr<op::Parameter> param : current_function->get_parameters()) for (shared_ptr<ngraph::op::Parameter> param : current_function->get_parameters())
{ {
for (const descriptor::Output& pout : param->get_outputs()) for (const descriptor::Output& pout : param->get_outputs())
{ {
...@@ -673,7 +670,7 @@ using namespace std; ...@@ -673,7 +670,7 @@ using namespace std;
} }
if (func_name.empty()) if (func_name.empty())
{ {
handler->second(writer, node.get(), in, out); handler->second(this, writer, node.get(), in, out);
} }
else else
{ {
......
...@@ -41,7 +41,8 @@ namespace ngraph ...@@ -41,7 +41,8 @@ namespace ngraph
class GPU_CallFrame; class GPU_CallFrame;
using OpFunction = using OpFunction =
std::function<void(codegen::CodeWriter&, std::function<void(GPU_ExternalFunction* external_function,
codegen::CodeWriter&,
const ngraph::Node*, const ngraph::Node*,
const std::vector<GPU_TensorViewWrapper>& inputs, const std::vector<GPU_TensorViewWrapper>& inputs,
const std::vector<GPU_TensorViewWrapper>& outputs)>; const std::vector<GPU_TensorViewWrapper>& outputs)>;
......
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