Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
b56c8be0
Commit
b56c8be0
authored
Sep 30, 2018
by
Paul
Browse files
Merge branch 'gcc7'
parents
e36567a3
8dc27e17
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
13 deletions
+41
-13
Dockerfile
Dockerfile
+7
-3
Jenkinsfile
Jenkinsfile
+19
-8
cmake/EnableCompilerWarnings.cmake
cmake/EnableCompilerWarnings.cmake
+13
-0
src/include/migraph/literal.hpp
src/include/migraph/literal.hpp
+1
-1
test/cpu_ops_test.cpp
test/cpu_ops_test.cpp
+1
-1
No files found.
Dockerfile
View file @
b56c8be0
...
...
@@ -6,9 +6,12 @@ ARG PREFIX=/usr/local
RUN
dpkg
--add-architecture
i386
# Add rocm repository
RUN
apt-get update
&&
DEBIAN_FRONTEND
=
noninteractive apt-get
install
-y
curl apt-utils wget
RUN
apt-get update
&&
DEBIAN_FRONTEND
=
noninteractive apt-get
install
-y
curl apt-utils wget
software-properties-common
RUN
curl https://raw.githubusercontent.com/RadeonOpenCompute/ROCm-docker/master/add-rocm.sh | bash
# Add ubuntu toolchain
RUN
apt-get update
&&
add-apt-repository ppa:ubuntu-toolchain-r/test
-y
# Install dependencies
RUN
apt-get update
&&
DEBIAN_FRONTEND
=
noninteractive apt-get
install
-y
--allow-unauthenticated
\
apt-utils
\
...
...
@@ -19,6 +22,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-
cmake
\
curl
\
doxygen
\
g++-7
\
gdb
\
git
\
hsa-rocr-dev
\
...
...
@@ -26,14 +30,14 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-
lcov
\
libelf-dev
\
libncurses5-dev
\
libpthread-stubs0-dev
\
libnuma-dev
\
libpthread-stubs0-dev
\
python
\
python-dev
\
python-pip
\
rocminfo
\
rocm-opencl
\
rocm-opencl-dev
\
rocminfo
\
software-properties-common
\
wget
&&
\
apt-get clean
&&
\
...
...
Jenkinsfile
View file @
b56c8be0
...
...
@@ -3,10 +3,11 @@ def rocmtestnode(variant, name, body) {
def
image
=
'migraphlib'
def
cmake_build
=
{
compiler
,
flags
->
def
cmd
=
"""
ulimit -c unlimited
rm -rf build
mkdir build
cd build
CXX=${compiler} CXXFLAGS='-Werror -Wno-fallback' cmake
-DCMAKE_CXX_FLAGS_DEBUG='-g -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=undefined'
${flags} ..
CXX=${compiler} CXXFLAGS='-Werror -Wno-fallback' cmake ${flags} ..
CTEST_PARALLEL_LEVEL=32 make -j32 all doc check
"""
echo
cmd
...
...
@@ -92,16 +93,26 @@ rocmtest tidy: rocmnode('rocmtest') { cmake_build ->
}
},
clang:
rocmnode
(
'rocmtest'
)
{
cmake_build
->
stage
(
'Clang Debug'
)
{
cmake_build
(
'hcc'
,
'-DCMAKE_BUILD_TYPE=debug'
)
// TODO: Enanle integer
def
sanitizers
=
"undefined"
cmake_build
(
"hcc"
,
"-DCMAKE_BUILD_TYPE=debug -DCMAKE_CXX_FLAGS_DEBUG='-g -fno-omit-frame-pointer -fsanitize=${sanitizers} -fno-sanitize-recover=${sanitizers}'"
)
}
stage
(
'Clang Release'
)
{
cmake_build
(
'hcc'
,
'-DCMAKE_BUILD_TYPE=release'
)
}
},
gcc:
rocmnode
(
'rocmtest'
)
{
cmake_build
->
stage
(
'GCC Debug'
)
{
cmake_build
(
'g++-5'
,
'-DCMAKE_BUILD_TYPE=debug'
)
}
stage
(
'GCC Release'
)
{
cmake_build
(
'g++-5'
,
'-DCMAKE_BUILD_TYPE=release'
)
cmake_build
(
"hcc"
,
"-DCMAKE_BUILD_TYPE=release"
)
}
},
gcc5:
rocmnode
(
'rocmtest'
)
{
cmake_build
->
stage
(
'GCC 5 Debug'
)
{
cmake_build
(
"g++-5"
,
"-DCMAKE_BUILD_TYPE=debug"
)
}
stage
(
'GCC 5 Release'
)
{
cmake_build
(
"g++-5"
,
"-DCMAKE_BUILD_TYPE=release"
)
}
},
gcc7:
rocmnode
(
'rocmtest'
)
{
cmake_build
->
stage
(
'GCC 7 Debug'
)
{
def
linker_flags
=
'-fuse-ld=gold'
def
cmake_linker_flags
=
"-DCMAKE_EXE_LINKER_FLAGS='${linker_flags}' -DCMAKE_SHARED_LINKER_FLAGS='${linker_flags}'"
// TODO: Add bounds-strict
def
sanitizers
=
"undefined,address"
cmake_build
(
"g++-7"
,
"-DCMAKE_BUILD_TYPE=debug ${cmake_linker_flags} -DCMAKE_CXX_FLAGS_DEBUG='-g -fno-omit-frame-pointer -fsanitize-address-use-after-scope -fsanitize=${sanitizers} -fno-sanitize-recover=${sanitizers}'"
)
}
}
cmake/EnableCompilerWarnings.cmake
View file @
b56c8be0
...
...
@@ -68,6 +68,19 @@ else()
-Wno-sign-compare
)
# Flags for gcc 7
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
)
if
(
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER
"7.0"
)
list
(
APPEND CMAKE_COMPILER_WARNINGS
-Wduplicated-branches
-Wduplicated-cond
-Wno-noexcept-type
-Wodr
-Wshift-negative-value
-Wshift-overflow=2
)
endif
()
endif
()
if
(
CMAKE_
${
COMPILER
}
_COMPILER_ID MATCHES
"Clang"
)
list
(
APPEND CMAKE_COMPILER_WARNINGS
-Weverything
...
...
src/include/migraph/literal.hpp
View file @
b56c8be0
...
...
@@ -87,8 +87,8 @@ struct literal : raw_data<literal>
m_shape
.
visit_type
([
&
](
auto
as
)
{
auto
output
=
make_view
(
m_shape
,
as
.
from
(
buffer
.
get
()));
shape_for_each
(
output
.
get_shape
(),
[
&
](
const
auto
&
idx
)
{
it
++
;
output
(
idx
.
begin
(),
idx
.
end
())
=
*
it
;
it
++
;
});
});
}
...
...
test/cpu_ops_test.cpp
View file @
b56c8be0
...
...
@@ -898,7 +898,7 @@ void contiguous_test()
result
.
visit
([
&
](
auto
output
)
{
results_vector
.
assign
(
output
.
begin
(),
output
.
end
());
});
std
::
vector
<
size_t
>
new_lens
=
{
1
,
3
,
2
,
2
};
std
::
vector
<
size_t
>
new_strides
=
{
12
,
1
,
6
,
3
};
std
::
vector
<
float
>
gold
=
{
1
,
4
,
7
,
10
,
2
,
5
,
8
,
11
,
3
,
6
,
9
,
0
};
std
::
vector
<
float
>
gold
=
{
0
,
3
,
6
,
9
,
1
,
4
,
7
,
10
,
2
,
5
,
8
,
11
};
EXPECT
(
migraph
::
verify_range
(
results_vector
,
gold
));
}
...
...
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