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
58a8cde2
Commit
58a8cde2
authored
Sep 01, 2017
by
Scott Cyphers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable warning that makes it hard to see the other warnings
Disable infinite recursion in ScalarConstant::node_id()
parent
b839784e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
61 deletions
+66
-61
clang_4_0_flags.cmake
cmake/clang_4_0_flags.cmake
+1
-0
element_type.hpp
src/ngraph/element_type.hpp
+61
-57
node.hpp
src/ngraph/node.hpp
+2
-2
constant.hpp
src/ngraph/ops/constant.hpp
+1
-1
parameter.hpp
src/ngraph/ops/parameter.hpp
+1
-1
No files found.
cmake/clang_4_0_flags.cmake
View file @
58a8cde2
...
...
@@ -39,6 +39,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-padded")
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-potentially-evaluated-expression"
)
# Triggers false alarms on typeid
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-sign-compare"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-unused-parameter"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-weak-vtables"
)
# Not ready for this yet
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-conversion")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-float-equal")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-duplicate-enum") # from numpy
...
...
src/ngraph/element_type.hpp
View file @
58a8cde2
...
...
@@ -22,6 +22,8 @@
#include <string>
#include <type_traits>
#include "except.hpp"
namespace
ngraph
{
namespace
element
...
...
@@ -49,92 +51,94 @@ namespace ngraph
const
std
::
string
m_cname
;
};
// Provides a compile-time name for a C++ type.
// Used in TraitedType for the string that supplies the C++ type name.
template
<
typename
T
>
const
char
*
traited_type_name
()
{
throw
ngraph_error
(
"Unkmown type"
);
}
// Literals (and probably other things we don't know about yet) need to have their C++ types
// and element types coordinated. Every element type corresponds to a TraitedType which provides
// access to both the instance and the C++ type used to hold the value during compilation.
template
<
typename
T
,
typename
U
>
template
<
typename
T
>
class
TraitedType
:
public
Type
{
protected
:
TraitedType
(
const
std
::
string
&
cname
)
TraitedType
()
:
Type
(
sizeof
(
T
)
*
8
,
std
::
is_floating_point
<
T
>::
value
,
std
::
is_signed
<
T
>::
value
,
cname
)
traited_type_name
<
T
>
()
)
{
}
public
:
// This is the C++ type used to hold a value of this element type during compilation
using
type
=
T
;
// This
i
s a reference to an instance of this element type.
static
const
U
&
element_type
(){
static
U
t
;
// This
return
s a reference to an instance of this element type.
static
const
TraitedType
<
T
>
&
element_type
(){
static
TraitedType
<
T
>
t
;
return
t
;
}
};
class
Float
:
public
TraitedType
<
float
,
Float
>
template
<>
constexpr
const
char
*
traited_type_name
<
float
>
()
{
friend
class
TraitedType
<
float
,
Float
>
;
Float
()
:
TraitedType
<
float
,
Float
>
(
"float"
)
{
}
};
return
"float"
;
}
using
Float
=
TraitedType
<
float
>
;
class
Int8
:
public
TraitedType
<
int8_t
,
Int8
>
template
<>
constexpr
const
char
*
traited_type_name
<
int8_t
>
()
{
friend
class
TraitedType
<
int8_t
,
Int8
>
;
Int8
()
:
TraitedType
<
int8_t
,
Int8
>
(
"int8_t"
)
{
}
};
class
Int32
:
public
TraitedType
<
int32_t
,
Int32
>
return
"int8_t"
;
}
using
Int8
=
TraitedType
<
int8_t
>
;
template
<>
constexpr
const
char
*
traited_type_name
<
int32_t
>
()
{
friend
class
TraitedType
<
int32_t
,
Int32
>
;
Int32
()
:
TraitedType
<
int32_t
,
Int32
>
(
"int32_t"
)
{
}
};
return
"int32_t"
;
}
class
Int64
:
public
TraitedType
<
int64_t
,
Int64
>
using
Int32
=
TraitedType
<
int32_t
>
;
template
<>
constexpr
const
char
*
traited_type_name
<
int64_t
>
()
{
friend
class
TraitedType
<
int64_t
,
Int64
>
;
Int64
()
:
TraitedType
<
int64_t
,
Int64
>
(
"int64_t"
)
{
}
};
return
"int64_t"
;
}
using
Int64
=
TraitedType
<
int64_t
>
;
class
UInt8
:
public
TraitedType
<
uint8_t
,
UInt8
>
template
<>
constexpr
const
char
*
traited_type_name
<
uint8_t
>
()
{
friend
class
TraitedType
<
uint8_t
,
UInt8
>
;
UInt8
()
:
TraitedType
<
uint8_t
,
UInt8
>
(
"uint8_t"
)
{
}
};
class
UInt32
:
public
TraitedType
<
uint32_t
,
UInt32
>
return
"uint8_t"
;
}
using
UInt8
=
TraitedType
<
uint8_t
>
;
template
<>
constexpr
const
char
*
traited_type_name
<
uint32_t
>
()
{
friend
class
TraitedType
<
uint32_t
,
UInt32
>
;
UInt32
()
:
TraitedType
<
uint32_t
,
UInt32
>
(
"uint32_t"
)
{
}
};
return
"uint32_t"
;
}
using
UInt32
=
TraitedType
<
uint32_t
>
;
class
UInt64
:
public
TraitedType
<
uint64_t
,
UInt64
>
template
<>
constexpr
const
char
*
traited_type_name
<
uint64_t
>
()
{
friend
class
TraitedType
<
uint64_t
,
UInt64
>
;
UInt64
()
:
TraitedType
<
uint64_t
,
UInt64
>
(
"uint64_t"
)
{
}
};
return
"uint64_t"
;
}
using
UInt64
=
TraitedType
<
uint64_t
>
;
}
}
src/ngraph/node.hpp
View file @
58a8cde2
...
...
@@ -67,8 +67,8 @@ namespace ngraph
return
typeid
(
*
this
)
==
typeid
(
*
node
.
get
());
}
virtual
bool
is_op
()
const
{
return
false
;
}
;
virtual
bool
is_parameter
()
const
{
return
false
;
}
;
virtual
bool
is_op
()
const
{
return
false
;
}
virtual
bool
is_parameter
()
const
{
return
false
;
}
size_t
instance_id
()
const
{
return
m_instance_id
;
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
,
const
Node
&
);
...
...
src/ngraph/ops/constant.hpp
View file @
58a8cde2
...
...
@@ -53,7 +53,7 @@ namespace ngraph
virtual
std
::
string
node_id
()
const
override
{
std
::
stringstream
ss
;
ss
<<
description
()
<<
"_"
<<
node_id
()
;
ss
<<
description
()
<<
"_"
/* << node_id() */
;
return
ss
.
str
();
}
...
...
src/ngraph/ops/parameter.hpp
View file @
58a8cde2
...
...
@@ -41,7 +41,7 @@ namespace ngraph
std
::
string
description
()
const
override
{
return
"Parameter"
;
}
virtual
void
propagate_types
()
override
;
virtual
std
::
string
node_id
()
const
override
;
virtual
bool
is_parameter
()
const
override
{
return
true
;
}
;
virtual
bool
is_parameter
()
const
override
{
return
true
;
}
protected
:
Function
*
m_function
;
...
...
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