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
22e1368a
Commit
22e1368a
authored
Oct 25, 2017
by
Jaikrishnan Menon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CPU: Apply formatting fixes from clang-format
parent
75623f48
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
232 additions
and
162 deletions
+232
-162
compiler.hpp
src/ngraph/codegen/compiler.hpp
+0
-2
call_frame.hpp
src/ngraph/runtime/cpu/call_frame.hpp
+4
-4
cpu_manager.cpp
src/ngraph/runtime/cpu/cpu_manager.cpp
+1
-1
cpu_manager.hpp
src/ngraph/runtime/cpu/cpu_manager.hpp
+2
-1
emitter.cpp
src/ngraph/runtime/cpu/emitter.cpp
+184
-124
emitter.hpp
src/ngraph/runtime/cpu/emitter.hpp
+8
-7
external_function.cpp
src/ngraph/runtime/cpu/external_function.cpp
+26
-17
external_function.hpp
src/ngraph/runtime/cpu/external_function.hpp
+7
-5
cpu.cpp
test/cpu.cpp
+0
-1
No files found.
src/ngraph/codegen/compiler.hpp
View file @
22e1368a
...
...
@@ -46,10 +46,8 @@ public:
void
enable_pch
()
{
pch_enabled
=
true
;
}
void
disable_pch
()
{
pch_enabled
=
false
;
}
void
enable_debuginfo
()
{
debuginfo_enabled
=
true
;
}
void
disable_debuginfo
()
{
debuginfo_enabled
=
false
;
}
std
::
unique_ptr
<
llvm
::
Module
>
compile
(
const
std
::
string
&
source
,
const
std
::
string
&
name
=
""
);
bool
add_module
(
std
::
unique_ptr
<
llvm
::
Module
>&
);
...
...
src/ngraph/runtime/cpu/call_frame.hpp
View file @
22e1368a
...
...
@@ -14,9 +14,9 @@
#pragma once
#include <functional>
#include <memory>
#include <vector>
#include <functional>
#include "ngraph/function.hpp"
#include "ngraph/runtime/call_frame.hpp"
...
...
@@ -31,14 +31,14 @@ namespace ngraph
namespace
cpu
{
class
CallFrame
;
using
EntryPoint
=
std
::
function
<
void
(
ngraph
::
runtime
::
cpu
::
CallFrame
*
,
ngraph
::
runtime
::
TensorViewPtrs
&
)
>
;
using
EntryPoint
=
std
::
function
<
void
(
ngraph
::
runtime
::
cpu
::
CallFrame
*
,
ngraph
::
runtime
::
TensorViewPtrs
&
)
>
;
// Compile and execute graphs
class
CallFrame
:
public
ngraph
::
runtime
::
CallFrame
{
public
:
CallFrame
(
EntryPoint
compiled_function
,
CallFrame
(
EntryPoint
compiled_function
,
size_t
n_inputs
,
size_t
n_outputs
,
const
TensorViewPtrs
&
temps
);
...
...
src/ngraph/runtime/cpu/cpu_manager.cpp
View file @
22e1368a
...
...
@@ -14,9 +14,9 @@
#include <memory>
#include "ngraph/runtime/cpu/external_function.hpp"
#include "ngraph/runtime/cpu/cpu_backend.hpp"
#include "ngraph/runtime/cpu/cpu_manager.hpp"
#include "ngraph/runtime/cpu/external_function.hpp"
using
namespace
ngraph
::
runtime
::
cpu
;
...
...
src/ngraph/runtime/cpu/cpu_manager.hpp
View file @
22e1368a
...
...
@@ -16,8 +16,8 @@
#include <memory>
#include "ngraph/runtime/manager.hpp"
#include "ngraph/codegen/compiler.hpp"
#include "ngraph/runtime/manager.hpp"
namespace
ngraph
{
...
...
@@ -34,6 +34,7 @@ namespace ngraph
{
protected
:
ngraph
::
codegen
::
execution_state
exec_state
;
public
:
virtual
std
::
shared_ptr
<
Backend
>
allocate_backend
()
override
;
...
...
src/ngraph/runtime/cpu/emitter.cpp
View file @
22e1368a
...
...
@@ -13,19 +13,19 @@
// ----------------------------------------------------------------------------
#include <iostream>
#include <vector>
#include <typeindex>
#include <string>
#include <typeindex>
#include <unordered_map>
#include <vector>
#include "ngraph/node.hpp"
#include "ngraph/descriptor/layout/dense_tensor_view_layout.hpp"
#include "ngraph/node.hpp"
#include "ngraph/ops/concatenate.hpp"
#include "ngraph/ops/constant.hpp"
#include "ngraph/ops/get_tuple_element.hpp"
#include "ngraph/runtime/tensor_view_info.hpp"
#include "ngraph/runtime/cpu/external_function.hpp"
#include "ngraph/runtime/cpu/emitter.hpp"
#include "ngraph/runtime/cpu/external_function.hpp"
#include "ngraph/runtime/tensor_view_info.hpp"
using
namespace
std
;
using
namespace
ngraph
::
runtime
::
cpu
;
...
...
@@ -34,21 +34,19 @@ using ngraph::descriptor::layout::DenseTensorViewLayout;
#define TI(x) type_index(typeid(x))
static
unordered_map
<
type_index
,
string
>
element_type_names
=
{{
TI
(
ngraph
::
element
::
Bool
),
"Bool"
},
static
unordered_map
<
type_index
,
string
>
element_type_names
=
{
{
TI
(
ngraph
::
element
::
Bool
),
"Bool"
},
{
TI
(
ngraph
::
element
::
Float32
),
"Float32"
},
{
TI
(
ngraph
::
element
::
Int8
),
"Int8"
},
{
TI
(
ngraph
::
element
::
Int32
),
"Int32"
},
{
TI
(
ngraph
::
element
::
Int64
),
"Int64"
},
{
TI
(
ngraph
::
element
::
UInt8
),
"UInt8"
},
{
TI
(
ngraph
::
element
::
UInt32
),
"UInt32"
},
{
TI
(
ngraph
::
element
::
UInt64
),
"UInt64"
}
};
{
TI
(
ngraph
::
element
::
UInt64
),
"UInt64"
}};
#define EIGEN_VECTOR_FORMAT(x) "fmt::V{" + to_string(x) + "}"
static
std
::
string
EIGEN_MATRIX_FORMAT
(
const
ngraph
::
Shape
&
shape
,
const
ngraph
::
Strides
&
strides
)
static
std
::
string
EIGEN_MATRIX_FORMAT
(
const
ngraph
::
Shape
&
shape
,
const
ngraph
::
Strides
&
strides
)
{
std
::
string
I
;
for
(
size_t
i
=
0
;
i
<
shape
.
size
();
i
++
)
...
...
@@ -84,8 +82,8 @@ void Emitter::EMITTER_DECL(EmitNop)
void
Emitter
::
EMITTER_DECL
(
EmitAdd
)
{
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
->
get_element_type
();
TU
+=
" {
\n
"
...
...
@@ -178,19 +176,29 @@ void Emitter::EMITTER_DECL(EmitDot)
auto
arg1_layout
=
inputs
[
1
].
get_layout
<
DenseTensorViewLayout
>
();
auto
out_layout
=
outputs
[
0
].
get_layout
<
DenseTensorViewLayout
>
();
TU
+=
" {
\n
"
" auto arg0 = call_frame->get_tensor_view_data<"
+
element_type_names
[
TI
(
arg0_element_type
)]
+
">("
+
to_string
(
inputs
[
0
].
get_index
())
+
");
\n
"
" auto arg1 = call_frame->get_tensor_view_data<"
+
element_type_names
[
TI
(
arg0_element_type
)]
+
">("
+
to_string
(
inputs
[
1
].
get_index
())
+
");
\n
"
" auto out = call_frame->get_tensor_view_data<"
+
element_type_names
[
TI
(
arg0_element_type
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
");
\n
"
" EigenMatrix<"
+
element_type_names
[
TI
(
arg0_element_type
)]
+
">(out, "
+
EIGEN_MATRIX_FORMAT
(
out_layout
->
get_shape
(),
out_layout
->
get_strides
())
+
") =
\n
"
" EigenMatrix<"
+
element_type_names
[
TI
(
arg0_element_type
)]
+
">(arg0, "
+
EIGEN_MATRIX_FORMAT
(
arg0_layout
->
get_shape
(),
arg0_layout
->
get_strides
())
+
") * "
"EigenMatrix<"
+
element_type_names
[
TI
(
arg0_element_type
)]
+
">(arg1, "
+
EIGEN_MATRIX_FORMAT
(
arg1_layout
->
get_shape
(),
arg1_layout
->
get_strides
())
+
");
\n
"
TU
+=
" {
\n
"
" auto arg0 = call_frame->get_tensor_view_data<"
+
element_type_names
[
TI
(
arg0_element_type
)]
+
">("
+
to_string
(
inputs
[
0
].
get_index
())
+
");
\n
"
" auto arg1 = call_frame->get_tensor_view_data<"
+
element_type_names
[
TI
(
arg0_element_type
)]
+
">("
+
to_string
(
inputs
[
1
].
get_index
())
+
");
\n
"
" auto out = call_frame->get_tensor_view_data<"
+
element_type_names
[
TI
(
arg0_element_type
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
");
\n
"
" EigenMatrix<"
+
element_type_names
[
TI
(
arg0_element_type
)]
+
">(out, "
+
EIGEN_MATRIX_FORMAT
(
out_layout
->
get_shape
(),
out_layout
->
get_strides
())
+
") =
\n
"
" EigenMatrix<"
+
element_type_names
[
TI
(
arg0_element_type
)]
+
">(arg0, "
+
EIGEN_MATRIX_FORMAT
(
arg0_layout
->
get_shape
(),
arg0_layout
->
get_strides
())
+
") * "
"EigenMatrix<"
+
element_type_names
[
TI
(
arg0_element_type
)]
+
">(arg1, "
+
EIGEN_MATRIX_FORMAT
(
arg1_layout
->
get_shape
(),
arg1_layout
->
get_strides
())
+
");
\n
"
" }
\n
"
;
}
else
...
...
@@ -201,8 +209,8 @@ void Emitter::EMITTER_DECL(EmitDot)
void
Emitter
::
EMITTER_DECL
(
EmitMultiply
)
{
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
->
get_element_type
();
TU
+=
" {
\n
"
...
...
@@ -221,16 +229,19 @@ void Emitter::EMITTER_DECL(EmitMultiply)
void
Emitter
::
EMITTER_DECL
(
EmitGetTupleElement
)
{
auto
get_tuple_element
=
static_cast
<
const
op
::
GetTupleElement
*>
(
n
);
auto
result_tensor_type
=
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_value_type
());
auto
result_tensor_type
=
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_value_type
());
assert
(
result_tensor_type
);
auto
&
result_element_type
=
result_tensor_type
->
get_element_type
();
TU
+=
" {
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
result_element_type
)]
+
">("
+
to_string
(
outputs
.
at
(
0
).
get_index
())
+
")->get_vector() =
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
result_element_type
)]
+
">("
+
to_string
(
inputs
.
at
(
get_tuple_element
->
get_n
()).
get_index
())
+
")->get_vector();
\n
"
TU
+=
" {
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
result_element_type
)]
+
">("
+
to_string
(
outputs
.
at
(
0
).
get_index
())
+
")->get_vector() =
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
result_element_type
)]
+
">("
+
to_string
(
inputs
.
at
(
get_tuple_element
->
get_n
()).
get_index
())
+
")->get_vector();
\n
"
" }
\n
"
;
}
...
...
@@ -242,18 +253,20 @@ void Emitter::EMITTER_DECL(EmitTuple)
for
(
size_t
i
=
0
;
i
<
inputs
.
size
();
++
i
)
{
auto
&
et
=
inputs
.
at
(
i
).
get_tensor_view_layout
()
->
get_element_type
();
TU
+=
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
et
)]
+
">("
+
to_string
(
outputs
.
at
(
i
).
get_index
())
+
")->get_vector() =
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
et
)]
+
">("
+
to_string
(
inputs
.
at
(
i
).
get_index
())
+
")->get_vector();
\n
"
;
TU
+=
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
et
)]
+
">("
+
to_string
(
outputs
.
at
(
i
).
get_index
())
+
")->get_vector() =
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
et
)]
+
">("
+
to_string
(
inputs
.
at
(
i
).
get_index
())
+
")->get_vector();
\n
"
;
}
TU
+=
" }
\n
"
;
}
void
Emitter
::
EMITTER_DECL
(
EmitAbs
)
{
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
->
get_element_type
();
TU
+=
" {
\n
"
...
...
@@ -268,8 +281,7 @@ void Emitter::EMITTER_DECL(EmitAbs)
void
Emitter
::
EMITTER_DECL
(
EmitConcat
)
{
auto
result_tensor_type
=
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_value_type
());
auto
result_tensor_type
=
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_value_type
());
assert
(
result_tensor_type
);
auto
result_shape
=
result_tensor_type
->
get_shape
();
...
...
@@ -277,21 +289,30 @@ void Emitter::EMITTER_DECL(EmitConcat)
if
(
result_shape
.
size
()
==
1
)
{
TU
+=
" {
\n
"
" auto out = call_frame->get_tensor_view_data<"
+
element_type_names
[
TI
(
result_element_type
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
");
\n
"
" EigenVector<"
+
element_type_names
[
TI
(
result_element_type
)]
+
"> out_vector(out, "
EIGEN_VECTOR_FORMAT
(
outputs
[
0
].
get_layout
<
DenseTensorViewLayout
>
()
->
get_size
())
");
\n
"
;
TU
+=
" {
\n
"
" auto out = call_frame->get_tensor_view_data<"
+
element_type_names
[
TI
(
result_element_type
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
");
\n
"
" EigenVector<"
+
element_type_names
[
TI
(
result_element_type
)]
+
"> out_vector(out, "
EIGEN_VECTOR_FORMAT
(
outputs
[
0
].
get_layout
<
DenseTensorViewLayout
>
()
->
get_size
())
");
\n
"
;
size_t
concat_pos
=
0
;
for
(
size_t
i
=
0
;
i
<
inputs
.
size
();
i
++
)
{
TU
+=
" out_vector.segment("
+
to_string
(
concat_pos
)
+
", "
+
to_string
(
inputs
[
i
].
get_tensor_view_layout
()
->
get_shape
().
at
(
0
))
+
") << "
"EigenVector<"
+
element_type_names
[
TI
(
result_element_type
)]
+
">(call_frame->"
"get_tensor_view_data<"
+
element_type_names
[
TI
(
result_element_type
)]
+
">("
+
to_string
(
inputs
[
i
].
get_index
())
+
"), "
EIGEN_VECTOR_FORMAT
(
inputs
[
i
].
get_layout
<
DenseTensorViewLayout
>
()
->
get_size
())
");
\n
"
;
to_string
(
inputs
[
i
].
get_tensor_view_layout
()
->
get_shape
().
at
(
0
))
+
") << "
"EigenVector<"
+
element_type_names
[
TI
(
result_element_type
)]
+
">(call_frame->"
"get_tensor_view_data<"
+
element_type_names
[
TI
(
result_element_type
)]
+
">("
+
to_string
(
inputs
[
i
].
get_index
())
+
"), "
EIGEN_VECTOR_FORMAT
(
inputs
[
i
].
get_layout
<
DenseTensorViewLayout
>
()
->
get_size
())
");
\n
"
;
concat_pos
+=
inputs
[
i
].
get_tensor_view_layout
()
->
get_shape
().
at
(
0
);
}
...
...
@@ -302,10 +323,13 @@ void Emitter::EMITTER_DECL(EmitConcat)
auto
out_layout
=
outputs
[
0
].
get_layout
<
DenseTensorViewLayout
>
();
auto
axis
=
(
dynamic_cast
<
const
op
::
Concat
*>
(
n
))
->
get_concatenation_axis
();
TU
+=
" {
\n
"
" auto out = call_frame->get_tensor_view_data<"
+
element_type_names
[
TI
(
result_element_type
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
");
\n
"
" EigenMatrix<"
+
element_type_names
[
TI
(
result_element_type
)]
+
"> out_matrix(out, "
+
TU
+=
" {
\n
"
" auto out = call_frame->get_tensor_view_data<"
+
element_type_names
[
TI
(
result_element_type
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
");
\n
"
" EigenMatrix<"
+
element_type_names
[
TI
(
result_element_type
)]
+
"> out_matrix(out, "
+
EIGEN_MATRIX_FORMAT
(
out_layout
->
get_shape
(),
out_layout
->
get_strides
())
+
");
\n
"
;
size_t
concat_pos
[
2
]{
0
,
0
};
...
...
@@ -316,9 +340,13 @@ void Emitter::EMITTER_DECL(EmitConcat)
TU
+=
" out_matrix.block("
+
to_string
(
concat_pos
[
0
])
+
", "
+
to_string
(
concat_pos
[
1
])
+
", "
+
to_string
(
arg_shape
.
at
(
0
))
+
", "
+
to_string
(
arg_shape
.
at
(
1
))
+
") << "
"EigenMatrix<"
+
element_type_names
[
TI
(
result_element_type
)]
+
">(call_frame->"
"get_tensor_view_data<"
+
element_type_names
[
TI
(
result_element_type
)]
+
">("
+
to_string
(
arg_shape
.
at
(
1
))
+
") << "
"EigenMatrix<"
+
element_type_names
[
TI
(
result_element_type
)]
+
">(call_frame->"
"get_tensor_view_data<"
+
element_type_names
[
TI
(
result_element_type
)]
+
">("
+
to_string
(
inputs
[
i
].
get_index
())
+
"), "
+
EIGEN_MATRIX_FORMAT
(
arg_layout
->
get_shape
(),
arg_layout
->
get_strides
())
+
");
\n
"
;
...
...
@@ -331,8 +359,8 @@ void Emitter::EMITTER_DECL(EmitConcat)
void
Emitter
::
EMITTER_DECL
(
EmitDivide
)
{
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
->
get_element_type
();
TU
+=
" {
\n
"
...
...
@@ -350,8 +378,8 @@ void Emitter::EMITTER_DECL(EmitDivide)
void
Emitter
::
EMITTER_DECL
(
EmitEqual
)
{
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
->
get_element_type
();
TU
+=
" {
\n
"
...
...
@@ -369,8 +397,8 @@ void Emitter::EMITTER_DECL(EmitEqual)
void
Emitter
::
EMITTER_DECL
(
EmitGreater
)
{
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
->
get_element_type
();
TU
+=
" {
\n
"
...
...
@@ -388,8 +416,8 @@ void Emitter::EMITTER_DECL(EmitGreater)
void
Emitter
::
EMITTER_DECL
(
EmitGreaterEq
)
{
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
->
get_element_type
();
TU
+=
" {
\n
"
...
...
@@ -407,8 +435,8 @@ void Emitter::EMITTER_DECL(EmitGreaterEq)
void
Emitter
::
EMITTER_DECL
(
EmitLess
)
{
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
->
get_element_type
();
TU
+=
" {
\n
"
...
...
@@ -426,8 +454,8 @@ void Emitter::EMITTER_DECL(EmitLess)
void
Emitter
::
EMITTER_DECL
(
EmitLessEq
)
{
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
->
get_element_type
();
TU
+=
" {
\n
"
...
...
@@ -445,8 +473,8 @@ void Emitter::EMITTER_DECL(EmitLessEq)
void
Emitter
::
EMITTER_DECL
(
EmitLog
)
{
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
->
get_element_type
();
TU
+=
" {
\n
"
...
...
@@ -461,8 +489,8 @@ void Emitter::EMITTER_DECL(EmitLog)
void
Emitter
::
EMITTER_DECL
(
EmitMaximum
)
{
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
->
get_element_type
();
TU
+=
" {
\n
"
...
...
@@ -480,8 +508,8 @@ void Emitter::EMITTER_DECL(EmitMaximum)
void
Emitter
::
EMITTER_DECL
(
EmitNegative
)
{
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
->
get_element_type
();
TU
+=
" {
\n
"
...
...
@@ -496,8 +524,8 @@ void Emitter::EMITTER_DECL(EmitNegative)
void
Emitter
::
EMITTER_DECL
(
EmitNotEqual
)
{
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
->
get_element_type
();
TU
+=
" {
\n
"
...
...
@@ -515,8 +543,8 @@ void Emitter::EMITTER_DECL(EmitNotEqual)
void
Emitter
::
EMITTER_DECL
(
EmitSelect
)
{
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
1
)
->
get_value_type
()))
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
1
)
->
get_value_type
()))
->
get_element_type
();
TU
+=
" {
\n
"
...
...
@@ -536,8 +564,8 @@ void Emitter::EMITTER_DECL(EmitSelect)
void
Emitter
::
EMITTER_DECL
(
EmitSubtract
)
{
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
const
element
::
Type
&
et
=
(
dynamic_pointer_cast
<
const
TensorViewType
>
(
n
->
get_arguments
().
at
(
0
)
->
get_value_type
()))
->
get_element_type
();
TU
+=
" {
\n
"
...
...
@@ -555,11 +583,15 @@ void Emitter::EMITTER_DECL(EmitSubtract)
void
Emitter
::
EMITTER_DECL
(
EmitParameterizedConstantBool
)
{
auto
value
=
dynamic_cast
<
const
op
::
ParameterizedConstant
<
ngraph
::
element
::
Bool
>*>
(
n
)
->
get_value
()
->
get_vector
();
TU
+=
" {
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
ngraph
::
element
::
Bool
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
")->get_vector() = std::vector<"
+
element_type_names
[
TI
(
ngraph
::
element
::
Bool
)]
+
auto
value
=
dynamic_cast
<
const
op
::
ParameterizedConstant
<
ngraph
::
element
::
Bool
>*>
(
n
)
->
get_value
()
->
get_vector
();
TU
+=
" {
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
ngraph
::
element
::
Bool
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
")->get_vector() = std::vector<"
+
element_type_names
[
TI
(
ngraph
::
element
::
Bool
)]
+
"::type>{"
;
for
(
size_t
i
=
0
;
i
<
value
.
size
();
i
++
)
...
...
@@ -581,12 +613,16 @@ void Emitter::EMITTER_DECL(EmitParameterizedConstantBool)
void
Emitter
::
EMITTER_DECL
(
EmitParameterizedConstantFloat32
)
{
auto
value
=
dynamic_cast
<
const
op
::
ParameterizedConstant
<
ngraph
::
element
::
Float32
>*>
(
n
)
->
get_value
()
->
get_vector
();
auto
value
=
dynamic_cast
<
const
op
::
ParameterizedConstant
<
ngraph
::
element
::
Float32
>*>
(
n
)
->
get_value
()
->
get_vector
();
TU
+=
" {
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
ngraph
::
element
::
Float32
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
")->get_vector() = std::vector<"
+
element_type_names
[
TI
(
ngraph
::
element
::
Float32
)]
+
"::type>{"
;
TU
+=
" {
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
ngraph
::
element
::
Float32
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
")->get_vector() = std::vector<"
+
element_type_names
[
TI
(
ngraph
::
element
::
Float32
)]
+
"::type>{"
;
for
(
size_t
i
=
0
;
i
<
value
.
size
();
i
++
)
{
...
...
@@ -600,11 +636,15 @@ void Emitter::EMITTER_DECL(EmitParameterizedConstantFloat32)
void
Emitter
::
EMITTER_DECL
(
EmitParameterizedConstantInt8
)
{
auto
value
=
dynamic_cast
<
const
op
::
ParameterizedConstant
<
ngraph
::
element
::
Int8
>*>
(
n
)
->
get_value
()
->
get_vector
();
TU
+=
" {
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
ngraph
::
element
::
Int8
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
")->get_vector() = std::vector<"
+
element_type_names
[
TI
(
ngraph
::
element
::
Int8
)]
+
auto
value
=
dynamic_cast
<
const
op
::
ParameterizedConstant
<
ngraph
::
element
::
Int8
>*>
(
n
)
->
get_value
()
->
get_vector
();
TU
+=
" {
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
ngraph
::
element
::
Int8
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
")->get_vector() = std::vector<"
+
element_type_names
[
TI
(
ngraph
::
element
::
Int8
)]
+
"::type>{"
;
for
(
size_t
i
=
0
;
i
<
value
.
size
();
i
++
)
...
...
@@ -619,11 +659,15 @@ void Emitter::EMITTER_DECL(EmitParameterizedConstantInt8)
void
Emitter
::
EMITTER_DECL
(
EmitParameterizedConstantInt32
)
{
auto
value
=
dynamic_cast
<
const
op
::
ParameterizedConstant
<
ngraph
::
element
::
Int32
>*>
(
n
)
->
get_value
()
->
get_vector
();
TU
+=
" {
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
ngraph
::
element
::
Int32
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
")->get_vector() = std::vector<"
+
element_type_names
[
TI
(
ngraph
::
element
::
Int32
)]
+
auto
value
=
dynamic_cast
<
const
op
::
ParameterizedConstant
<
ngraph
::
element
::
Int32
>*>
(
n
)
->
get_value
()
->
get_vector
();
TU
+=
" {
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
ngraph
::
element
::
Int32
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
")->get_vector() = std::vector<"
+
element_type_names
[
TI
(
ngraph
::
element
::
Int32
)]
+
"::type>{"
;
for
(
size_t
i
=
0
;
i
<
value
.
size
();
i
++
)
...
...
@@ -638,11 +682,15 @@ void Emitter::EMITTER_DECL(EmitParameterizedConstantInt32)
void
Emitter
::
EMITTER_DECL
(
EmitParameterizedConstantInt64
)
{
auto
value
=
dynamic_cast
<
const
op
::
ParameterizedConstant
<
ngraph
::
element
::
Int64
>*>
(
n
)
->
get_value
()
->
get_vector
();
TU
+=
" {
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
ngraph
::
element
::
Int64
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
")->get_vector() = std::vector<"
+
element_type_names
[
TI
(
ngraph
::
element
::
Int64
)]
+
auto
value
=
dynamic_cast
<
const
op
::
ParameterizedConstant
<
ngraph
::
element
::
Int64
>*>
(
n
)
->
get_value
()
->
get_vector
();
TU
+=
" {
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
ngraph
::
element
::
Int64
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
")->get_vector() = std::vector<"
+
element_type_names
[
TI
(
ngraph
::
element
::
Int64
)]
+
"::type>{"
;
for
(
size_t
i
=
0
;
i
<
value
.
size
();
i
++
)
...
...
@@ -657,11 +705,15 @@ void Emitter::EMITTER_DECL(EmitParameterizedConstantInt64)
void
Emitter
::
EMITTER_DECL
(
EmitParameterizedConstantUInt8
)
{
auto
value
=
dynamic_cast
<
const
op
::
ParameterizedConstant
<
ngraph
::
element
::
UInt8
>*>
(
n
)
->
get_value
()
->
get_vector
();
TU
+=
" {
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
ngraph
::
element
::
UInt8
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
")->get_vector() = std::vector<"
+
element_type_names
[
TI
(
ngraph
::
element
::
UInt8
)]
+
auto
value
=
dynamic_cast
<
const
op
::
ParameterizedConstant
<
ngraph
::
element
::
UInt8
>*>
(
n
)
->
get_value
()
->
get_vector
();
TU
+=
" {
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
ngraph
::
element
::
UInt8
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
")->get_vector() = std::vector<"
+
element_type_names
[
TI
(
ngraph
::
element
::
UInt8
)]
+
"::type>{"
;
for
(
size_t
i
=
0
;
i
<
value
.
size
();
i
++
)
...
...
@@ -676,11 +728,15 @@ void Emitter::EMITTER_DECL(EmitParameterizedConstantUInt8)
void
Emitter
::
EMITTER_DECL
(
EmitParameterizedConstantUInt32
)
{
auto
value
=
dynamic_cast
<
const
op
::
ParameterizedConstant
<
ngraph
::
element
::
UInt32
>*>
(
n
)
->
get_value
()
->
get_vector
();
TU
+=
" {
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
ngraph
::
element
::
UInt32
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
")->get_vector() = std::vector<"
+
element_type_names
[
TI
(
ngraph
::
element
::
UInt32
)]
+
auto
value
=
dynamic_cast
<
const
op
::
ParameterizedConstant
<
ngraph
::
element
::
UInt32
>*>
(
n
)
->
get_value
()
->
get_vector
();
TU
+=
" {
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
ngraph
::
element
::
UInt32
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
")->get_vector() = std::vector<"
+
element_type_names
[
TI
(
ngraph
::
element
::
UInt32
)]
+
"::type>{"
;
for
(
size_t
i
=
0
;
i
<
value
.
size
();
i
++
)
...
...
@@ -695,11 +751,15 @@ void Emitter::EMITTER_DECL(EmitParameterizedConstantUInt32)
void
Emitter
::
EMITTER_DECL
(
EmitParameterizedConstantUInt64
)
{
auto
value
=
dynamic_cast
<
const
op
::
ParameterizedConstant
<
ngraph
::
element
::
UInt64
>*>
(
n
)
->
get_value
()
->
get_vector
();
TU
+=
" {
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
ngraph
::
element
::
UInt64
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
")->get_vector() = std::vector<"
+
element_type_names
[
TI
(
ngraph
::
element
::
UInt64
)]
+
auto
value
=
dynamic_cast
<
const
op
::
ParameterizedConstant
<
ngraph
::
element
::
UInt64
>*>
(
n
)
->
get_value
()
->
get_vector
();
TU
+=
" {
\n
"
" call_frame->get_parameterized_tensor_view<"
+
element_type_names
[
TI
(
ngraph
::
element
::
UInt64
)]
+
">("
+
to_string
(
outputs
[
0
].
get_index
())
+
")->get_vector() = std::vector<"
+
element_type_names
[
TI
(
ngraph
::
element
::
UInt64
)]
+
"::type>{"
;
for
(
size_t
i
=
0
;
i
<
value
.
size
();
i
++
)
...
...
src/ngraph/runtime/cpu/emitter.hpp
View file @
22e1368a
...
...
@@ -14,20 +14,20 @@
#pragma once
#include <vector>
#include <string>
#include <vector>
#include "ngraph/node.hpp"
#include "ngraph/runtime/tensor_view_info.hpp"
#include "ngraph/runtime/cpu/external_function.hpp"
#include "ngraph/runtime/tensor_view_info.hpp"
#define EMITTER_DECL(E) E(const ngraph::Node* n, \
#define EMITTER_DECL(E) \
E(const ngraph::Node* n, \
ExternalFunction* ef, \
FunctionMap& function_map, \
const std::vector<TensorViewInfo>& inputs, \
const std::vector<TensorViewInfo>& outputs)
namespace
ngraph
{
namespace
runtime
...
...
@@ -40,9 +40,11 @@ namespace ngraph
std
::
string
TU
;
public
:
Emitter
()
:
TU
(
""
)
{
}
Emitter
()
:
TU
(
""
)
{
}
std
::
string
&
GetTU
()
{
return
TU
;
}
void
EMITTER_DECL
(
EmitNop
);
void
EMITTER_DECL
(
EmitAdd
);
void
EMITTER_DECL
(
EmitDot
);
...
...
@@ -71,7 +73,6 @@ namespace ngraph
void
EMITTER_DECL
(
EmitParameterizedConstantUInt8
);
void
EMITTER_DECL
(
EmitParameterizedConstantUInt32
);
void
EMITTER_DECL
(
EmitParameterizedConstantUInt64
);
};
}
}
...
...
src/ngraph/runtime/cpu/external_function.cpp
View file @
22e1368a
...
...
@@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#include <fstream>
#include <memory>
#include <string>
#include <tuple>
#include <typeindex>
#include <typeinfo>
#include <unordered_map>
#include <string>
#include <fstream>
#include "ngraph/codegen/compiler.hpp"
#include "ngraph/descriptor/input.hpp"
...
...
@@ -70,7 +70,8 @@ using ngraph::descriptor::layout::DenseTensorViewLayout;
#define TI(x) type_index(typeid(x))
static
const
OpMap
dispatcher
{{
TI
(
ngraph
::
op
::
Add
),
&
Emitter
::
EmitAdd
},
static
const
OpMap
dispatcher
{
{
TI
(
ngraph
::
op
::
Add
),
&
Emitter
::
EmitAdd
},
{
TI
(
ngraph
::
op
::
Dot
),
&
Emitter
::
EmitDot
},
{
TI
(
ngraph
::
op
::
Multiply
),
&
Emitter
::
EmitMultiply
},
{
TI
(
ngraph
::
op
::
Parameter
),
&
Emitter
::
EmitNop
},
...
...
@@ -90,16 +91,24 @@ static const OpMap dispatcher{{TI(ngraph::op::Add), &Emitter::EmitAdd},
{
TI
(
ngraph
::
op
::
NotEqual
),
&
Emitter
::
EmitNotEqual
},
{
TI
(
ngraph
::
op
::
Select
),
&
Emitter
::
EmitSelect
},
{
TI
(
ngraph
::
op
::
Subtract
),
&
Emitter
::
EmitSubtract
},
{
TI
(
ngraph
::
op
::
ParameterizedConstant
<
ngraph
::
element
::
Bool
>
),
&
Emitter
::
EmitParameterizedConstantBool
},
{
TI
(
ngraph
::
op
::
ParameterizedConstant
<
ngraph
::
element
::
Float32
>
),
&
Emitter
::
EmitParameterizedConstantFloat32
},
{
TI
(
ngraph
::
op
::
ParameterizedConstant
<
ngraph
::
element
::
Int8
>
),
&
Emitter
::
EmitParameterizedConstantInt8
},
{
TI
(
ngraph
::
op
::
ParameterizedConstant
<
ngraph
::
element
::
Int32
>
),
&
Emitter
::
EmitParameterizedConstantInt32
},
{
TI
(
ngraph
::
op
::
ParameterizedConstant
<
ngraph
::
element
::
Int64
>
),
&
Emitter
::
EmitParameterizedConstantInt64
},
{
TI
(
ngraph
::
op
::
ParameterizedConstant
<
ngraph
::
element
::
UInt8
>
),
&
Emitter
::
EmitParameterizedConstantUInt8
},
{
TI
(
ngraph
::
op
::
ParameterizedConstant
<
ngraph
::
element
::
UInt32
>
),
&
Emitter
::
EmitParameterizedConstantUInt32
},
{
TI
(
ngraph
::
op
::
ParameterizedConstant
<
ngraph
::
element
::
UInt64
>
),
&
Emitter
::
EmitParameterizedConstantUInt64
},
};
{
TI
(
ngraph
::
op
::
ParameterizedConstant
<
ngraph
::
element
::
Bool
>
),
&
Emitter
::
EmitParameterizedConstantBool
},
{
TI
(
ngraph
::
op
::
ParameterizedConstant
<
ngraph
::
element
::
Float32
>
),
&
Emitter
::
EmitParameterizedConstantFloat32
},
{
TI
(
ngraph
::
op
::
ParameterizedConstant
<
ngraph
::
element
::
Int8
>
),
&
Emitter
::
EmitParameterizedConstantInt8
},
{
TI
(
ngraph
::
op
::
ParameterizedConstant
<
ngraph
::
element
::
Int32
>
),
&
Emitter
::
EmitParameterizedConstantInt32
},
{
TI
(
ngraph
::
op
::
ParameterizedConstant
<
ngraph
::
element
::
Int64
>
),
&
Emitter
::
EmitParameterizedConstantInt64
},
{
TI
(
ngraph
::
op
::
ParameterizedConstant
<
ngraph
::
element
::
UInt8
>
),
&
Emitter
::
EmitParameterizedConstantUInt8
},
{
TI
(
ngraph
::
op
::
ParameterizedConstant
<
ngraph
::
element
::
UInt32
>
),
&
Emitter
::
EmitParameterizedConstantUInt32
},
{
TI
(
ngraph
::
op
::
ParameterizedConstant
<
ngraph
::
element
::
UInt64
>
),
&
Emitter
::
EmitParameterizedConstantUInt64
},
};
#undef TI
...
...
@@ -183,15 +192,15 @@ void ExternalFunction::compile(FunctionMap& function_map)
Emitter
emitter
;
auto
&
TU
=
emitter
.
GetTU
();
TU
+=
R"(
#include <vector>
#include <memory>
#include <vector>
#include <Eigen/Dense>
#include "ngraph/descriptor/layout/dense_tensor_view_layout.hpp"
#include "ngraph/runtime/tensor_view_info.hpp"
#include "ngraph/runtime/cpu/call_frame.hpp"
#include "ngraph/runtime/cpu/eigen_utils.hpp"
#include "ngraph/runtime/tensor_view_info.hpp"
void *__dso_handle = 0;
...
...
@@ -247,8 +256,8 @@ extern "C" void __entrypoint(ngraph::runtime::cpu::CallFrame* call_frame,
assert
(
llvm_module
);
estate
.
add_module
(
llvm_module
);
estate
.
finalize
();
compiled_function
=
estate
.
find_function
<
void
(
ngraph
::
runtime
::
cpu
::
CallFrame
*
,
ngraph
::
runtime
::
TensorViewPtrs
&
)
>
(
"__entrypoint"
);
compiled_function
=
estate
.
find_function
<
void
(
ngraph
::
runtime
::
cpu
::
CallFrame
*
,
ngraph
::
runtime
::
TensorViewPtrs
&
)
>
(
"__entrypoint"
);
assert
(
compiled_function
);
m_is_compiled
=
true
;
...
...
src/ngraph/runtime/cpu/external_function.hpp
View file @
22e1368a
...
...
@@ -14,14 +14,14 @@
#pragma once
#include <functional>
#include <memory>
#include <typeindex>
#include <typeinfo>
#include <unordered_map>
#include <functional>
#include "ngraph/function.hpp"
#include "ngraph/codegen/compiler.hpp"
#include "ngraph/function.hpp"
#include "ngraph/runtime/external_function.hpp"
#include "ngraph/runtime/tensor_view_info.hpp"
...
...
@@ -35,8 +35,8 @@ namespace ngraph
class
Emitter
;
class
CallFrame
;
using
FunctionMap
=
std
::
unordered_map
<
std
::
shared_ptr
<
Function
>
,
std
::
shared_ptr
<
ExternalFunction
>>
;
using
FunctionMap
=
std
::
unordered_map
<
std
::
shared_ptr
<
Function
>
,
std
::
shared_ptr
<
ExternalFunction
>>
;
using
OpFunction
=
std
::
function
<
void
(
Emitter
*
,
const
ngraph
::
Node
*
,
...
...
@@ -47,7 +47,8 @@ namespace ngraph
using
OpMap
=
std
::
unordered_map
<
std
::
type_index
,
OpFunction
>
;
using
EntryPoint
=
std
::
function
<
void
(
ngraph
::
runtime
::
cpu
::
CallFrame
*
,
ngraph
::
runtime
::
TensorViewPtrs
&
)
>
;
using
EntryPoint
=
std
::
function
<
void
(
ngraph
::
runtime
::
cpu
::
CallFrame
*
,
ngraph
::
runtime
::
TensorViewPtrs
&
)
>
;
class
ExternalFunction
:
public
ngraph
::
runtime
::
ExternalFunction
{
...
...
@@ -55,6 +56,7 @@ namespace ngraph
ExternalFunction
(
const
std
::
shared_ptr
<
ngraph
::
Function
>&
function
,
bool
release_function
=
true
);
std
::
shared_ptr
<
ngraph
::
runtime
::
CallFrame
>
make_call_frame
();
protected
:
void
compile
(
FunctionMap
&
function_map
);
...
...
test/cpu.cpp
View file @
22e1368a
...
...
@@ -803,7 +803,6 @@ TEST(cpu, greater)
ASSERT_EQ
((
vector
<
char
>
{
0
,
1
,
0
,
1
,
0
,
1
,
1
,
0
}),
result
->
get_vector
());
}
TEST
(
cpu
,
greatereq
)
{
auto
shape
=
Shape
{
2
,
2
,
2
};
...
...
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