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
1cde662e
Commit
1cde662e
authored
Feb 13, 2018
by
Jaikrishnan Menon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CPU: Rework
parent
2a438ff2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
10 deletions
+43
-10
cpu_external_function.cpp
src/ngraph/runtime/cpu/cpu_external_function.cpp
+1
-1
cpu_external_function.hpp
src/ngraph/runtime/cpu/cpu_external_function.hpp
+3
-7
mkldnn_emitter.hpp
src/ngraph/runtime/cpu/mkldnn_emitter.hpp
+3
-2
mkldnn_invoke.cpp
src/ngraph/runtime/cpu/mkldnn_invoke.cpp
+5
-0
mkldnn_utils.hpp
src/ngraph/runtime/cpu/mkldnn_utils.hpp
+31
-0
No files found.
src/ngraph/runtime/cpu/cpu_external_function.cpp
View file @
1cde662e
...
...
@@ -226,7 +226,7 @@ void runtime::cpu::CPU_ExternalFunction::compile()
string
function_name
=
m_function
->
get_name
();
mkldnn_emitter
.
reset
(
new
MKLDNNEmitter
(
shared_from_this
()));
m
_m
kldnn_emitter
.
reset
(
new
MKLDNNEmitter
(
shared_from_this
()));
pass
::
Manager
pass_manager
;
// For now, just make everyone row-major.
...
...
src/ngraph/runtime/cpu/cpu_external_function.hpp
View file @
1cde662e
...
...
@@ -24,8 +24,6 @@
#include <unordered_map>
#include <vector>
#include <mkldnn.hpp>
#include "ngraph/codegen/code_writer.hpp"
#include "ngraph/codegen/compiler.hpp"
#include "ngraph/codegen/execution_engine.hpp"
...
...
@@ -44,7 +42,6 @@ namespace ngraph
class
CPU_ExternalFunction
;
class
CPU_Emitter
;
class
CPU_CallFrame
;
class
MKLDNNEmitter
;
using
OpFunction
=
std
::
function
<
void
(
codegen
::
CodeWriter
&
,
const
ngraph
::
Node
*
,
...
...
@@ -79,9 +76,9 @@ namespace ngraph
std
::
shared_ptr
<
ngraph
::
runtime
::
CallFrame
>
make_call_frame
();
const
std
::
vector
<
OpAttributes
>&
get_op_attrs
()
const
{
return
m_op_attrs
;
}
const
std
::
vector
<
mkldnn
::
primitive
>&
get_mkldnn_primitives
()
const
const
std
::
unique_ptr
<
MKLDNNEmitter
>&
get_mkldnn_emitter
()
const
{
return
m_mkldnn_
primitives
;
return
m_mkldnn_
emitter
;
}
protected
:
...
...
@@ -117,8 +114,7 @@ namespace ngraph
std
::
unordered_map
<
std
::
string
,
std
::
string
>
m_variable_name_map
;
std
::
vector
<
OpAttributes
>
m_op_attrs
;
std
::
vector
<
mkldnn
::
primitive
>
m_mkldnn_primitives
;
std
::
unique_ptr
<
MKLDNNEmitter
>
mkldnn_emitter
;
std
::
unique_ptr
<
MKLDNNEmitter
>
m_mkldnn_emitter
;
};
}
}
...
...
src/ngraph/runtime/cpu/mkldnn_emitter.hpp
View file @
1cde662e
...
...
@@ -15,9 +15,9 @@
#pragma once
#include <memory>
#include <vector>
#include "ngraph/codegen/code_writer.hpp"
#include "ngraph/shape.hpp"
#include <mkldnn.hpp>
namespace
ngraph
{
...
...
@@ -39,6 +39,7 @@ namespace ngraph
private
:
std
::
shared_ptr
<
CPU_ExternalFunction
>
external_function
;
std
::
vector
<
mkldnn
::
primitive
>
mkldnn_primitives
;
};
}
}
...
...
src/ngraph/runtime/cpu/mkldnn_invoke.cpp
View file @
1cde662e
...
...
@@ -12,7 +12,12 @@
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#include <mkldnn.hpp>
#include "mkldnn_invoke.hpp"
#include "ngraph/runtime/cpu/mkldnn_utils.hpp"
mkldnn
::
engine
ngraph
::
runtime
::
cpu
::
mkldnn_utils
::
global_cpu_engine
(
mkldnn
::
engine
::
cpu
,
0
);
extern
"C"
void
ngraph
::
runtime
::
cpu
::
mkldnn_utils
::
mkldnn_invoke_primitive
(
CPURuntimeContext
*
ctx
,
...
...
src/ngraph/runtime/cpu/mkldnn_utils.hpp
0 → 100644
View file @
1cde662e
// ----------------------------------------------------------------------------
// Copyright 2018 Nervana Systems Inc.
// 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
// ----------------------------------------------------------------------------
#pragma once
#include <mkldnn.hpp>
namespace
ngraph
{
namespace
runtime
{
namespace
cpu
{
namespace
mkldnn_utils
{
extern
mkldnn
::
engine
global_cpu_engine
;
}
}
}
}
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