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
a9158a66
Commit
a9158a66
authored
Nov 03, 2017
by
Jaikrishnan Menon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CPU: Implement op::Exp
parent
c1d0e594
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
emitter.cpp
src/ngraph/runtime/cpu/emitter.cpp
+19
-0
emitter.hpp
src/ngraph/runtime/cpu/emitter.hpp
+1
-0
external_function.cpp
src/ngraph/runtime/cpu/external_function.cpp
+2
-0
No files found.
src/ngraph/runtime/cpu/emitter.cpp
View file @
a9158a66
...
@@ -1499,3 +1499,22 @@ void Emitter::EMITTER_DECL(EmitSum)
...
@@ -1499,3 +1499,22 @@ void Emitter::EMITTER_DECL(EmitSum)
throw
ngraph_error
(
"Sum: only vectors and matrices are currently supported"
);
throw
ngraph_error
(
"Sum: only vectors and matrices are currently supported"
);
}
}
}
}
void
Emitter
::
EMITTER_DECL
(
EmitExp
)
{
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
->
get_element_type
();
TU
+=
" {
\n
"
" auto arg0 = call_frame->get_tensor_view_data<"
+
element_type_names
[
TI
(
et
)]
+
">("
+
to_string
(
inputs
[
0
].
get_index
())
+
");
\n
"
" auto out = call_frame->get_tensor_view_data<"
+
element_type_names
[
TI
(
et
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
");
\n
"
" EigenArray1d<"
+
element_type_names
[
TI
(
et
)]
+
">(out, "
EIGEN_VECTOR_FORMAT
(
outputs
[
0
].
get_layout
<
DenseTensorViewLayout
>
()
->
get_size
())
") =
\n
"
" EigenArray1d<"
+
element_type_names
[
TI
(
et
)]
+
">(arg0, "
EIGEN_VECTOR_FORMAT
(
inputs
[
0
].
get_layout
<
DenseTensorViewLayout
>
()
->
get_size
())
").exp();
\n
"
" }
\n
"
;
}
src/ngraph/runtime/cpu/emitter.hpp
View file @
a9158a66
...
@@ -83,6 +83,7 @@ namespace ngraph
...
@@ -83,6 +83,7 @@ namespace ngraph
void
EMITTER_DECL
(
EmitSign
);
void
EMITTER_DECL
(
EmitSign
);
void
EMITTER_DECL
(
EmitSlice
);
void
EMITTER_DECL
(
EmitSlice
);
void
EMITTER_DECL
(
EmitSum
);
void
EMITTER_DECL
(
EmitSum
);
void
EMITTER_DECL
(
EmitExp
);
};
};
}
}
}
}
...
...
src/ngraph/runtime/cpu/external_function.cpp
View file @
a9158a66
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#include "ngraph/ops/divide.hpp"
#include "ngraph/ops/divide.hpp"
#include "ngraph/ops/dot.hpp"
#include "ngraph/ops/dot.hpp"
#include "ngraph/ops/equal.hpp"
#include "ngraph/ops/equal.hpp"
#include "ngraph/ops/exp.hpp"
#include "ngraph/ops/function_call.hpp"
#include "ngraph/ops/function_call.hpp"
#include "ngraph/ops/get_tuple_element.hpp"
#include "ngraph/ops/get_tuple_element.hpp"
#include "ngraph/ops/greater.hpp"
#include "ngraph/ops/greater.hpp"
...
@@ -119,6 +120,7 @@ static const OpMap dispatcher{
...
@@ -119,6 +120,7 @@ static const OpMap dispatcher{
{
TI
(
ngraph
::
op
::
Sign
),
&
Emitter
::
EmitSign
},
{
TI
(
ngraph
::
op
::
Sign
),
&
Emitter
::
EmitSign
},
{
TI
(
ngraph
::
op
::
Slice
),
&
Emitter
::
EmitSlice
},
{
TI
(
ngraph
::
op
::
Slice
),
&
Emitter
::
EmitSlice
},
{
TI
(
ngraph
::
op
::
Sum
),
&
Emitter
::
EmitSum
},
{
TI
(
ngraph
::
op
::
Sum
),
&
Emitter
::
EmitSum
},
{
TI
(
ngraph
::
op
::
Exp
),
&
Emitter
::
EmitExp
},
};
};
#undef TI
#undef TI
...
...
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