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"
...@@ -107,6 +107,7 @@ namespace ngraph ...@@ -107,6 +107,7 @@ 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";
...@@ -578,6 +579,10 @@ cudnnSetOpTensorDescriptor(opTensorDesc, ...@@ -578,6 +579,10 @@ cudnnSetOpTensorDescriptor(opTensorDesc,
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)
{ {
......
...@@ -46,6 +46,7 @@ namespace ngraph ...@@ -46,6 +46,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 << 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