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
60d38bfb
Commit
60d38bfb
authored
Dec 15, 2017
by
Jaikrishnan Menon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CPU: Optimize Eigen Cwise sum
parent
fce3c524
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
cpu_emitter.cpp
src/ngraph/runtime/cpu/cpu_emitter.cpp
+13
-5
No files found.
src/ngraph/runtime/cpu/cpu_emitter.cpp
View file @
60d38bfb
...
...
@@ -37,6 +37,8 @@
#include "ngraph/runtime/cpu/cpu_kernel_emitters.hpp"
#include "ngraph/util.hpp"
#define EMIT_BREAKPOINT "__asm__ volatile(\"int $0x03\");\n"
using
namespace
std
;
using
namespace
ngraph
;
...
...
@@ -62,13 +64,19 @@ void runtime::cpu::CPU_Emitter::EmitAdd(const ngraph::Node* n,
const
vector
<
runtime
::
cpu
::
TensorViewWrapper
>&
args
,
const
vector
<
runtime
::
cpu
::
TensorViewWrapper
>&
out
)
{
// TODO: Audit all uses of Add and fix this to use
// the right alignment instead of Eigen::Unaligned
m_out
<<
"{ // "
<<
n
->
get_name
()
<<
"
\n
"
;
m_out
.
indent
++
;
m_out
<<
emit_array1d
(
out
[
0
])
<<
" =
\n
"
;
m_out
.
indent
++
;
m_out
<<
emit_array1d
(
args
[
0
])
<<
" +
\n
"
;
m_out
<<
emit_array1d
(
args
[
1
])
<<
";
\n
"
;
m_out
.
indent
-=
2
;
m_out
<<
"Eigen::Map<Eigen::Array<"
<<
out
[
0
].
get_element_type
().
c_type_string
()
<<
", "
<<
out
[
0
].
get_size
()
<<
", 1>, Eigen::Unaligned> out("
<<
out
[
0
].
get_name
()
<<
");
\n
"
;
m_out
<<
"Eigen::Map<Eigen::Array<"
<<
args
[
0
].
get_element_type
().
c_type_string
()
<<
", "
<<
args
[
0
].
get_size
()
<<
", 1>, Eigen::Unaligned> arg0("
<<
args
[
0
].
get_name
()
<<
");
\n
"
;
m_out
<<
"Eigen::Map<Eigen::Array<"
<<
args
[
1
].
get_element_type
().
c_type_string
()
<<
", "
<<
args
[
1
].
get_size
()
<<
", 1>, Eigen::Unaligned> arg1("
<<
args
[
1
].
get_name
()
<<
");
\n
"
;
m_out
<<
"out = arg0 + arg1;
\n
"
;
m_out
.
indent
--
;
m_out
<<
"}
\n
"
;
}
...
...
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