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")
message(FATAL_ERROR "Apple Clang version must be at least ${APPLE_CLANG_MIN_VERSION}!")
endif()
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()
# Prevent Eigen from using any LGPL3 code
......@@ -168,7 +168,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if (DEFINED 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}")
endif()
endif()
endif()
ngraph_var(NGRAPH_WARNINGS_AS_ERRORS DEFAULT "OFF")
......@@ -225,7 +225,7 @@ if(WIN32)
endif()
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()
if (NGRAPH_PLAIDML_ENABLE)
......
......@@ -34,6 +34,11 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-zero-as-null-pointer-constant")
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
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-old-style-cast")
......
......@@ -22,7 +22,7 @@ include(ExternalProject)
#------------------------------------------------------------------------------
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.
if (${CMAKE_VERSION} VERSION_LESS 3.2)
......
......@@ -158,7 +158,7 @@ void ngraph::pass::Manager::run_passes(shared_ptr<Function> func, bool transitiv
string name = typeid(*p).name();
#ifndef WIN32
int status;
name = abi::__cxa_demangle(name.c_str(), 0, 0, &status);
name = abi::__cxa_demangle(name.c_str(), nullptr, nullptr, &status);
#endif
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
// extract the compiled function
CUmodule module;
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()));
return std::make_shared<CUfunction>(function);
}
......@@ -152,7 +152,7 @@ namespace ngraph
static false_type check(...);
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;
};
......
......@@ -38,7 +38,7 @@ class ngraph::runtime::gpu::GPUTensor : public ngraph::runtime::Tensor
public:
GPUTensor(const ngraph::element::Type& element_type, const Shape& shape);
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
/// \param p Pointer to source of data
......
......@@ -27,7 +27,7 @@ namespace ngraph
{
void print_gpu_f32_tensor(const void* p, size_t element_count, size_t element_size);
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 cuda_memcpyDtD(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 @@
# 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
algebraic_simplification.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