Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUILD] Add clang to build matrix, -Werror #1273

Merged
merged 2 commits into from
Jun 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ if(MSVC)
else(MSVC)
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-std=c++11" SUPPORT_CXX11)
set(CMAKE_C_FLAGS "-O3 -Wall -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11")
set(CMAKE_C_FLAGS "-O2 -Wall -fPIC ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-O2 -Wall -fPIC -std=c++11 ${CMAKE_CXX_FLAGS}")
endif(MSVC)

# add source group
Expand Down
10 changes: 9 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ stage('Build') {
echo set\\(USE_SORT ON\\) >> config.cmake
echo set\\(USE_GRAPH_RUNTIME ON\\) >> config.cmake
echo set\\(USE_BLAS openblas\\) >> config.cmake
echo set\\(CMAKE_CXX_COMPILER g++\\) >> config.cmake
echo set\\(CMAKE_CXX_FLAGS -Werror\\) >> config.cmake
"""
make('gpu', 'build', '-j2')
pack_lib('gpu', tvm_multilib)
Expand All @@ -106,7 +108,9 @@ stage('Build') {
cp ../cmake/config.cmake .
echo set\\(USE_OPENCL ON\\) >> config.cmake
echo set\\(USE_ROCM ON\\) >> config.cmake
echo set\\(USE_VULKAN OFF\\) >> config.cmake
echo set\\(USE_VULKAN ON\\) >> config.cmake
echo set\\(CMAKE_CXX_COMPILER clang-6.0\\) >> config.cmake
echo set\\(CMAKE_CXX_FLAGS -Werror\\) >> config.cmake
"""
make('gpu', 'build2', '-j2')
}
Expand All @@ -122,6 +126,8 @@ stage('Build') {
cp ../cmake/config.cmake .
echo set\\(USE_SORT ON\\) >> config.cmake
echo set\\(USE_LLVM llvm-config-4.0\\) >> config.cmake
echo set\\(CMAKE_CXX_COMPILER g++\\) >> config.cmake
echo set\\(CMAKE_CXX_FLAGS -Werror\\) >> config.cmake
"""
make('cpu', 'build', '-j2')
pack_lib('cpu', tvm_lib)
Expand All @@ -142,6 +148,8 @@ stage('Build') {
echo set\\(USE_SORT ON\\) >> config.cmake
echo set\\(USE_RPC ON\\) >> config.cmake
echo set\\(USE_LLVM llvm-config-5.0\\) >> config.cmake
echo set\\(CMAKE_CXX_COMPILER g++\\) >> config.cmake
echo set\\(CMAKE_CXX_FLAGS -Werror\\) >> config.cmake
"""
make('i386', 'build', '-j2')
pack_lib('i386', tvm_multilib)
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<img src=https://raw.githubusercontent.com/tqchen/tvm.ai/master/images/logo/tvm-logo-small.png width=128/> Open Deep Learning Compiler Stack
==============================================

[![GitHub license](http://dmlc.github.io/img/apache2.svg)](./LICENSE)
[![GitHub license](https://dmlc.github.io/img/apache2.svg)](./LICENSE)
[![Build Status](http://mode-gpu.cs.washington.edu:8080/buildStatus/icon?job=dmlc/tvm/master)](http://mode-gpu.cs.washington.edu:8080/job/dmlc/job/tvm/job/master/)

[Documentation](http://docs.tvm.ai) |
[Documentation](https://docs.tvm.ai) |
[Contributors](CONTRIBUTORS.md) |
[Community](http://tvm.ai/community.html) |
[Community](https://tvm.ai/community.html) |
[Release Notes](NEWS.md)

TVM is a compiler stack for deep learning systems. It is designed to close the gap between the
productivity-focused deep learning frameworks, and the performance- and efficiency-focused hardware backends.
TVM works with deep learning frameworks to provide end to end compilation to different backends.
Checkout the [tvm stack homepage](http://tvm.ai/) for more information.
Checkout the [tvm stack homepage](https://tvm.ai/) for more information.

License
-------
Expand All @@ -21,7 +21,7 @@ License
Contribute to TVM
-----------------
TVM adopts apache committer model, we aim to create an open source project that is maintained and owned by the community.
Checkout the [Contributor Guide](http://docs.tvm.ai/contribute/)
Checkout the [Contributor Guide](https://docs.tvm.ai/contribute/)

Acknowledgement
---------------
Expand Down
2 changes: 1 addition & 1 deletion nnvm/src/core/symbolic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ std::vector<NodePtr> Symbol::ListInputs(ListInputOption option) const {
std::vector<NodePtr> vlist;
vlist.reserve(this->outputs.size());
static auto& fmutate_inputs = Op::GetAttr<FMutateInputs>("FMutateInputs");
DFSVisit(this->outputs, [&ret, &mutable_set, &vlist](const NodePtr &node) {
DFSVisit(this->outputs, [&mutable_set, &vlist](const NodePtr &node) {
if (node->is_variable()) {
vlist.push_back(node);
} else if (fmutate_inputs.count(node->op())) {
Expand Down
10 changes: 6 additions & 4 deletions src/contrib/sort/sort.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,14 @@ TVM_REGISTER_GLOBAL("tvm.contrib.sort.argsort")
int64_t full_idx = base_idx + k * axis_mul_after;
sorter.emplace_back(std::make_pair(k, *(data_ptr + full_idx)));
}
std::stable_sort(sorter.begin(), sorter.end(),
is_descend ? CompareDescend<float>
: CompareAscend<float>);
if (is_descend) {
std::stable_sort(sorter.begin(), sorter.end(), CompareDescend<float>);
} else {
std::stable_sort(sorter.begin(), sorter.end(), CompareAscend<float>);
}
for (int32_t k = 0; k < input->shape[axis]; ++k) {
*(static_cast<int32_t *>(output->data) + base_idx + k * axis_mul_after)
= k < sorter.size() ? sorter[k].first : k;
= k < static_cast<int32_t>(sorter.size()) ? sorter[k].first : k;
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/runtime/opengl/opengl_device_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,11 @@ static TextureFormat GetTextureFormat(TVMType type) {
LOG(FATAL) << "Unsupported type bits " << type.bits;
}
}
default:
default: {
LOG(FATAL) << "Unsupported type code" << type.code;
}
}
assert(false);
return {GL_R32F, GL_RED, GL_FLOAT};
}

Texture OpenGLWorkspace::CreateTexture(TVMType type, size_t nbytes) {
Expand Down
6 changes: 4 additions & 2 deletions src/runtime/opengl/opengl_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ inline std::string OpenGLArgKind2String(OpenGLArgKind kind) {
return "input_texture";
case OpenGLArgKind::kUniform:
return "uniform";
default:
LOG(FATAL) << "invalid arg kind";
return "";
}
assert(false);
}

inline OpenGLArgKind String2OpenGLArgKind(const std::string& str) {
Expand All @@ -101,7 +103,7 @@ inline OpenGLArgKind String2OpenGLArgKind(const std::string& str) {
return OpenGLArgKind::kUniform;
} else {
LOG(FATAL) << "Invalid OpenGL arg kind.";
assert(false);
return OpenGLArgKind::kUniform;
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/ci_build/Dockerfile.gpu
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ RUN bash /install/ubuntu_install_onnx.sh
RUN pip3 install Pillow

# disable vulkan for now
# COPY install/ubuntu_install_vulkan.sh /install/ubuntu_install_vulkan.sh
# RUN bash /install/ubuntu_install_vulkan.sh
COPY install/ubuntu_install_vulkan.sh /install/ubuntu_install_vulkan.sh
RUN bash /install/ubuntu_install_vulkan.sh

# Environment variables
ENV PATH=/usr/local/nvidia/bin:${PATH}
Expand Down
2 changes: 1 addition & 1 deletion tests/ci_build/install/ubuntu_install_llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ echo deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial main\
>> /etc/apt/sources.list.d/llvm.list

wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
apt-get update && apt-get install -y --force-yes llvm-4.0 llvm-5.0 llvm-6.0
apt-get update && apt-get install -y --force-yes llvm-4.0 llvm-5.0 llvm-6.0 clang-6.0
4 changes: 2 additions & 2 deletions topi/include/topi/reduction.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ inline FCommReduce MakeCommReducer(FCombine fcombine,
for (size_t i = 0; i < exprs.size(); ++i) {
auto dtype = exprs[i].type();
dtypes.push_back(dtype);
lhs.push_back(var("lhs_" + std::to_string(i), dtype));
rhs.push_back(var("rhs_" + std::to_string(i), dtype));
lhs.push_back(var(name + "_lhs_" + std::to_string(i), dtype));
rhs.push_back(var(name + "_rhs_" + std::to_string(i), dtype));
}

auto result = fcombine(lhs, rhs);
Expand Down