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
a89c33b4
Commit
a89c33b4
authored
Sep 01, 2017
by
Scott Cyphers
Committed by
GitHub
Sep 01, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #75 from NervanaSystems/bob/relax_requirements
Bob/relax requirements
parents
6a4225c0
ed84369d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
48 deletions
+23
-48
CMakeLists.txt
CMakeLists.txt
+3
-32
clang_4_0_flags.cmake
cmake/clang_4_0_flags.cmake
+1
-1
node.cpp
src/ngraph/node.cpp
+17
-14
util.hpp
src/util.hpp
+1
-0
CMakeLists.txt
test/CMakeLists.txt
+1
-1
No files found.
CMakeLists.txt
View file @
a89c33b4
...
...
@@ -11,41 +11,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# We require version 3.5.1 only because that's the lowest version of CMake on which
# we've validate this repository.
cmake_minimum_required
(
VERSION 3.5.1
)
cmake_minimum_required
(
VERSION 2.8
)
# Suppress an OS X-specific warning.
if
(
POLICY CMP0042
)
cmake_policy
(
SET CMP0042 OLD
)
endif
()
if
(
"
${
CMAKE_CXX_COMPILER
}
"
STREQUAL
""
)
# The user didn't indicate a compiler preference, to pick the compiler based on
# the personal preferences and convenience of the project's developers...
find_program
(
CXX_COMPILER
NAMES
clang++-4.0
clang++-3.9
clang++
c++
NAMES_PER_DIR
DOC
"Which C++ compiler to use when building `libngraph` and the tests."
)
if
(
"
${
CXX_COMPILER
}
"
STREQUAL
"CXX_COMPILER-NOTFOUND"
)
message
(
FATAL_ERROR
"Unable to find a suitable c++ compiler."
)
else
()
message
(
STATUS
"Using C++ compiler: '
${
CXX_COMPILER
}
'"
)
set
(
CMAKE_CXX_COMPILER
"
${
CXX_COMPILER
}
"
)
endif
()
endif
()
project
(
ngraph
LANGUAGES CXX
VERSION 0.1
)
project
(
ngraph
)
# These variables are undocumented but useful.
set
(
CMAKE_DISABLE_SOURCE_CHANGES ON
)
...
...
@@ -63,10 +36,8 @@ set(NGRAPH_CXX_WARNING_FLAGS "")
# Compiler-specific logic...
if
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
MATCHES
"^(Apple)?Clang$"
)
message
(
"
using project warning flags
"
)
message
(
"
setting clang flags...
"
)
include
(
cmake/clang_4_0_flags.cmake
)
else
()
message
(
WARNING
"CMAKE_CXX_COMPILER_ID='
${
CMAKE_CXX_COMPILER_ID
}
'. CMAKE_CXX_COMPILER='
${
CMAKE_CXX_COMPILER
}
'. The only supported compiler is 'clang', but the selected compiler is '
${
CMAKE_CXX_COMPILER
}
'."
)
endif
()
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-std=c++11"
)
...
...
cmake/clang_4_0_flags.cmake
View file @
a89c33b4
...
...
@@ -18,7 +18,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=inconsistent-missing-override")
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Weverything"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-c++98-compat"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-c++98-compat-pedantic"
)
#
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-weak-vtables")
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-weak-vtables"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-global-constructors"
)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch-enum")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments")
...
...
src/ngraph/node.cpp
View file @
a89c33b4
...
...
@@ -39,21 +39,24 @@ bool ngraph::Node::is_parameter() const
return
dynamic_cast
<
const
ngraph
::
Parameter
*>
(
this
)
!=
nullptr
;
}
std
::
ostream
&
ngraph
::
operator
<<
(
std
::
ostream
&
out
,
const
ngraph
::
Node
&
node
)
namespace
ngraph
{
auto
op_tmp
=
dynamic_cast
<
const
ngraph
::
Op
*>
(
&
node
);
auto
parameter_tmp
=
dynamic_cast
<
const
ngraph
::
Op
*>
(
&
node
);
if
(
op_tmp
)
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
ngraph
::
Node
&
node
)
{
out
<<
"Op("
<<
op_tmp
->
node_id
()
<<
")"
;
auto
op_tmp
=
dynamic_cast
<
const
ngraph
::
Op
*>
(
&
node
);
auto
parameter_tmp
=
dynamic_cast
<
const
ngraph
::
Op
*>
(
&
node
);
if
(
op_tmp
)
{
out
<<
"Op("
<<
op_tmp
->
node_id
()
<<
")"
;
}
else
if
(
parameter_tmp
)
{
out
<<
"Parameter("
<<
parameter_tmp
->
node_id
()
<<
")"
;
}
else
{
out
<<
"Node("
<<
node
.
node_id
()
<<
")"
;
}
return
out
;
}
else
if
(
parameter_tmp
)
{
out
<<
"Parameter("
<<
parameter_tmp
->
node_id
()
<<
")"
;
}
else
{
out
<<
"Node("
<<
node
.
node_id
()
<<
")"
;
}
return
out
;
}
src/util.hpp
View file @
a89c33b4
...
...
@@ -21,6 +21,7 @@
#include <sstream>
#include <string>
#include <vector>
#include <memory>
namespace
ngraph
{
...
...
test/CMakeLists.txt
View file @
a89c33b4
...
...
@@ -36,7 +36,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCURDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}
add_executable
(
unit-test
${
SRC
}
)
target_link_libraries
(
unit-test ngraph
pthread libgtest
)
target_link_libraries
(
unit-test ngraph
libgtest pthread
)
target_link_libraries
(
unit-test
${
CMAKE_DL_LIBS
}
)
add_dependencies
(
unit-test ngraph libgtest
)
...
...
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