Commit 6204a154 authored by Fenglei Tian's avatar Fenglei Tian

Merge branch 'tfl/gpu_emitter_template' of…

Merge branch 'tfl/gpu_emitter_template' of github.com:NervanaSystems/private-ngraph-cpp into tfl/gpu_emitter_template
parents 2e94fe52 d7039a34
...@@ -121,26 +121,26 @@ namespace ngraph ...@@ -121,26 +121,26 @@ namespace ngraph
writer << "}\n"; writer << "}\n";
} }
void GPU_Emitter::EmitUnaryElementwise(GPU_ExternalFunction* external_function, void GPU_Emitter::EmitUnaryElementwise(GPU_ExternalFunction* external_function,
codegen::CodeWriter& writer, codegen::CodeWriter& writer,
const ngraph::Node* node, const ngraph::Node* node,
const std::vector<GPU_TensorViewWrapper>& args, const std::vector<GPU_TensorViewWrapper>& args,
const std::vector<GPU_TensorViewWrapper>& out) const std::vector<GPU_TensorViewWrapper>& out)
{ {
if (out[0].get_size() == 0) if (out[0].get_size() == 0)
{ {
return; return;
} }
writer << "{ // " << node->get_name() << "\n"; writer << "{ // " << node->get_name() << "\n";
writer.indent++; writer.indent++;
writer << "int count = " << out[0].get_size() << ";\n"; writer << "int count = " << out[0].get_size() << ";\n";
writer << "if(count == 0) return;\n"; writer << "if(count == 0) return;\n";
writer << "ngraph::runtime::gpu::emit_unary_elementwise_op<ngraph::op::" << node->description() writer << "ngraph::runtime::gpu::emit_unary_elementwise_op<ngraph::op::"
<< ">((void*) " << args[0].get_name() << ", (void*) " << out[0].get_name() << node->description() << ">((void*) " << args[0].get_name() << ", (void*) "
<< ", count, \"" << node->description() << "\");\n"; << out[0].get_name() << ", count, \"" << node->description() << "\");\n";
writer.indent--; writer.indent--;
writer << "}\n"; writer << "}\n";
} }
template <> template <>
void GPU_Emitter::EMITTER_DECL(ngraph::op::Add) void GPU_Emitter::EMITTER_DECL(ngraph::op::Add)
......
...@@ -59,12 +59,10 @@ namespace ngraph ...@@ -59,12 +59,10 @@ namespace ngraph
} }
static void EmitUnaryElementwise(GPU_ExternalFunction* external_function, static void EmitUnaryElementwise(GPU_ExternalFunction* external_function,
codegen::CodeWriter& writer, codegen::CodeWriter& writer,
const ngraph::Node* node, const ngraph::Node* node,
const std::vector<GPU_TensorViewWrapper>& args, const std::vector<GPU_TensorViewWrapper>& args,
const std::vector<GPU_TensorViewWrapper>& out) const std::vector<GPU_TensorViewWrapper>& out);
{
}
}; };
} }
} }
......
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