Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
9b46e945
Commit
9b46e945
authored
Nov 18, 2017
by
Robert Kimball
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change codegened functions to take void** instead of vector<void*>
parent
3bb93eb3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
18 deletions
+13
-18
call_frame.cpp
src/ngraph/runtime/cpu/call_frame.cpp
+1
-1
call_frame.hpp
src/ngraph/runtime/cpu/call_frame.hpp
+1
-2
emitter.cpp
src/ngraph/runtime/cpu/emitter.cpp
+8
-8
external_function.cpp
src/ngraph/runtime/cpu/external_function.cpp
+3
-7
No files found.
src/ngraph/runtime/cpu/call_frame.cpp
View file @
9b46e945
...
...
@@ -45,7 +45,7 @@ void CallFrame::tensor_call(
}
// 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
,
...
...
src/ngraph/runtime/cpu/call_frame.hpp
View file @
9b46e945
...
...
@@ -32,8 +32,7 @@ namespace ngraph
{
class
CallFrame
;
using
EntryPoint_t
=
void
(
const
std
::
vector
<
void
*>&
inputs
,
const
std
::
vector
<
void
*>&
outputs
);
using
EntryPoint_t
=
void
(
void
**
inputs
,
void
**
outputs
);
using
EntryPoint
=
std
::
function
<
EntryPoint_t
>
;
...
...
src/ngraph/runtime/cpu/emitter.cpp
View file @
9b46e945
...
...
@@ -967,8 +967,8 @@ void Emitter::EmitReduce(const ngraph::Node* n,
TU
.
indent
++
;
TU
<<
"
\n
"
;
TU
<<
type
<<
" result;
\n
"
;
TU
<<
"
std::vector<void*> inputs
= {&x, &y};
\n
"
;
TU
<<
"
std::vector<void*> outputs
= {&result};
\n
"
;
TU
<<
"
void* inputs[]
= {&x, &y};
\n
"
;
TU
<<
"
void* outputs[]
= {&result};
\n
"
;
TU
<<
reduction_function
->
get_name
()
<<
"(inputs, outputs);
\n
"
;
TU
<<
"return result;
\n
"
;
TU
.
indent
--
;
...
...
@@ -1003,8 +1003,8 @@ void Emitter::EmitReduce(const ngraph::Node* n,
TU
.
indent
++
;
TU
<<
"
\n
"
;
TU
<<
type
<<
" result;
\n
"
;
TU
<<
"
std::vector<void*> inputs
= {&x, &y};
\n
"
;
TU
<<
"
std::vector<void*> outputs
= {&result};
\n
"
;
TU
<<
"
void* inputs[]
= {&x, &y};
\n
"
;
TU
<<
"
void* outputs[]
= {&result};
\n
"
;
TU
<<
reduction_function
->
get_name
()
<<
"(inputs, outputs);
\n
"
;
TU
<<
"return result;
\n
"
;
TU
.
indent
--
;
...
...
@@ -1035,8 +1035,8 @@ void Emitter::EmitReduce(const ngraph::Node* n,
TU
.
indent
++
;
TU
<<
"
\n
"
;
TU
<<
type
<<
" result;
\n
"
;
TU
<<
"
std::vector<void*> inputs
= {&x, &y};
\n
"
;
TU
<<
"
std::vector<void*> outputs
= {&result};
\n
"
;
TU
<<
"
void* inputs[]
= {&x, &y};
\n
"
;
TU
<<
"
void* outputs[]
= {&result};
\n
"
;
TU
<<
reduction_function
->
get_name
()
<<
"(inputs, outputs);
\n
"
;
TU
<<
"return result;
\n
"
;
TU
.
indent
--
;
...
...
@@ -1365,13 +1365,13 @@ void Emitter::generate_call(const std::vector<TensorViewInfo>& inputs,
output_names
.
push_back
(
output
.
get_tensor
().
get_name
());
}
TU
<<
"
std::vector<void*> inputs
=
\n
{"
;
TU
<<
"
void* inputs[]
=
\n
{"
;
TU
.
indent
++
;
TU
<<
"
\n
"
<<
join
(
input_names
,
",
\n
"
);
TU
.
indent
--
;
TU
<<
"
\n
};
\n
"
;
TU
<<
"
std::vector<void*> outputs
=
\n
{"
;
TU
<<
"
void* outputs[]
=
\n
{"
;
TU
.
indent
++
;
TU
<<
"
\n
"
<<
join
(
output_names
,
",
\n
"
);
TU
.
indent
--
;
...
...
src/ngraph/runtime/cpu/external_function.cpp
View file @
9b46e945
...
...
@@ -186,7 +186,6 @@ void ExternalFunction::compile()
TU
+=
R"(// Generated by the NGraph CPU backend
#include <cmath>
#include <vector>
#include <Eigen/Dense>
...
...
@@ -201,17 +200,14 @@ using namespace ngraph::runtime::cpu::eigen;
TU
<<
"// Declare all functions
\n
"
;
for
(
shared_ptr
<
Function
>
f
:
pass_manager
.
get_state
().
get_functions
())
{
TU
<<
"extern
\"
C
\"
void "
<<
f
->
get_name
()
<<
"(
\n
"
;
TU
<<
" const std::vector<void*>& inputs,
\n
"
;
TU
<<
" const std::vector<void*>& outputs);
\n
"
;
TU
<<
"extern
\"
C
\"
void "
<<
f
->
get_name
()
<<
"(void** inputs, void** outputs);
\n
"
;
}
TU
<<
"
\n
"
;
for
(
shared_ptr
<
Function
>
current_function
:
pass_manager
.
get_state
().
get_functions
())
{
TU
<<
"extern
\"
C
\"
void "
<<
current_function
->
get_name
()
<<
"(
\n
"
;
TU
<<
" const std::vector<void*>& inputs,
\n
"
;
TU
<<
" const std::vector<void*>& outputs)
\n
"
;
TU
<<
"extern
\"
C
\"
void "
<<
current_function
->
get_name
();
TU
<<
"(void** inputs, void** outputs)
\n
"
;
TU
<<
"{
\n
"
;
TU
.
indent
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment