Skip to content
Open
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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion include/3rdparty/half/half.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ namespace caffe
friend struct detail::unary_specialized<half_fp>;
friend struct detail::binary_specialized<half_fp,half_fp>;
template<typename,typename,std::float_round_style> friend struct detail::half_caster;
friend class std::numeric_limits<half_fp>;
friend struct std::numeric_limits<half_fp>;
#if HALF_ENABLE_CPP11_HASH
friend struct std::hash<half_fp>;
#endif
Expand Down
2 changes: 1 addition & 1 deletion include/caffe/net.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class NetBase {
debug_info_ = value;
}

protected:
public:
explicit NetBase(Device* device_context);

// Invoked at specific points during an iteration
Expand Down
2 changes: 1 addition & 1 deletion include/caffe/util/math_functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/caffe/backend/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ template shared_ptr<Blob<uint64_t> > Device::Buffer(vector<int_tp> 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))) { }
Expand Down
2 changes: 1 addition & 1 deletion src/caffe/backend/device_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
61 changes: 59 additions & 2 deletions src/caffe/backend/device_program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,63 @@ string DeviceProgram::define_vector_type(string name, int_tp from,
return ss.str();
}

template<>
string DeviceProgram::device_type_name<void>() const {
return device_type_name_void();
}
template<>
string DeviceProgram::device_type_name<bool>() const {
return device_type_name_bool();
}
template<>
string DeviceProgram::device_type_name<char>() const {
return device_type_name_char();
}
template<>
string DeviceProgram::device_type_name<half_fp>() const {
return device_type_name_half();
}
template<>
string DeviceProgram::device_type_name<float>() const {
return device_type_name_float();
}
template<>
string DeviceProgram::device_type_name<double>() const {
return device_type_name_double();
}
template<>
string DeviceProgram::device_type_name<int8_t>() const {
return device_type_name_int8();
}
template<>
string DeviceProgram::device_type_name<int16_t>() const {
return device_type_name_int16();
}
template<>
string DeviceProgram::device_type_name<int32_t>() const {
return device_type_name_int32();
}
template<>
string DeviceProgram::device_type_name<int64_t>() const {
return device_type_name_int64();
}
template<>
string DeviceProgram::device_type_name<uint8_t>() const {
return device_type_name_uint8();
}
template<>
string DeviceProgram::device_type_name<uint16_t>() const {
return device_type_name_uint16();
}
template<>
string DeviceProgram::device_type_name<uint32_t>() const {
return device_type_name_uint32();
}
template<>
string DeviceProgram::device_type_name<uint64_t>() const {
return device_type_name_uint64();
}

template string DeviceProgram::define_vector_type<bool>(string name,
int_tp from, int_tp to);
template string DeviceProgram::define_vector_type<char>(string name,
Expand Down Expand Up @@ -402,7 +459,7 @@ int64_t DeviceProgram::identifier() {
return identifier_;
}

template<>
/*template<>
string DeviceProgram::device_type_name<void>() const {
return device_type_name_void();
}
Expand Down Expand Up @@ -458,7 +515,7 @@ template<>
string DeviceProgram::device_type_name<uint64_t>() const {
return device_type_name_uint64();
}

*/

template<>
string DeviceProgram::convert_type<char>(int_tp vec_len,
Expand Down