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
a489a2ba
Unverified
Commit
a489a2ba
authored
Aug 02, 2019
by
Scott Cyphers
Committed by
GitHub
Aug 02, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into cyphers/patterndesc
parents
f2598995
1c9607bc
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
133 additions
and
5 deletions
+133
-5
CMakeLists.txt
CMakeLists.txt
+2
-1
git_tags.cmake
cmake/Modules/git_tags.cmake
+11
-1
create_release.py
maint/create_release.py
+65
-0
broadcasting.hpp
src/ngraph/op/util/broadcasting.hpp
+3
-3
CMakeLists.txt
src/ngraph/runtime/plaidml/CMakeLists.txt
+2
-0
plaidml_backend_visibility.hpp
src/ngraph/runtime/plaidml/plaidml_backend_visibility.hpp
+50
-0
No files found.
CMakeLists.txt
View file @
a489a2ba
...
...
@@ -40,8 +40,9 @@ include(var_functions)
NGRAPH_GET_VERSION_LABEL
()
string
(
REGEX MATCH
"([0-9?]+)
\\
.([0-9?]+)
\\
.([0-9?]+)(-
rc
\\
.[0-9?]+)?"
NGRAPH_VERSION_SHORT
"
${
NGRAPH_VERSION_LABEL
}
"
)
string
(
REGEX MATCH
"([0-9?]+)
\\
.([0-9?]+)
\\
.([0-9?]+)(-
(rc|dev)
\\
.[0-9?]+)?"
NGRAPH_VERSION_SHORT
"
${
NGRAPH_VERSION_LABEL
}
"
)
string
(
REGEX REPLACE
"-rc."
"rc"
NGRAPH_WHEEL_VERSION
"
${
NGRAPH_VERSION_SHORT
}
"
)
string
(
REGEX REPLACE
"-dev."
"dev"
NGRAPH_WHEEL_VERSION
"
${
NGRAPH_WHEEL_VERSION
}
"
)
string
(
REGEX MATCH
"([0-9?]+)
\\
.([0-9?]+)"
NGRAPH_API_VERSION
"
${
NGRAPH_VERSION_LABEL
}
"
)
string
(
REGEX MATCH
"[^v](.*)"
NGRAPH_VERSION
"
${
NGRAPH_VERSION_LABEL
}
"
)
string
(
REPLACE
"."
";"
NGRAPH_VERSION_PARTS
"
${
NGRAPH_VERSION_SHORT
}
"
)
...
...
cmake/Modules/git_tags.cmake
View file @
a489a2ba
...
...
@@ -23,6 +23,9 @@ function(NGRAPH_GET_CURRENT_HASH)
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
ERROR_QUIET
)
if
(
NOT HASH
)
return
()
endif
()
string
(
STRIP
${
HASH
}
HASH
)
set
(
NGRAPH_CURRENT_HASH
${
HASH
}
PARENT_SCOPE
)
endfunction
()
...
...
@@ -75,7 +78,14 @@ function(NGRAPH_GET_VERSION_LABEL)
if
(
NOT
${
NGRAPH_MOST_RECENT_RELEASE_TAG
}
STREQUAL
""
)
set
(
NGRAPH_VERSION_LABEL
"
${
NGRAPH_MOST_RECENT_RELEASE_TAG
}
+
${
HASH
}
"
PARENT_SCOPE
)
else
()
set
(
NGRAPH_VERSION_LABEL
"?.?.?+
${
HASH
}
"
PARENT_SCOPE
)
if
(
HASH
)
set
(
NGRAPH_VERSION_LABEL
"?.?.?+
${
HASH
}
"
PARENT_SCOPE
)
else
()
# Not in a git repo
file
(
READ
${
CMAKE_SOURCE_DIR
}
/TAG NGRAPH_TAG
)
string
(
STRIP
${
NGRAPH_TAG
}
NGRAPH_TAG
)
set
(
NGRAPH_VERSION_LABEL
"
${
NGRAPH_TAG
}
"
PARENT_SCOPE
)
endif
()
endif
()
endif
()
endfunction
()
maint/create_release.py
0 → 100644
View file @
a489a2ba
# ******************************************************************************
# Copyright 2017-2019 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.
# ******************************************************************************
import
sys
import
os
import
subprocess
import
tempfile
import
tarfile
import
zipfile
assert
sys
.
version_info
>=
(
3
,
4
)
swd
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
swd
=
swd
+
'/..'
swd
=
os
.
path
.
realpath
(
swd
)
get_tag
=
subprocess
.
Popen
([
'git'
,
'describe'
,
'--tags'
,
'--abbrev=0'
,
'--match'
,
'v*.*.*'
],
cwd
=
swd
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
tag
=
[
line
.
strip
()
.
decode
()
for
line
in
get_tag
.
stdout
.
readlines
()]
retval
=
get_tag
.
wait
()
get_files
=
subprocess
.
Popen
([
'git'
,
'ls-tree'
,
'-r'
,
'HEAD'
,
'--name-only'
],
cwd
=
swd
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
files
=
[
line
.
strip
()
.
decode
()
for
line
in
get_files
.
stdout
.
readlines
()]
retval
=
get_files
.
wait
()
# create tarball for Linux and macOS
with
tarfile
.
open
(
swd
+
'/ngraph-'
+
tag
[
0
]
+
'.tar.gz'
,
'w:gz'
)
as
tar
:
for
f
in
files
:
file_path
=
swd
+
'/'
+
f
tar
.
add
(
file_path
,
arcname
=
'ngraph-'
+
tag
[
0
][
1
:]
+
'/'
+
f
)
with
tempfile
.
NamedTemporaryFile
()
as
tag_file
:
tag_line
=
tag
[
0
]
+
'
\n
'
tag_file
.
write
(
tag_line
.
encode
())
tag_file
.
flush
()
tar
.
add
(
tag_file
.
name
,
arcname
=
'ngraph-'
+
tag
[
0
][
1
:]
+
'/TAG'
)
# create zipfile for Windows
TO
=
b
'
\r\n
'
FROM
=
b
'
\n
'
with
zipfile
.
ZipFile
(
swd
+
'/ngraph-'
+
tag
[
0
]
+
'.zip'
,
'w'
,
zipfile
.
ZIP_DEFLATED
)
as
zipf
:
for
f
in
files
:
with
open
(
file_path
,
'rb'
)
as
unix_file
:
win_content
=
unix_file
.
read
()
.
replace
(
FROM
,
TO
)
with
tempfile
.
NamedTemporaryFile
()
as
win_file
:
win_file
.
write
(
win_content
)
zipf
.
write
(
win_file
.
name
,
arcname
=
'ngraph-'
+
tag
[
0
][
1
:]
+
'/'
+
f
)
with
tempfile
.
NamedTemporaryFile
()
as
tag_file
:
tag_line
=
tag
[
0
]
+
'
\r\n
'
tag_file
.
write
(
tag_line
.
encode
())
tag_file
.
flush
()
zipf
.
write
(
tag_file
.
name
,
arcname
=
'ngraph-'
+
tag
[
0
][
1
:]
+
'/TAG'
)
src/ngraph/op/util/broadcasting.hpp
View file @
a489a2ba
...
...
@@ -33,7 +33,7 @@ namespace ngraph
///
/// \return Numpy-style broadcasted list of nodes.
NodeVector
numpy_style_broadcast
(
const
NodeVector
&
inputs
)
NGRAPH_DEPRECATED
(
"Replace with numpy_style_
value_broadcast
"
);
NGRAPH_DEPRECATED
(
"Replace with numpy_style_
broadcast_values
"
);
/// \brief Cast shape of all input nodes for an element-wise operation that requires shape-compatibility
///
...
...
@@ -68,7 +68,7 @@ namespace ngraph
NodeVector
legacy_style_broadcast_for_binary_operation
(
const
std
::
shared_ptr
<
Node
>&
left
,
const
std
::
shared_ptr
<
Node
>&
right
,
size_t
start_match_axis
)
NGRAPH_DEPRECATED
(
"Replace with legacy_style_
value_broadcast
_for_binary_operation"
);
NGRAPH_DEPRECATED
(
"Replace with legacy_style_
broadcast_values
_for_binary_operation"
);
/// \brief Cast shape of two outputs to make them compatible for an element-wise binary operation.
///
...
...
@@ -103,7 +103,7 @@ namespace ngraph
///
NodeVector
numpy_style_broadcast_for_matmul_operation
(
const
std
::
shared_ptr
<
Node
>&
left
,
const
std
::
shared_ptr
<
Node
>&
right
)
NGRAPH_DEPRECATED
(
"Replace with numpy_style_broadcast_value_for_matmul_operation."
);
NGRAPH_DEPRECATED
(
"Replace with numpy_style_broadcast_value
s
_for_matmul_operation."
);
/// \brief Broadcast shape of two nodes to make them compatible for a matrix multiplication.
///
...
...
src/ngraph/runtime/plaidml/CMakeLists.txt
View file @
a489a2ba
...
...
@@ -74,6 +74,8 @@ target_include_directories(plaidml_backend SYSTEM PUBLIC ${PLAIDML_INCLUDE_DIRS}
target_link_libraries
(
plaidml_backend PUBLIC ngraph libplaidml
)
install
(
TARGETS plaidml_backend LIBRARY DESTINATION
${
NGRAPH_INSTALL_LIB
}
)
target_compile_definitions
(
plaidml_backend PRIVATE PLAIDML_BACKEND_DLL_EXPORTS
)
set
(
CMAKE_MACOSX_RPATH 1
)
if
(
APPLE
)
set_property
(
TARGET plaidml_backend PROPERTY INSTALL_RPATH
"@loader_path/;@loader_path/../../.."
)
...
...
src/ngraph/runtime/plaidml/plaidml_backend_visibility.hpp
0 → 100644
View file @
a489a2ba
//*****************************************************************************
// Copyright 2017-2019 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.
//*****************************************************************************
// https://gcc.gnu.org/wiki/Visibility
// Generic helper definitions for shared library support
#if defined _WIN32 || defined __CYGWIN__
#define PLAIDML_BACKEND_HELPER_DLL_IMPORT __declspec(dllimport)
#define PLAIDML_BACKEND_HELPER_DLL_EXPORT __declspec(dllexport)
#define PLAIDML_BACKEND_HELPER_DLL_LOCAL
#else
#if __GNUC__ >= 4
#define PLAIDML_BACKEND_HELPER_DLL_IMPORT __attribute__((visibility("default")))
#define PLAIDML_BACKEND_HELPER_DLL_EXPORT __attribute__((visibility("default")))
#define PLAIDML_BACKEND_HELPER_DLL_LOCAL __attribute__((visibility("hidden")))
#else
#define PLAIDML_BACKEND_HELPER_DLL_IMPORT
#define PLAIDML_BACKEND_HELPER_DLL_EXPORT
#define PLAIDML_BACKEND_HELPER_DLL_LOCAL
#endif
#endif
// Now we use the generic helper definitions above to define PLAIDML_BACKEND_API and PLAIDML_BACKEND_LOCAL.
// PLAIDML_BACKEND_API is used for the public API symbols. It either DLL imports or DLL exports
// (or does nothing for static build)
// PLAIDML_BACKEND_LOCAL is used for non-api symbols.
// #ifdef PLAIDML_BACKEND_DLL // defined if PLAIDML_BACKEND is compiled as a DLL
#ifdef PLAIDML_BACKEND_DLL_EXPORTS // defined if we are building the PLAIDML_BACKEND DLL (instead of using it)
#define PLAIDML_BACKEND_API PLAIDML_BACKEND_HELPER_DLL_EXPORT
#else
#define PLAIDML_BACKEND_API PLAIDML_BACKEND_HELPER_DLL_IMPORT
#endif // PLAIDML_BACKEND_DLL_EXPORTS
#define PLAIDML_BACKEND_LOCAL PLAIDML_BACKEND_HELPER_DLL_LOCAL
// #else // PLAIDML_BACKEND_DLL is not defined: this means PLAIDML_BACKEND is a static lib.
// #define PLAIDML_BACKEND_API
// #define PLAIDML_BACKEND_LOCAL
// #endif // PLAIDML_BACKEND_DLL
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