mirror of
https://github.com/marian-nmt/marian.git
synced 2024-09-11 06:15:56 +03:00
reenabled -Wunused-variable and dealt with fallout
This commit is contained in:
parent
fca0510133
commit
015f392e82
@ -41,7 +41,7 @@ else()
|
||||
set(CMAKE_CXX_FLAGS_RELEASE " -std=c++11 -O3 -Ofast -m64 -pthread -march=${BUILD_ARCH} -msse4.1 -Wl,--no-as-needed -funroll-loops -ffinite-math-only -fPIC -Wno-unused-result -Wno-deprecated -Werror -Wno-pragmas")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG " -std=c++11 -g -rdynamic -O0 -pthread -fPIC -Wno-unused-result -Wno-deprecated -Wno-deprecated-gpu-targets -Wsuggest-override -Werror")
|
||||
set(CMAKE_CXX_FLAGS_ST "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} -pg -g -rdynamic -Wall -Wextra -Wsuggest-override -Wno-unused-value -Wno-unknown-pragmas -Wno-sign-compare -Wno-missing-field-initializers -Wno-unused-variable")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} -pg -g -rdynamic -Wall -Wextra -Wsuggest-override -Wno-unused-value -Wno-unknown-pragmas -Wno-sign-compare -Wno-missing-field-initializers")
|
||||
set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE} -pg -g -rdynamic")
|
||||
set(CMAKE_CXX_FLAGS_PROFGEN "${CMAKE_CXX_FLAGS_RELEASE} -fprofile-generate -fprofile-correction")
|
||||
set(CMAKE_CXX_FLAGS_PROFUSE "${CMAKE_CXX_FLAGS_RELEASE} -fprofile-use -fprofile-correction")
|
||||
|
5
src/3rd_party/ExceptionWithCallStack.cpp
vendored
5
src/3rd_party/ExceptionWithCallStack.cpp
vendored
@ -142,12 +142,11 @@ static string MakeFunctionNameStandOut(string origName)
|
||||
/// </summary>
|
||||
static void CollectCallStack(size_t skipLevels, bool makeFunctionNamesStandOut, const function<void(string)>& write)
|
||||
{
|
||||
static const int MAX_CALLERS = 62;
|
||||
static const unsigned short MAX_CALL_STACK_DEPTH = 20;
|
||||
|
||||
write("\n[CALL STACK]\n");
|
||||
|
||||
#ifdef _WIN32
|
||||
static const int MAX_CALLERS = 62;
|
||||
static const unsigned short MAX_CALL_STACK_DEPTH = 20;
|
||||
|
||||
// RtlCaptureStackBackTrace() is a kernel API without default binding, we must manually determine its function pointer.
|
||||
typedef USHORT(WINAPI * CaptureStackBackTraceType)(__in ULONG, __in ULONG, __out PVOID*, __out_opt PULONG);
|
||||
|
@ -19,7 +19,6 @@
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wsuggest-override"
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
#endif
|
||||
#include <boost/iostreams/filtering_stream.hpp>
|
||||
#ifdef __GNUC__
|
||||
|
@ -12,6 +12,9 @@
|
||||
#endif
|
||||
#include <boost/filesystem.hpp>
|
||||
#ifdef __GNUC__
|
||||
// "ignored -Wunused-variable" above ignores 'static const' declarations (where 'static'
|
||||
// is not needed). We work around by referencing the offending variables in dummy code.
|
||||
static inline void boost_dummy_filesystem() { boost::system::posix_category; boost::system::errno_ecat; boost::system::native_ecat; }
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <boost/timer/timer.hpp>
|
||||
#include <boost/chrono.hpp> // (needed on Windows only to resolve a link error)
|
||||
#ifdef _MSC_VER
|
||||
#include <boost/chrono.hpp> // (needed on Windows only to resolve a link error, but causes a warning on Linux)
|
||||
#endif
|
||||
|
||||
namespace marian {
|
||||
namespace timer {
|
||||
|
10
src/functional/functional.h
Normal file → Executable file
10
src/functional/functional.h
Normal file → Executable file
@ -19,10 +19,10 @@ static ref<7> _7;
|
||||
static ref<8> _8;
|
||||
static ref<9> _9;
|
||||
|
||||
static C<0> _0c;
|
||||
static C<1> _1c;
|
||||
static C<2> _2c;
|
||||
static C<-1> _1cneg;
|
||||
static C<-2> _2cneg;
|
||||
const C<0> _0c;
|
||||
const C<1> _1c;
|
||||
const C<2> _2c;
|
||||
const C<-1> _1cneg;
|
||||
const C<-2> _2cneg;
|
||||
} // namespace functional
|
||||
} // namespace marian
|
@ -2,8 +2,8 @@
|
||||
#include "common/logging.h"
|
||||
#include "cuda_runtime.h"
|
||||
|
||||
// fixes a missing constant in CUDA device code (specific to MSVC compiler)
|
||||
static __constant__ float CUDA_FLT_MAX = 1.70141e+38;
|
||||
// fixes a missing constant in CUDA device code
|
||||
#define CUDA_FLT_MAX 1.70141e+38; // note: 'static __constant__' causes a warning on gcc; non-static fails CUDA, so #define instead
|
||||
const int MAX_THREADS = 512;
|
||||
const int MAX_BLOCKS = 65535;
|
||||
|
||||
|
@ -444,6 +444,14 @@
|
||||
<ClInclude Include="..\src\tensors\cpu\sharp\int_gemm.h" />
|
||||
<ClInclude Include="..\src\tensors\device.h" />
|
||||
<ClInclude Include="..\src\tensors\dispatch.h" />
|
||||
<ClInclude Include="..\src\tensors\gpu\add.h" />
|
||||
<ClInclude Include="..\src\tensors\gpu\algorithm.h" />
|
||||
<ClInclude Include="..\src\tensors\gpu\backend.h" />
|
||||
<ClInclude Include="..\src\tensors\gpu\cuda_helpers.h" />
|
||||
<ClInclude Include="..\src\tensors\gpu\cudnn_wrappers.h" />
|
||||
<ClInclude Include="..\src\tensors\gpu\element.h" />
|
||||
<ClInclude Include="..\src\tensors\gpu\prod.h" />
|
||||
<ClInclude Include="..\src\tensors\gpu\sparse.h" />
|
||||
<ClInclude Include="..\src\tensors\memory_piece.h" />
|
||||
<ClInclude Include="..\src\tensors\rand.h" />
|
||||
<ClInclude Include="..\src\tensors\tensor.h" />
|
||||
@ -481,6 +489,32 @@
|
||||
<ClInclude Include="..\src\translator\translator.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\src\tensors\gpu\add.cu">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
</None>
|
||||
<None Include="..\src\tensors\gpu\add.inc" />
|
||||
<None Include="..\src\tensors\gpu\algorithm.cu">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
</None>
|
||||
<None Include="..\src\tensors\gpu\cudnn_wrappers.cu">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
</None>
|
||||
<None Include="..\src\tensors\gpu\device.cu">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
</None>
|
||||
<None Include="..\src\tensors\gpu\element.cu">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
</None>
|
||||
<None Include="..\src\tensors\gpu\element.inc" />
|
||||
<None Include="..\src\tensors\gpu\prod.cu">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
</None>
|
||||
<None Include="..\src\tensors\gpu\sparse.cu">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
</None>
|
||||
<None Include="..\src\tensors\gpu\tensor_operators.cu">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
</None>
|
||||
<None Include="..\src\training\communicator_nccl.h" />
|
||||
<None Include=".editorConfig" />
|
||||
</ItemGroup>
|
||||
|
@ -268,15 +268,6 @@
|
||||
<ClCompile Include="..\src\common\version.cpp">
|
||||
<Filter>common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\examples\iris\helper.cpp">
|
||||
<Filter>examples\iris</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\examples\iris\iris.cpp">
|
||||
<Filter>examples\iris</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\examples\mnist\mnist_ffnn.cpp">
|
||||
<Filter>examples\mnist</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\src\marian.h" />
|
||||
@ -1102,20 +1093,29 @@
|
||||
<ClInclude Include="..\src\common\version.h">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\examples\mnist\dataset.h">
|
||||
<Filter>examples\mnist</Filter>
|
||||
<ClInclude Include="..\src\tensors\gpu\add.h">
|
||||
<Filter>tensors\gpu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\examples\mnist\model.h">
|
||||
<Filter>examples\mnist</Filter>
|
||||
<ClInclude Include="..\src\tensors\gpu\algorithm.h">
|
||||
<Filter>tensors\gpu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\examples\mnist\model_lenet.h">
|
||||
<Filter>examples\mnist</Filter>
|
||||
<ClInclude Include="..\src\tensors\gpu\backend.h">
|
||||
<Filter>tensors\gpu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\examples\mnist\training.h">
|
||||
<Filter>examples\mnist</Filter>
|
||||
<ClInclude Include="..\src\tensors\gpu\cuda_helpers.h">
|
||||
<Filter>tensors\gpu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\examples\mnist\validator.h">
|
||||
<Filter>examples\mnist</Filter>
|
||||
<ClInclude Include="..\src\tensors\gpu\cudnn_wrappers.h">
|
||||
<Filter>tensors\gpu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\tensors\gpu\element.h">
|
||||
<Filter>tensors\gpu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\tensors\gpu\prod.h">
|
||||
<Filter>tensors\gpu</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\tensors\gpu\sparse.h">
|
||||
<Filter>tensors\gpu</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -1245,31 +1245,44 @@
|
||||
<Filter Include="examples\mnist">
|
||||
<UniqueIdentifier>{55dd3952-a6fd-41d8-b99c-306b9e6c348d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="tensors\gpu">
|
||||
<UniqueIdentifier>{812ce3ca-6b91-4881-8ef6-692ebe7b0cce}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include=".editorConfig" />
|
||||
<None Include="..\src\training\communicator_nccl.h">
|
||||
<Filter>training</Filter>
|
||||
</None>
|
||||
<None Include="..\src\examples\cmake_install.cmake">
|
||||
<Filter>examples</Filter>
|
||||
<None Include="..\src\tensors\gpu\add.cu">
|
||||
<Filter>tensors\gpu</Filter>
|
||||
</None>
|
||||
<None Include="..\src\examples\Makefile">
|
||||
<Filter>examples</Filter>
|
||||
<None Include="..\src\tensors\gpu\add.inc">
|
||||
<Filter>tensors\gpu</Filter>
|
||||
</None>
|
||||
<None Include="..\src\examples\README.md">
|
||||
<Filter>examples</Filter>
|
||||
<None Include="..\src\tensors\gpu\algorithm.cu">
|
||||
<Filter>tensors\gpu</Filter>
|
||||
</None>
|
||||
<None Include="..\src\examples\iris\iris.data">
|
||||
<Filter>examples\iris</Filter>
|
||||
<None Include="..\src\tensors\gpu\cudnn_wrappers.cu">
|
||||
<Filter>tensors\gpu</Filter>
|
||||
</None>
|
||||
<None Include="..\src\examples\mnist\download.sh">
|
||||
<Filter>examples\mnist</Filter>
|
||||
<None Include="..\src\tensors\gpu\device.cu">
|
||||
<Filter>tensors\gpu</Filter>
|
||||
</None>
|
||||
<None Include="..\src\tensors\gpu\element.cu">
|
||||
<Filter>tensors\gpu</Filter>
|
||||
</None>
|
||||
<None Include="..\src\tensors\gpu\element.inc">
|
||||
<Filter>tensors\gpu</Filter>
|
||||
</None>
|
||||
<None Include="..\src\tensors\gpu\prod.cu">
|
||||
<Filter>tensors\gpu</Filter>
|
||||
</None>
|
||||
<None Include="..\src\tensors\gpu\sparse.cu">
|
||||
<Filter>tensors\gpu</Filter>
|
||||
</None>
|
||||
<None Include="..\src\tensors\gpu\tensor_operators.cu">
|
||||
<Filter>tensors\gpu</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="..\src\examples\CMakeLists.txt">
|
||||
<Filter>examples</Filter>
|
||||
</Text>
|
||||
</ItemGroup>
|
||||
</Project>
|
Loading…
Reference in New Issue
Block a user