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
2c69f2bf
Commit
2c69f2bf
authored
6 years ago
by
Jaikrishnan Menon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CPU Direct Execution: Implement Or
parent
cf220930
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
2 deletions
+56
-2
cpu_builder.cpp
src/ngraph/runtime/cpu/cpu_builder.cpp
+5
-2
or.hpp
src/ngraph/runtime/cpu/kernel/or.hpp
+51
-0
No files found.
src/ngraph/runtime/cpu/cpu_builder.cpp
View file @
2c69f2bf
...
@@ -99,6 +99,7 @@
...
@@ -99,6 +99,7 @@
#include "ngraph/runtime/cpu/kernel/negative.hpp"
#include "ngraph/runtime/cpu/kernel/negative.hpp"
#include "ngraph/runtime/cpu/kernel/not.hpp"
#include "ngraph/runtime/cpu/kernel/not.hpp"
#include "ngraph/runtime/cpu/kernel/not_equal.hpp"
#include "ngraph/runtime/cpu/kernel/not_equal.hpp"
#include "ngraph/runtime/cpu/kernel/or.hpp"
#include "ngraph/runtime/cpu/kernel/relu.hpp"
#include "ngraph/runtime/cpu/kernel/relu.hpp"
#include "ngraph/runtime/cpu/kernel/result.hpp"
#include "ngraph/runtime/cpu/kernel/result.hpp"
#include "ngraph/runtime/cpu/kernel/sign.hpp"
#include "ngraph/runtime/cpu/kernel/sign.hpp"
...
@@ -194,7 +195,8 @@ namespace ngraph
...
@@ -194,7 +195,8 @@ namespace ngraph
auto
&
out0_tensor
=
tensor_data
[
out
[
0
].
get_name
()];
auto
&
out0_tensor
=
tensor_data
[
out
[
0
].
get_name
()];
auto
functor
=
[
&
,
element_count
](
CPURuntimeContext
*
ctx
)
{
auto
functor
=
[
&
,
element_count
](
CPURuntimeContext
*
ctx
)
{
runtime
::
cpu
::
kernel
::
logical_and
(
arg0_tensor
,
arg1_tensor
,
out0_tensor
,
element_count
);
runtime
::
cpu
::
kernel
::
logical_and
(
arg0_tensor
,
arg1_tensor
,
out0_tensor
,
element_count
);
};
};
functors
.
emplace_back
(
functor
);
functors
.
emplace_back
(
functor
);
}
}
...
@@ -211,7 +213,8 @@ namespace ngraph
...
@@ -211,7 +213,8 @@ namespace ngraph
auto
&
out0_tensor
=
tensor_data
[
out
[
0
].
get_name
()];
auto
&
out0_tensor
=
tensor_data
[
out
[
0
].
get_name
()];
auto
functor
=
[
&
,
element_count
](
CPURuntimeContext
*
ctx
)
{
auto
functor
=
[
&
,
element_count
](
CPURuntimeContext
*
ctx
)
{
runtime
::
cpu
::
kernel
::
logical_or
(
arg0_tensor
,
arg1_tensor
,
out0_tensor
,
element_count
);
runtime
::
cpu
::
kernel
::
logical_or
(
arg0_tensor
,
arg1_tensor
,
out0_tensor
,
element_count
);
};
};
functors
.
emplace_back
(
functor
);
functors
.
emplace_back
(
functor
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/ngraph/runtime/cpu/kernel/or.hpp
0 → 100644
View file @
2c69f2bf
/*******************************************************************************
* Copyright 2018 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
#pragma once
#define EIGEN_USE_THREADS
#include <unsupported/Eigen/CXX11/Tensor>
#include "ngraph/runtime/cpu/kernel/eigen_thread_pool.hpp"
namespace
ngraph
{
namespace
runtime
{
namespace
cpu
{
namespace
kernel
{
void
logical_or
(
void
*
input0
,
void
*
input1
,
void
*
output
,
size_t
count
)
{
Eigen
::
array
<
Eigen
::
Index
,
1
>
out_dims
,
in_dims
;
out_dims
[
0
]
=
in_dims
[
0
]
=
count
;
Eigen
::
TensorMap
<
Eigen
::
Tensor
<
char
,
1
,
Eigen
::
RowMajor
>>
out
(
static_cast
<
char
*>
(
output
),
out_dims
);
Eigen
::
TensorMap
<
Eigen
::
Tensor
<
char
,
1
,
Eigen
::
RowMajor
>>
in0
(
static_cast
<
char
*>
(
input0
),
in_dims
);
Eigen
::
TensorMap
<
Eigen
::
Tensor
<
char
,
1
,
Eigen
::
RowMajor
>>
in1
(
static_cast
<
char
*>
(
input1
),
in_dims
);
out
.
device
(
eigen
::
global_thread_pool_device
)
=
(
in0
||
in1
).
template
cast
<
char
>
();
}
}
}
}
}
This diff is collapsed.
Click to expand it.
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