Commit 11b612ca authored by Jaikrishnan Menon's avatar Jaikrishnan Menon

CPU: clang-format fixes and header cleanup for generated code

parent fc50420f
...@@ -92,9 +92,12 @@ namespace mkl ...@@ -92,9 +92,12 @@ namespace mkl
extern "C" { extern "C" {
void MKL_Somatcopy(char ordering, void MKL_Somatcopy(char ordering,
char trans, char trans,
size_t rows, size_t cols, size_t rows,
size_t cols,
const ngraph::element::Float32::type alpha, const ngraph::element::Float32::type alpha,
const ngraph::element::Float32::type* A, size_t lda, const ngraph::element::Float32::type* A,
ngraph::element::Float32::type* B, size_t ldb); size_t lda,
ngraph::element::Float32::type* B,
size_t ldb);
} }
} }
This diff is collapsed.
...@@ -208,19 +208,18 @@ void ExternalFunction::compile(FunctionMap& function_map) ...@@ -208,19 +208,18 @@ void ExternalFunction::compile(FunctionMap& function_map)
Emitter emitter; Emitter emitter;
auto& TU = emitter.GetTU(); auto& TU = emitter.GetTU();
TU += R"(// Generated by the NGraph CPU backend TU += R"(// Generated by the NGraph CPU backend
#include <memory>
#include <vector>
#include <algorithm> #include <algorithm>
#include <cmath> #include <cmath>
#include <memory>
#include <vector>
#include <Eigen/Dense> #include <Eigen/Dense>
#include "ngraph/descriptor/layout/dense_tensor_view_layout.hpp" #include "ngraph/descriptor/layout/dense_tensor_view_layout.hpp"
#include "ngraph/runtime/tensor_view_info.hpp"
#include "ngraph/runtime/utils.hpp"
#include "ngraph/runtime/cpu/call_frame.hpp" #include "ngraph/runtime/cpu/call_frame.hpp"
#include "ngraph/runtime/cpu/cpu_kernels.hpp" #include "ngraph/runtime/cpu/cpu_kernels.hpp"
#include "ngraph/runtime/cpu/eigen_utils.hpp" #include "ngraph/runtime/cpu/eigen_utils.hpp"
#include "ngraph/runtime/utils.hpp"
using namespace ngraph::element; using namespace ngraph::element;
using namespace ngraph::runtime; using namespace ngraph::runtime;
...@@ -281,10 +280,10 @@ extern "C" void __entrypoint(ngraph::runtime::cpu::CallFrame* call_frame, ...@@ -281,10 +280,10 @@ extern "C" void __entrypoint(ngraph::runtime::cpu::CallFrame* call_frame,
assert(llvm_module); assert(llvm_module);
estate.add_module(llvm_module); estate.add_module(llvm_module);
estate.finalize(); estate.finalize();
compiled_function = estate.find_function<void( compiled_function =
ngraph::runtime::cpu::CallFrame*, estate.find_function<void(ngraph::runtime::cpu::CallFrame*,
ngraph::runtime::TensorViewPtrs&, ngraph::runtime::TensorViewPtrs&,
const std::vector<std::shared_ptr<CallFrame>>&)>("__entrypoint"); const std::vector<std::shared_ptr<CallFrame>>&)>("__entrypoint");
assert(compiled_function); assert(compiled_function);
m_is_compiled = true; m_is_compiled = true;
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
#include <typeinfo> #include <typeinfo>
#include <unordered_map> #include <unordered_map>
#include "ngraph/function.hpp"
#include "ngraph/codegen/compiler.hpp" #include "ngraph/codegen/compiler.hpp"
#include "ngraph/function.hpp"
#include "ngraph/runtime/external_function.hpp" #include "ngraph/runtime/external_function.hpp"
#include "ngraph/runtime/tensor_view_info.hpp" #include "ngraph/runtime/tensor_view_info.hpp"
...@@ -47,9 +47,10 @@ namespace ngraph ...@@ -47,9 +47,10 @@ namespace ngraph
using OpMap = std::unordered_map<std::type_index, OpFunction>; using OpMap = std::unordered_map<std::type_index, OpFunction>;
using EntryPoint = std::function<void(ngraph::runtime::cpu::CallFrame*, using EntryPoint = std::function<void(
ngraph::runtime::TensorViewPtrs&, ngraph::runtime::cpu::CallFrame*,
const std::vector<std::shared_ptr<ngraph::runtime::cpu::CallFrame>>&)>; ngraph::runtime::TensorViewPtrs&,
const std::vector<std::shared_ptr<ngraph::runtime::cpu::CallFrame>>&)>;
class ExternalFunction : public ngraph::runtime::ExternalFunction class ExternalFunction : public ngraph::runtime::ExternalFunction
{ {
...@@ -57,8 +58,7 @@ namespace ngraph ...@@ -57,8 +58,7 @@ namespace ngraph
ExternalFunction(const std::shared_ptr<ngraph::Function>& function, ExternalFunction(const std::shared_ptr<ngraph::Function>& function,
bool release_function = true); bool release_function = true);
std::shared_ptr<ngraph::runtime::CallFrame> make_call_frame(); std::shared_ptr<ngraph::runtime::CallFrame> make_call_frame();
std::vector<std::shared_ptr<CallFrame>> &get_callees() { return callees; } std::vector<std::shared_ptr<CallFrame>>& get_callees() { return callees; }
protected: protected:
void compile(FunctionMap& function_map); void compile(FunctionMap& function_map);
......
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