Commit 94cd8274 authored by fenglei.tian's avatar fenglei.tian

add template

parent 8eb31b78
...@@ -91,8 +91,8 @@ ...@@ -91,8 +91,8 @@
#include "ngraph/ops/sum.hpp" #include "ngraph/ops/sum.hpp"
#include "ngraph/ops/tan.hpp" #include "ngraph/ops/tan.hpp"
#include "ngraph/ops/tanh.hpp" #include "ngraph/ops/tanh.hpp"
#include "ngraph/runtime/gpu/gpu_cuda_kernel_emitters.hpp"
#include "ngraph/runtime/gpu/gpu_emitter.hpp" #include "ngraph/runtime/gpu/gpu_emitter.hpp"
#include "ngraph/runtime/gpu/gpu_cuda_kernel_emitters.hpp"
#include "ngraph/runtime/gpu/gpu_kernel_emitters.hpp" #include "ngraph/runtime/gpu/gpu_kernel_emitters.hpp"
#include "ngraph/util.hpp" #include "ngraph/util.hpp"
...@@ -106,7 +106,8 @@ namespace ngraph ...@@ -106,7 +106,8 @@ namespace ngraph
{ {
template <> template <>
void GPU_Emitter::EMITTER_DECL(ngraph::op::Abs) void GPU_Emitter::EMITTER_DECL(ngraph::op::Abs)
{ {
std::cout << "abs" << std::endl;
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";
...@@ -467,7 +468,7 @@ cudnnSetOpTensorDescriptor(opTensorDesc, ...@@ -467,7 +468,7 @@ cudnnSetOpTensorDescriptor(opTensorDesc,
void GPU_Emitter::EMITTER_DECL(ngraph::op::Constant) void GPU_Emitter::EMITTER_DECL(ngraph::op::Constant)
{ {
} }
template <> template <>
void GPU_Emitter::EMITTER_DECL(ngraph::op::Reshape) void GPU_Emitter::EMITTER_DECL(ngraph::op::Reshape)
{ {
...@@ -577,7 +578,11 @@ cudnnSetOpTensorDescriptor(opTensorDesc, ...@@ -577,7 +578,11 @@ cudnnSetOpTensorDescriptor(opTensorDesc,
writer.indent--; writer.indent--;
writer << "}\n"; writer << "}\n";
} }
template <>
void GPU_Emitter::EMITTER_DECL(ngraph::op::Result)
{
}
template <> template <>
void GPU_Emitter::EMITTER_DECL(ngraph::op::Sqrt) void GPU_Emitter::EMITTER_DECL(ngraph::op::Sqrt)
{ {
......
...@@ -45,7 +45,8 @@ namespace ngraph ...@@ -45,7 +45,8 @@ namespace ngraph
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)
{ {
std::cout << node->get_name() << std::endl;
throw std::runtime_error("Unimplemented op in GPU emitter"); throw std::runtime_error("Unimplemented op in GPU emitter");
} }
...@@ -55,6 +56,7 @@ namespace ngraph ...@@ -55,6 +56,7 @@ namespace ngraph
const std::vector<GPU_TensorViewWrapper>& args, const std::vector<GPU_TensorViewWrapper>& args,
const std::vector<GPU_TensorViewWrapper>& out) const std::vector<GPU_TensorViewWrapper>& out)
{ {
std::cout << "nop" << std::endl;
} }
private: private:
......
...@@ -82,6 +82,7 @@ namespace ngraph ...@@ -82,6 +82,7 @@ namespace ngraph
std::unique_ptr<codegen::ExecutionEngine> m_execution_engine; std::unique_ptr<codegen::ExecutionEngine> m_execution_engine;
bool m_emit_timing; bool m_emit_timing;
std::unordered_map<std::string, std::string> m_variable_name_map; std::unordered_map<std::string, std::string> m_variable_name_map;
std::string m_function_name;
}; };
} }
} }
......
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