diff --git a/CMakeLists.txt b/CMakeLists.txt index e812215e9c3..148809ed845 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,7 @@ if(NOT COMMAND find_host_program) endmacro() endif() +ADD_DEFINITIONS(-Wno-delete-non-virtual-dtor -Wno-switch -Wno-deprecated-declarations -Wno-reorder -Wno-return-type -Wno-extra-tokens -Wno-overloaded-virtual -Wno-literal-conversion -Wno-unused-variable -Wno-unused-local-typedef -Wno-instantiation-after-specialization) # ---[ Using cmake scripts and modules list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules) diff --git a/include/3rdparty/half/half.hpp b/include/3rdparty/half/half.hpp index 8cad5b67584..73ff87eba56 100644 --- a/include/3rdparty/half/half.hpp +++ b/include/3rdparty/half/half.hpp @@ -1077,7 +1077,7 @@ namespace caffe friend struct detail::unary_specialized; friend struct detail::binary_specialized; template friend struct detail::half_caster; - friend class std::numeric_limits; + friend struct std::numeric_limits; #if HALF_ENABLE_CPP11_HASH friend struct std::hash; #endif diff --git a/include/caffe/net.hpp b/include/caffe/net.hpp index a02a056f8dd..a0c2758ec0f 100755 --- a/include/caffe/net.hpp +++ b/include/caffe/net.hpp @@ -172,7 +172,7 @@ class NetBase { debug_info_ = value; } - protected: + public: explicit NetBase(Device* device_context); // Invoked at specific points during an iteration diff --git a/include/caffe/util/math_functions.hpp b/include/caffe/util/math_functions.hpp index 21e14f6ed00..9296214e184 100644 --- a/include/caffe/util/math_functions.hpp +++ b/include/caffe/util/math_functions.hpp @@ -13,7 +13,7 @@ namespace caffe { // Forward declare -class QuantizerValues; +struct QuantizerValues; // Caffe gemm provides a simpler interface to the gemm functions, with the // limitation that the data has to be contiguous in memory. diff --git a/src/caffe/backend/device.cpp b/src/caffe/backend/device.cpp index 0d99397f672..c60bc1aba9a 100755 --- a/src/caffe/backend/device.cpp +++ b/src/caffe/backend/device.cpp @@ -277,7 +277,7 @@ template shared_ptr > Device::Buffer(vector shape, void Device::unlock_buffer(int_tp* lock_id) { buffer_vec_mutex_.lock(); - if (*lock_id < buffer_flags_.size() && lock_id > 0) { + if (*lock_id < buffer_flags_.size() && *lock_id > 0) { bool expected = true; while (!(buffer_flags_[*lock_id]-> compare_exchange_weak(expected, false))) { } diff --git a/src/caffe/backend/device_kernel.cpp b/src/caffe/backend/device_kernel.cpp index 8b0757f0409..97cdeb994c0 100755 --- a/src/caffe/backend/device_kernel.cpp +++ b/src/caffe/backend/device_kernel.cpp @@ -3,7 +3,7 @@ namespace caffe { DeviceKernel::DeviceKernel(Device* dev, string name, KernelArgs args) - : name_(name), device_(dev), arg_idx_(0), args_(args) { + : device_(dev), name_(name), arg_idx_(0), args_(args) { } void DeviceKernel::add_arg(const bool *arg) { diff --git a/src/caffe/backend/device_program.cpp b/src/caffe/backend/device_program.cpp index 6fefa2c178b..8af967740ea 100755 --- a/src/caffe/backend/device_program.cpp +++ b/src/caffe/backend/device_program.cpp @@ -242,6 +242,63 @@ string DeviceProgram::define_vector_type(string name, int_tp from, return ss.str(); } +template<> +string DeviceProgram::device_type_name() const { + return device_type_name_void(); +} +template<> +string DeviceProgram::device_type_name() const { + return device_type_name_bool(); +} +template<> +string DeviceProgram::device_type_name() const { + return device_type_name_char(); +} +template<> +string DeviceProgram::device_type_name() const { + return device_type_name_half(); +} +template<> +string DeviceProgram::device_type_name() const { + return device_type_name_float(); +} +template<> +string DeviceProgram::device_type_name() const { + return device_type_name_double(); +} +template<> +string DeviceProgram::device_type_name() const { + return device_type_name_int8(); +} +template<> +string DeviceProgram::device_type_name() const { + return device_type_name_int16(); +} +template<> +string DeviceProgram::device_type_name() const { + return device_type_name_int32(); +} +template<> +string DeviceProgram::device_type_name() const { + return device_type_name_int64(); +} +template<> +string DeviceProgram::device_type_name() const { + return device_type_name_uint8(); +} +template<> +string DeviceProgram::device_type_name() const { + return device_type_name_uint16(); +} +template<> +string DeviceProgram::device_type_name() const { + return device_type_name_uint32(); +} +template<> +string DeviceProgram::device_type_name() const { + return device_type_name_uint64(); +} + template string DeviceProgram::define_vector_type(string name, int_tp from, int_tp to); template string DeviceProgram::define_vector_type(string name, @@ -402,7 +459,7 @@ int64_t DeviceProgram::identifier() { return identifier_; } -template<> +/*template<> string DeviceProgram::device_type_name() const { return device_type_name_void(); } @@ -458,7 +515,7 @@ template<> string DeviceProgram::device_type_name() const { return device_type_name_uint64(); } - +*/ template<> string DeviceProgram::convert_type(int_tp vec_len,