Commit 79802dcf authored by Robert Kimball's avatar Robert Kimball Committed by Scott Cyphers

address issues which surface with clang 6.0 (#1980)

* address issues which surface with clang 6.0

* revert changes due to new clang warning and disable new warning
parent 8bd3846f
...@@ -64,7 +64,7 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") ...@@ -64,7 +64,7 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
message(FATAL_ERROR "Apple Clang version must be at least ${APPLE_CLANG_MIN_VERSION}!") message(FATAL_ERROR "Apple Clang version must be at least ${APPLE_CLANG_MIN_VERSION}!")
endif() endif()
else() else()
message(WARNING "You are using an unsupported compiler. Compilation has only been tested with Clang (${CLANG_MIN_VERSION} and up), Apple Clang (${APPLE_CLANG_MIN_VERSION} and up), and GCC (${GCC_MIN_VERSION} and up).") message(WARNING "You are using an unsupported compiler.")
endif() endif()
# Prevent Eigen from using any LGPL3 code # Prevent Eigen from using any LGPL3 code
...@@ -168,7 +168,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") ...@@ -168,7 +168,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if (DEFINED NGRAPH_USE_CXX_ABI) if (DEFINED NGRAPH_USE_CXX_ABI)
message( STATUS "nGraph using CXX11 ABI: " ${NGRAPH_USE_CXX_ABI} ) message( STATUS "nGraph using CXX11 ABI: " ${NGRAPH_USE_CXX_ABI} )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=${NGRAPH_USE_CXX_ABI}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=${NGRAPH_USE_CXX_ABI}")
endif() endif()
endif() endif()
ngraph_var(NGRAPH_WARNINGS_AS_ERRORS DEFAULT "OFF") ngraph_var(NGRAPH_WARNINGS_AS_ERRORS DEFAULT "OFF")
...@@ -225,7 +225,7 @@ if(WIN32) ...@@ -225,7 +225,7 @@ if(WIN32)
endif() endif()
if (NGRAPH_CPU_ENABLE) if (NGRAPH_CPU_ENABLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNGRAPH_CPU_ENABLE") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNGRAPH_CPU_ENABLE")
endif() endif()
if (NGRAPH_PLAIDML_ENABLE) if (NGRAPH_PLAIDML_ENABLE)
......
...@@ -34,6 +34,11 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") ...@@ -34,6 +34,11 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-zero-as-null-pointer-constant") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-zero-as-null-pointer-constant")
endif() endif()
endif() endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.0.0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-lambda-capture")
endif()
endif()
# # should remove these # # should remove these
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-old-style-cast") # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-old-style-cast")
......
...@@ -22,7 +22,7 @@ include(ExternalProject) ...@@ -22,7 +22,7 @@ include(ExternalProject)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
SET(GTEST_GIT_REPO_URL https://github.com/google/googletest.git) SET(GTEST_GIT_REPO_URL https://github.com/google/googletest.git)
SET(GTEST_GIT_LABEL release-1.8.0) SET(GTEST_GIT_LABEL release-1.8.1)
# The 'BUILD_BYPRODUCTS' argument was introduced in CMake 3.2. # The 'BUILD_BYPRODUCTS' argument was introduced in CMake 3.2.
if (${CMAKE_VERSION} VERSION_LESS 3.2) if (${CMAKE_VERSION} VERSION_LESS 3.2)
......
...@@ -158,7 +158,7 @@ void ngraph::pass::Manager::run_passes(shared_ptr<Function> func, bool transitiv ...@@ -158,7 +158,7 @@ void ngraph::pass::Manager::run_passes(shared_ptr<Function> func, bool transitiv
string name = typeid(*p).name(); string name = typeid(*p).name();
#ifndef WIN32 #ifndef WIN32
int status; int status;
name = abi::__cxa_demangle(name.c_str(), 0, 0, &status); name = abi::__cxa_demangle(name.c_str(), nullptr, nullptr, &status);
#endif #endif
cout << setw(7) << pass_timer.get_milliseconds() << "ms " << name << "\n"; cout << setw(7) << pass_timer.get_milliseconds() << "ms " << name << "\n";
} }
......
This diff is collapsed.
...@@ -77,7 +77,7 @@ std::shared_ptr<CUfunction> runtime::gpu::CudaFunctionBuilder::get(const std::st ...@@ -77,7 +77,7 @@ std::shared_ptr<CUfunction> runtime::gpu::CudaFunctionBuilder::get(const std::st
// extract the compiled function // extract the compiled function
CUmodule module; CUmodule module;
CUfunction function; CUfunction function;
CUDA_SAFE_CALL(cuModuleLoadDataEx(&module, ptx, 0, 0, 0)); CUDA_SAFE_CALL(cuModuleLoadDataEx(&module, ptx, 0, nullptr, nullptr));
CUDA_SAFE_CALL(cuModuleGetFunction(&function, module, name.c_str())); CUDA_SAFE_CALL(cuModuleGetFunction(&function, module, name.c_str()));
return std::make_shared<CUfunction>(function); return std::make_shared<CUfunction>(function);
} }
...@@ -152,7 +152,7 @@ namespace ngraph ...@@ -152,7 +152,7 @@ namespace ngraph
static false_type check(...); static false_type check(...);
public: public:
static const bool value = sizeof(check<T>(0)) == sizeof(true_type); static const bool value = sizeof(check<T>(nullptr)) == sizeof(true_type);
typedef T type; typedef T type;
}; };
......
...@@ -38,7 +38,7 @@ class ngraph::runtime::gpu::GPUTensor : public ngraph::runtime::Tensor ...@@ -38,7 +38,7 @@ class ngraph::runtime::gpu::GPUTensor : public ngraph::runtime::Tensor
public: public:
GPUTensor(const ngraph::element::Type& element_type, const Shape& shape); GPUTensor(const ngraph::element::Type& element_type, const Shape& shape);
GPUTensor(const ngraph::element::Type& element_type, const Shape& shape, void* memory_pointer); GPUTensor(const ngraph::element::Type& element_type, const Shape& shape, void* memory_pointer);
virtual ~GPUTensor(); virtual ~GPUTensor() override;
/// \brief Write bytes directly into the tensor /// \brief Write bytes directly into the tensor
/// \param p Pointer to source of data /// \param p Pointer to source of data
......
...@@ -27,7 +27,7 @@ namespace ngraph ...@@ -27,7 +27,7 @@ namespace ngraph
{ {
void print_gpu_f32_tensor(const void* p, size_t element_count, size_t element_size); void print_gpu_f32_tensor(const void* p, size_t element_count, size_t element_size);
void check_cuda_errors(CUresult err); void check_cuda_errors(CUresult err);
void* create_gpu_buffer(size_t buffer_size, const void* data = NULL); void* create_gpu_buffer(size_t buffer_size, const void* data = nullptr);
void free_gpu_buffer(void* buffer); void free_gpu_buffer(void* buffer);
void cuda_memcpyDtD(void* dst, const void* src, size_t buffer_size); void cuda_memcpyDtD(void* dst, const void* src, size_t buffer_size);
void cuda_memcpyHtD(void* dst, const void* src, size_t buffer_size); void cuda_memcpyHtD(void* dst, const void* src, size_t buffer_size);
......
...@@ -14,6 +14,14 @@ ...@@ -14,6 +14,14 @@
# limitations under the License. # limitations under the License.
# ****************************************************************************** # ******************************************************************************
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.0.0")
# gtest has issues with this with v1.8.x
# gtest issue is supposed to be addressed after v1.8.x
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-zero-as-null-pointer-constant")
endif()
endif()
set(SRC set(SRC
algebraic_simplification.cpp algebraic_simplification.cpp
all_close_f.cpp all_close_f.cpp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment