Unverified Commit efe4ba18 authored by Jai Menon's avatar Jai Menon Committed by GitHub

Merge pull request #249 from NervanaSystems/bob/simple_function_call

Bob/simple function call
parents 41f9ec92 14e2c9b8
...@@ -45,7 +45,7 @@ void CallFrame::tensor_call( ...@@ -45,7 +45,7 @@ void CallFrame::tensor_call(
} }
// Invoke compiled computation // Invoke compiled computation
m_compiled_function(inputs, outputs); m_compiled_function(inputs.data(), outputs.data());
} }
void CallFrame::operator()(const std::vector<std::shared_ptr<ngraph::runtime::Value>>& arguments, void CallFrame::operator()(const std::vector<std::shared_ptr<ngraph::runtime::Value>>& arguments,
......
...@@ -32,8 +32,7 @@ namespace ngraph ...@@ -32,8 +32,7 @@ namespace ngraph
{ {
class CallFrame; class CallFrame;
using EntryPoint_t = void(const std::vector<void*>& inputs, using EntryPoint_t = void(void** inputs, void** outputs);
const std::vector<void*>& outputs);
using EntryPoint = std::function<EntryPoint_t>; using EntryPoint = std::function<EntryPoint_t>;
......
This diff is collapsed.
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#define EMITTER_DECL(E) \ #define EMITTER_DECL(E) \
E(const ngraph::Node* n, \ E(const ngraph::Node* n, \
ExternalFunction* ef, \
const std::vector<TensorViewInfo>& inputs, \ const std::vector<TensorViewInfo>& inputs, \
const std::vector<TensorViewInfo>& outputs) const std::vector<TensorViewInfo>& outputs)
......
...@@ -186,7 +186,6 @@ void ExternalFunction::compile() ...@@ -186,7 +186,6 @@ void ExternalFunction::compile()
TU += TU +=
R"(// Generated by the NGraph CPU backend R"(// Generated by the NGraph CPU backend
#include <cmath> #include <cmath>
#include <vector>
#include <Eigen/Dense> #include <Eigen/Dense>
...@@ -202,17 +201,14 @@ using namespace ngraph::runtime::cpu::eigen; ...@@ -202,17 +201,14 @@ using namespace ngraph::runtime::cpu::eigen;
TU << "// Declare all functions\n"; TU << "// Declare all functions\n";
for (shared_ptr<Function> f : pass_manager.get_state().get_functions()) for (shared_ptr<Function> f : pass_manager.get_state().get_functions())
{ {
TU << "extern \"C\" void " << f->get_name() << "(\n"; TU << "extern \"C\" void " << f->get_name() << "(void** inputs, void** outputs);\n";
TU << " const std::vector<void*>& inputs,\n";
TU << " const std::vector<void*>& outputs);\n";
} }
TU << "\n"; TU << "\n";
for (shared_ptr<Function> current_function : pass_manager.get_state().get_functions()) for (shared_ptr<Function> current_function : pass_manager.get_state().get_functions())
{ {
TU << "extern \"C\" void " << current_function->get_name() << "(\n"; TU << "extern \"C\" void " << current_function->get_name();
TU << " const std::vector<void*>& inputs,\n"; TU << "(void** inputs, void** outputs)\n";
TU << " const std::vector<void*>& outputs)\n";
TU << "{\n"; TU << "{\n";
TU.indent++; TU.indent++;
...@@ -297,7 +293,7 @@ using namespace ngraph::runtime::cpu::eigen; ...@@ -297,7 +293,7 @@ using namespace ngraph::runtime::cpu::eigen;
auto tv = output.get_tensor_view(); auto tv = output.get_tensor_view();
out.push_back({0, tv}); out.push_back({0, tv});
} }
handler->second(&emitter, node.get(), this, in, out); handler->second(&emitter, node.get(), in, out);
} }
TU.indent--; TU.indent--;
......
...@@ -41,7 +41,6 @@ namespace ngraph ...@@ -41,7 +41,6 @@ namespace ngraph
using OpFunction = std::function<void(Emitter*, using OpFunction = std::function<void(Emitter*,
const ngraph::Node*, const ngraph::Node*,
ExternalFunction*,
const std::vector<TensorViewInfo>& inputs, const std::vector<TensorViewInfo>& inputs,
const std::vector<TensorViewInfo>& outputs)>; const std::vector<TensorViewInfo>& 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