Fixed compilation with clang-10 + xcode (#521)
This commit is contained in:
parent
4943a954c7
commit
bb039adef8
@ -9,8 +9,13 @@ cmake_policy(SET CMP0054 NEW)
|
||||
# See https://blog.kitware.com/cmake-3-13-0-available-for-download/
|
||||
|
||||
if (APPLE)
|
||||
# due to https://cmake.org/cmake/help/v3.12/policy/CMP0068.html
|
||||
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
|
||||
if(CMAKE_GENERATOR STREQUAL "Xcode")
|
||||
# due to https://gitlab.kitware.com/cmake/cmake/issues/14254
|
||||
cmake_minimum_required(VERSION 3.12.0 FATAL_ERROR)
|
||||
else()
|
||||
# due to https://cmake.org/cmake/help/v3.12/policy/CMP0068.html
|
||||
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
|
||||
endif()
|
||||
else()
|
||||
cmake_minimum_required(VERSION 3.7.2 FATAL_ERROR)
|
||||
endif()
|
||||
|
@ -172,8 +172,8 @@ endif()
|
||||
set(CMAKE_DEBUG_POSTFIX ${IE_DEBUG_POSTFIX})
|
||||
set(CMAKE_RELEASE_POSTFIX ${IE_RELEASE_POSTFIX})
|
||||
|
||||
if (WIN32)
|
||||
# Support CMake multiconfiguration for Visual Studio build
|
||||
if (WIN32 OR CMAKE_GENERATOR STREQUAL "Xcode")
|
||||
# Support CMake multiconfiguration for Visual Studio or Xcode build
|
||||
set(IE_BUILD_POSTFIX $<$<CONFIG:Debug>:${IE_DEBUG_POSTFIX}>$<$<CONFIG:Release>:${IE_RELEASE_POSTFIX}>)
|
||||
else ()
|
||||
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug" )
|
||||
@ -187,10 +187,6 @@ message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
|
||||
add_definitions(-DIE_BUILD_POSTFIX=\"${IE_BUILD_POSTFIX}\")
|
||||
|
||||
if(NOT UNIX)
|
||||
if (WIN32)
|
||||
# set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
|
||||
# set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
|
||||
endif()
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
set(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
@ -205,6 +201,10 @@ else()
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
# WA for Xcode generator + object libraries issue:
|
||||
# https://gitlab.kitware.com/cmake/cmake/issues/20260
|
||||
# http://cmake.3232098.n2.nabble.com/XCODE-DEPEND-HELPER-make-Deletes-Targets-Before-and-While-They-re-Built-td7598277.html
|
||||
set(CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY ON)
|
||||
set(CMAKE_MACOSX_RPATH ON)
|
||||
endif()
|
||||
|
||||
|
@ -65,7 +65,7 @@ ngraph::op::GenericIE::GenericIE(const ngraph::NodeVector& inputs,
|
||||
ngraph::op::GenericIE::GenericIE(const ngraph::OutputVector& inputs,
|
||||
const std::map<std::string, InferenceEngine::Parameter>& params,
|
||||
const std::string type, const std::vector<PortIE>& outputs)
|
||||
: Op(inputs), params(params), type(type), outputs(outputs), initialized(0) {
|
||||
: Op(inputs), params(params), outputs(outputs), type(type), initialized(0) {
|
||||
constructor_validate_and_infer_types();
|
||||
}
|
||||
|
||||
|
@ -10,17 +10,17 @@
|
||||
using namespace InferenceEngine;
|
||||
|
||||
TensorDesc::TensorDesc(const Precision& precision, SizeVector dims, Layout layout)
|
||||
: blockingDesc(dims, layout), precision(precision) {
|
||||
: precision(precision), blockingDesc(dims, layout) {
|
||||
this->dims = dims;
|
||||
this->layout = layout;
|
||||
}
|
||||
|
||||
TensorDesc::TensorDesc(const Precision& precision, Layout layout): blockingDesc(), precision(precision) {
|
||||
TensorDesc::TensorDesc(const Precision& precision, Layout layout): precision(precision), blockingDesc() {
|
||||
this->layout = layout;
|
||||
}
|
||||
|
||||
TensorDesc::TensorDesc(const Precision& precision, SizeVector dims, const BlockingDesc& blockDesc)
|
||||
: dims(dims), blockingDesc(blockDesc), precision(precision) {
|
||||
: dims(dims), precision(precision), blockingDesc(blockDesc) {
|
||||
if (dims.size() == 0 || blockingDesc.getBlockDims().size() == 0) {
|
||||
layout = Layout::SCALAR;
|
||||
return;
|
||||
|
@ -38,7 +38,14 @@ target_include_directories(${TARGET_NAME}_obj PRIVATE ${PUBLIC_HEADERS_DIR} ${CM
|
||||
|
||||
# Create shared library
|
||||
|
||||
file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp)
|
||||
|
||||
add_library(${TARGET_NAME} SHARED
|
||||
# according to https://cmake.org/cmake/help/latest/command/add_library.html#id4
|
||||
# Some native build systems (such as Xcode) may not like targets that have only
|
||||
# object files, so consider adding at least one real source file to any target that
|
||||
# references $<TARGET_OBJECTS:objlib>.
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp
|
||||
$<TARGET_OBJECTS:${TARGET_NAME}_obj>
|
||||
$<TARGET_OBJECTS:inference_engine_common_obj>)
|
||||
|
||||
@ -46,7 +53,7 @@ set_ie_threading_interface_for(${TARGET_NAME})
|
||||
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE ${NGRAPH_LIBRARIES} inference_engine_transformations pugixml)
|
||||
|
||||
add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME})
|
||||
add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME} EXCLUDE_PATTERNS ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp)
|
||||
|
||||
# export targets
|
||||
|
||||
|
@ -935,7 +935,6 @@ void CNNNetworkInt8Normalizer::QuantizeConvolutionOrFullyConnected(CNNLayer::Ptr
|
||||
if (weights) {
|
||||
const float* weight = static_cast<const float*>(weights->buffer());
|
||||
|
||||
WeightableLayer* pConv = dynamic_cast<WeightableLayer*>(target_layer.get());
|
||||
ConvolutionLayer* pConv1 = dynamic_cast<ConvolutionLayer*>(target_layer.get());
|
||||
|
||||
if (pConv1 != nullptr && pConv1->_group == 0) {
|
||||
|
@ -447,12 +447,6 @@ InferenceEngine::details::CNNLayerCreator::CNNLayerCreator(const std::shared_ptr
|
||||
}
|
||||
|
||||
CNNLayerPtr InferenceEngine::details::CNNLayerCreator::create() {
|
||||
auto one_from = [](const std::string& desc, const std::vector<std::string>& descs) -> bool {
|
||||
for (const auto& d : descs) {
|
||||
if (details::CaselessEq<std::string>()(d, desc)) return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
LayerParams attrs = {node->get_friendly_name(), node->description(),
|
||||
details::convertPrecision(node->get_output_element_type(0))};
|
||||
if (creators.find(node->description()) != creators.end())
|
||||
|
@ -67,7 +67,7 @@ static std::vector<DataPtr> get_outputs(details::CNNNetworkImpl* _network) {
|
||||
}
|
||||
|
||||
ConstTransformer::ConstTransformer(details::CNNNetworkImpl* _network)
|
||||
: inputs(get_inputs(_network)), outputs(get_outputs(_network)), network(_network) {
|
||||
: network(_network), inputs(get_inputs(_network)), outputs(get_outputs(_network)) {
|
||||
if (!_network)
|
||||
THROW_IE_EXCEPTION << "[ERROR]: Failed to init ConstTransformer with null pointer of network";
|
||||
}
|
||||
@ -86,7 +86,7 @@ ConstTransformer::ConstTransformer(ICNNNetwork* _network) {
|
||||
}
|
||||
|
||||
ConstTransformer::ConstTransformer(std::vector<DataPtr> &_inputs, std::vector<DataPtr> &_outputs)
|
||||
: inputs(_inputs), outputs(_outputs), network(nullptr) {
|
||||
: network(nullptr), inputs(_inputs), outputs(_outputs) {
|
||||
if (inputs.empty() || outputs.empty())
|
||||
THROW_IE_EXCEPTION << "[ERROR]: Failed to init ConstTransformer with empty list of inputs or outputs";
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ class INodeConverter {
|
||||
public:
|
||||
virtual CNNLayer::Ptr createLayer(const std::shared_ptr<ngraph::Node>& layer) const = 0;
|
||||
virtual bool canCreate(const std::shared_ptr<ngraph::Node>& node) const = 0;
|
||||
virtual ~INodeConverter() = default;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
@ -55,6 +56,7 @@ template <class NGT>
|
||||
class NodeConverter : public INodeConverter {
|
||||
public:
|
||||
NodeConverter() = default;
|
||||
~NodeConverter() override = default;
|
||||
|
||||
CNNLayer::Ptr createLayer(const std::shared_ptr<ngraph::Node>& layer) const override;
|
||||
|
||||
|
@ -46,7 +46,7 @@ void CNNNetwork::AddExtension(InferenceEngine::IShapeInferExtensionPtr extension
|
||||
}
|
||||
|
||||
CNNLayer::CNNLayer(const LayerParams& prms)
|
||||
: name(prms.name), type(prms.type), precision(prms.precision), userValue({0}), node(nullptr) {}
|
||||
: node(nullptr), name(prms.name), type(prms.type), precision(prms.precision), userValue({0}) {}
|
||||
|
||||
CNNLayer::CNNLayer(const CNNLayer& other)
|
||||
: node(other.node), name(other.name), type(other.type), precision(other.precision),
|
||||
|
@ -19,6 +19,10 @@
|
||||
#include "ie_layers.h"
|
||||
#include "xml_parse_utils.h"
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic ignored "-Wunused-variable"
|
||||
#endif
|
||||
|
||||
namespace InferenceEngine {
|
||||
|
||||
using namespace details;
|
||||
|
@ -124,7 +124,7 @@ Paddings getPaddingsImpl(const CNNLayer& layer) {
|
||||
int getNumIteration(const TensorIterator& tensorIterator) {
|
||||
using PortMap = TensorIterator::PortMap;
|
||||
const auto isIterable = [](const PortMap& rule) { return rule.axis != -1; };
|
||||
const auto getNumIterations = [&tensorIterator](const PortMap& rule, const DataPtr& iterableData) -> int {
|
||||
const auto getNumIterations = [](const PortMap& rule, const DataPtr& iterableData) -> int {
|
||||
if (iterableData == nullptr) {
|
||||
THROW_IE_EXCEPTION << ": Iteration over an invalid data object (null pointer dereference)";
|
||||
}
|
||||
|
@ -304,19 +304,6 @@ void RemoveLayer(CNNLayerPtr& layer) {
|
||||
/**** Converter Passes ************************************/
|
||||
/************************************************************/
|
||||
|
||||
static RNNSequenceLayer::CellType cell_type_from_name(std::string& layer_type) {
|
||||
RNNSequenceLayer::CellType res;
|
||||
if (layer_type == "LSTMCell")
|
||||
res = RNNSequenceLayer::LSTM;
|
||||
else if (layer_type == "GRUCell")
|
||||
res = RNNSequenceLayer::GRU;
|
||||
else if (layer_type == "RNNCell")
|
||||
res = RNNSequenceLayer::RNN;
|
||||
else
|
||||
THROW_IE_EXCEPTION << "Unknown Cell type (" << layer_type << "). Expected LSTMCell|GRUCell|RNNCell";
|
||||
return res;
|
||||
}
|
||||
|
||||
static std::string cell_name(RNNSequenceLayer::CellType type) {
|
||||
std::string res;
|
||||
switch (type) {
|
||||
@ -777,20 +764,6 @@ static void _link_with_clip(CNNLayerPtr src, CNNLayerPtr dst, const float clip_v
|
||||
_link(clip, dst, 0, dst_port);
|
||||
}
|
||||
}
|
||||
|
||||
static Blob::Ptr make_partial_copy(Blob::Ptr src, size_t off, size_t size) {
|
||||
auto res = make_plain_blob(src->getTensorDesc().getPrecision(), {size});
|
||||
res->allocate();
|
||||
|
||||
size_t elem_size = src->getTensorDesc().getPrecision().size();
|
||||
auto src_ptr = src->buffer().as<uint8_t*>();
|
||||
auto dst_ptr = res->buffer().as<uint8_t*>();
|
||||
|
||||
ie_memcpy(dst_ptr, res->byteSize(), src_ptr + off * elem_size, size * elem_size);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static Blob::Ptr wrap_as_tensor(Blob::Ptr src, SizeVector dims) {
|
||||
auto res = make_blob_with_precision(
|
||||
TensorDesc {src->getTensorDesc().getPrecision(), dims, TensorDesc::getLayoutByDims(dims)}, src->buffer());
|
||||
|
@ -43,7 +43,6 @@ public:
|
||||
SizeVector outShape;
|
||||
if (idx_dims.size() > 1) THROW_IE_EXCEPTION << " Index vector should be 1 dimension";
|
||||
|
||||
size_t max = data_dims.size();
|
||||
switch (inBlobs[UNSQUEEZE_INDEXES]->getTensorDesc().getPrecision()) {
|
||||
case Precision::FP32: {
|
||||
procIndices<float>(inBlobs, UNSQUEEZE_INDEXES, data_dims, outShape, idx_dims);
|
||||
|
@ -78,7 +78,6 @@ public:
|
||||
<< "and only FP32 and I32 are supported!";
|
||||
}
|
||||
|
||||
StatusCode retcode = OK;
|
||||
switch (outData[0]->getTensorDesc().getPrecision()) {
|
||||
case Precision::FP32: {
|
||||
range((inData[RANGE_START]->cbuffer().as<float*>() +
|
||||
|
@ -316,7 +316,7 @@ private:
|
||||
size_t work_amount_dst = dstStrides[0] * dst_dims[0] / dst_dims[dims_size_1];
|
||||
|
||||
parallel_nt(0, [&](const int ithr, const int nthr) {
|
||||
size_t i, start = 0, end = 0;
|
||||
size_t start = 0, end = 0;
|
||||
SizeVector counters(dims_size_1, 0);
|
||||
splitter(work_amount_dst, nthr, ithr, start, end);
|
||||
int src_idx = begin_dms[dims_size_1];
|
||||
@ -352,7 +352,7 @@ private:
|
||||
size_t work_amount_dst = dstStrides[0] * dst_dims[0];
|
||||
|
||||
parallel_nt(0, [&](const int ithr, const int nthr) {
|
||||
size_t i, start = 0, end = 0;
|
||||
size_t start = 0, end = 0;
|
||||
SizeVector counters(dims_size, 0);
|
||||
splitter(work_amount_dst, nthr, ithr, start, end);
|
||||
int src_idx = 0;
|
||||
|
@ -24,8 +24,6 @@ void MeanImage::Load(const MKLDNNDims& inputDims, InputInfo::Ptr inputInfo) {
|
||||
THROW_IE_EXCEPTION << "channels mismatch between mean and input";
|
||||
}
|
||||
|
||||
ResponseDesc resp;
|
||||
|
||||
switch (pp.getMeanVariant()) {
|
||||
case MEAN_VALUE: {
|
||||
// mean image common value per channel (1x1xC)
|
||||
|
@ -52,7 +52,6 @@ std::shared_ptr<ICNNNetwork> dump_graph_as_ie_net(const MKLDNNGraph &graph) {
|
||||
|
||||
for (int i = 0; i < ch_edges.size(); i++) {
|
||||
auto edge = node->getChildEdgeAt(i);
|
||||
int out_port = edge->getInputNum();
|
||||
int in_port = edge->getOutputNum();
|
||||
auto ch_node = edge->getChild();
|
||||
auto ch = node2layer[ch_node];
|
||||
|
@ -53,7 +53,6 @@ void MKLDNNMemory::Create(memory::dims dims, memory::data_type data_type, memory
|
||||
|
||||
void MKLDNNMemory::Create(const mkldnn::memory::desc& desc, const void *data, bool pads_zeroing) {
|
||||
auto primitive_desc = memory::primitive_desc(desc, eng);
|
||||
uint8_t itemSize = MKLDNNExtensionUtils::sizeOfDataType(mkldnn::memory::data_type(desc.data.data_type));
|
||||
|
||||
if (data == nullptr) {
|
||||
prim.reset(new memory(primitive_desc));
|
||||
|
@ -139,9 +139,9 @@ void MKLDNNNode::AddNode(const std::string& name, CreatorByLayerFunction factory
|
||||
|
||||
MKLDNNNode::MKLDNNNode(const InferenceEngine::CNNLayerPtr& layer, const mkldnn::engine& eng,
|
||||
MKLDNNWeightsSharing::Ptr &w_cache)
|
||||
: cnnLayer(layer), name(layer->name), typeStr(layer->type), type(TypeFromName(layer->type)), engine(eng),
|
||||
selectedPrimitiveDescriptorIndex(-1), permanent(false), temporary(false), constant(ConstantType::Unknown),
|
||||
profilingTask(name), weightCache(w_cache) {
|
||||
: selectedPrimitiveDescriptorIndex(-1), permanent(false), temporary(false), constant(ConstantType::Unknown),
|
||||
weightCache(w_cache), cnnLayer(layer), engine(eng), name(layer->name), typeStr(layer->type),
|
||||
type(TypeFromName(layer->type)), profilingTask(name) {
|
||||
if (!layer->outData.empty()) {
|
||||
for (const auto& outData : layer->outData) {
|
||||
outDims.emplace_back(outData->getDims());
|
||||
@ -1128,4 +1128,4 @@ Layout MKLDNNNode::getWeightsLayoutByDims(SizeVector dims, bool isGrouped) {
|
||||
|
||||
void MKLDNNNode::appendPostOps(mkldnn::post_ops& ops) {
|
||||
THROW_IE_EXCEPTION << "Fusing of " << this->getType() << " operation is not implemented";
|
||||
}
|
||||
}
|
||||
|
@ -24,9 +24,9 @@ using namespace MKLDNNPlugin;
|
||||
using namespace InferenceEngine;
|
||||
|
||||
MKLDNNConvolutionNode::MKLDNNConvolutionNode(const InferenceEngine::CNNLayerPtr& layer, const mkldnn::engine& eng, MKLDNNWeightsSharing::Ptr &cache)
|
||||
: MKLDNNNode(layer, eng, cache), withBiases(false), withSum(false), dw_conv_iw(0), dw_conv_ih(0),
|
||||
dw_conv_oc(0), dw_conv_in_dt(memory::data_type::data_undef), isDW(false), isMerged(false), withActivation(false),
|
||||
isGrouped(false), baseInputsNumber(1), eltwisePrecision(Precision::FP32), withDWConv(false), groupNum(1lu) {
|
||||
: MKLDNNNode(layer, eng, cache), withBiases(false), withSum(false), withDWConv(false), isDW(false), isMerged(false),
|
||||
isGrouped(false), dw_conv_oc(0), dw_conv_ih(0), dw_conv_iw(0), dw_conv_in_dt(memory::data_type::data_undef),
|
||||
groupNum(1lu), baseInputsNumber(1), eltwisePrecision(Precision::FP32) {
|
||||
internalBlobDesc.emplace_back([&](primitive_desc_iterator &primitive_desc_it, size_t idx) -> MKLDNNMemoryDesc {
|
||||
return MKLDNNMemoryDesc(primitive_desc_it.weights_primitive_desc(0).desc());
|
||||
});
|
||||
@ -736,7 +736,6 @@ void MKLDNNConvolutionNode::addZeroPoints(mkldnn::primitive_attr& attr) const {
|
||||
}
|
||||
|
||||
void MKLDNNConvolutionNode::addScaleToPrimitiveAttr(mkldnn::primitive_attr attr) const {
|
||||
bool scaled = false;
|
||||
if (wScale != nullptr) {
|
||||
float* wScaleData = static_cast<float*>(wScale->buffer());
|
||||
|
||||
|
@ -61,7 +61,6 @@ private:
|
||||
void addZeroPoints(mkldnn::primitive_attr& attr) const;
|
||||
|
||||
bool withBiases;
|
||||
bool withActivation;
|
||||
bool withSum;
|
||||
bool withDWConv;
|
||||
bool isDW;
|
||||
|
@ -177,10 +177,6 @@ void MKLDNNDeconvolutionNode::createDescriptor(const std::vector<InferenceEngine
|
||||
const std::vector<InferenceEngine::TensorDesc> &outputDesc) {
|
||||
MKLDNNMemoryDesc in_candidate(inputDesc[0]);
|
||||
MKLDNNMemoryDesc out_candidate(outputDesc[0]);
|
||||
auto in_fmt = in_candidate.getFormat();
|
||||
auto out_fmt = out_candidate.getFormat();
|
||||
int O_IND = withGroups ? 1 : 0;
|
||||
int I_IND = withGroups ? 2 : 1;
|
||||
|
||||
// grouping and autoblicking is not compatible
|
||||
if ((withGroups && !isDW) && (in_candidate.blocksExtended() || out_candidate.blocksExtended()))
|
||||
|
@ -325,7 +325,6 @@ const std::vector<impl_desc_type>& MKLDNNFullyConnectedNode::getPrimitivesPriori
|
||||
|
||||
std::shared_ptr<mkldnn::primitive_attr> MKLDNNFullyConnectedNode::initPrimitiveAttr() {
|
||||
auto attr = std::make_shared<mkldnn::primitive_attr>(mkldnn::primitive_attr());
|
||||
bool scaled = false;
|
||||
if (wScale != nullptr) {
|
||||
float* wScaleData = static_cast<float*>(wScale->buffer());
|
||||
|
||||
|
@ -737,7 +737,6 @@ void MKLDNNMVNNode::mvn_pln(const float* src_data, float* dst_data, const SizeVe
|
||||
blk_size = 4;
|
||||
}
|
||||
|
||||
size_t dims_size = dims.size();
|
||||
size_t N = 0; size_t C = 0; size_t D = 0; size_t H = 0; size_t W = 0;
|
||||
std::tie(N, C, D, H, W) = get5dShapes(dims);
|
||||
|
||||
|
@ -36,7 +36,6 @@ void MKLDNNReshapeNode::initSupportedPrimitiveDescriptors() {
|
||||
if (inputDataType != outputDataType)
|
||||
inputDataType = outputDataType;
|
||||
|
||||
auto& inDims = getParentEdgeAt(0)->getDims();
|
||||
auto& outDims = getChildEdgeAt(0)->getDims();
|
||||
memory::format outFormat = MKLDNNMemory::GetPlainFormat(outDims);
|
||||
InferenceEngine::LayerConfig config;
|
||||
|
@ -62,7 +62,6 @@ public:
|
||||
auto full_dims = full_blob->GetDims();
|
||||
auto part_dims = part_blob->GetDims();
|
||||
|
||||
bool simple_copy = port_map.axis == -1;
|
||||
if (port_map.axis == -1) {
|
||||
// simple copy mode. No iteration through this tensor
|
||||
reorders.emplace_back(from->GetPrimitive(), to->GetPrimitive());
|
||||
@ -132,13 +131,8 @@ class BackEdgePortHelper : public PortMapHelper {
|
||||
public:
|
||||
BackEdgePortHelper(const MKLDNNMemoryPtr &from, const MKLDNNMemoryPtr &to, const mkldnn::engine& eng, int n_iter) {
|
||||
auto mem_desc = from->GetDescriptor();
|
||||
|
||||
|
||||
mem_holder.emplace_back(mkldnn::memory::primitive_desc(mem_desc, eng));
|
||||
auto &temp_mem = mem_holder.back();
|
||||
|
||||
reorders.emplace_back(from->GetPrimitive(), to->GetPrimitive());
|
||||
|
||||
iter_count = n_iter;
|
||||
}
|
||||
|
||||
|
@ -394,15 +394,6 @@ private:
|
||||
int pooled_width_ = 0;
|
||||
std::vector<int> pyramid_scales_;
|
||||
int sampling_ratio_ = 0;
|
||||
|
||||
int channels = 0;
|
||||
int height = 0;
|
||||
int width = 0;
|
||||
|
||||
int nn = 0;
|
||||
int nc = 0;
|
||||
int nh = 0;
|
||||
int nw = 0;
|
||||
};
|
||||
|
||||
REG_FACTORY_FOR(ExperimentalDetectronROIFeatureExtractorImpl, ExperimentalDetectronROIFeatureExtractor);
|
||||
|
@ -52,7 +52,7 @@ struct MetricType;
|
||||
#define IE_SET_METRIC_RETURN(name, ...) \
|
||||
typename ::InferenceEngine::Metrics::MetricType<::InferenceEngine::Metrics::name>::type _##name##_value = \
|
||||
__VA_ARGS__; \
|
||||
return std::move(_##name##_value)
|
||||
return _##name##_value
|
||||
|
||||
/**
|
||||
* @def IE_SET_METRIC(name, ...)
|
||||
|
@ -152,7 +152,14 @@ set_ie_threading_interface_for(${TARGET_NAME}_obj)
|
||||
|
||||
# Create shared library file from object library
|
||||
|
||||
file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp)
|
||||
|
||||
add_library(${TARGET_NAME} SHARED
|
||||
# according to https://cmake.org/cmake/help/latest/command/add_library.html#id4
|
||||
# Some native build systems (such as Xcode) may not like targets that have only
|
||||
# object files, so consider adding at least one real source file to any target that
|
||||
# references $<TARGET_OBJECTS:objlib>.
|
||||
${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp
|
||||
$<TARGET_OBJECTS:${TARGET_NAME}_obj>)
|
||||
|
||||
set_ie_threading_interface_for(${TARGET_NAME})
|
||||
@ -165,6 +172,9 @@ if(WIN32)
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES COMPILE_PDB_NAME ${TARGET_NAME})
|
||||
endif()
|
||||
|
||||
add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME}
|
||||
EXCLUDE_PATTERNS ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp)
|
||||
|
||||
# Static library used for unit tests which are always built
|
||||
|
||||
add_library(${TARGET_NAME}_s STATIC
|
||||
|
@ -48,8 +48,6 @@ public:
|
||||
|
||||
std::shared_ptr<Node> copy_with_new_args(const NodeVector& new_args) const override;
|
||||
|
||||
std::shared_ptr<Node> copy(const OutputVector & new_args) const;
|
||||
|
||||
/// \return The data batch shape.
|
||||
const PartialShape get_output_shape() { return m_output_shape; }
|
||||
void set_output_shape(const Shape& output_shape) { m_output_shape = output_shape; }
|
||||
|
@ -22,7 +22,7 @@ class INFERENCE_ENGINE_API_CLASS(ConvertOneHotToOneHotIE);
|
||||
|
||||
class ngraph::pass::ConvertOneHotToOneHotIE: public ngraph::pass::GraphRewrite {
|
||||
public:
|
||||
ConvertOneHotToOneHotIE() : is_f16(false), GraphRewrite() {
|
||||
ConvertOneHotToOneHotIE() : GraphRewrite(), is_f16(false) {
|
||||
convert_one_hot();
|
||||
}
|
||||
|
||||
|
@ -21,12 +21,12 @@ public:
|
||||
|
||||
explicit EltwiseAttrs(std::shared_ptr<EltwiseAttrs> & attrs):
|
||||
m_has_constant_input(attrs->has_constant_input()),
|
||||
m_consumers_count(attrs->get_consumers_count()),
|
||||
m_const_input_id(attrs->get_const_input_id()) {}
|
||||
m_const_input_id(attrs->get_const_input_id()),
|
||||
m_consumers_count(attrs->get_consumers_count()) {}
|
||||
|
||||
EltwiseAttrs(size_t constant_input_id, size_t consumers_count):
|
||||
m_const_input_id(constant_input_id),
|
||||
m_has_constant_input(true),
|
||||
m_const_input_id(constant_input_id),
|
||||
m_consumers_count(consumers_count) {}
|
||||
|
||||
bool has_constant_input() {
|
||||
|
@ -2,12 +2,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include "ngraph_ops/deconvolution_ie.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "ngraph_ops/deconvolution_ie.hpp"
|
||||
|
||||
#include "ngraph/util.hpp"
|
||||
#include "ngraph/validation_util.hpp"
|
||||
|
||||
@ -31,8 +31,8 @@ op::DeconvolutionIE::DeconvolutionIE(const Output<Node>& data,
|
||||
, m_pads_begin(pads_begin)
|
||||
, m_pads_end(pads_end)
|
||||
, m_auto_pad(auto_pad)
|
||||
, m_group(group)
|
||||
, m_output_shape(output_shape) {
|
||||
, m_output_shape(output_shape)
|
||||
, m_group(group) {
|
||||
constructor_validate_and_infer_types();
|
||||
}
|
||||
|
||||
@ -52,8 +52,8 @@ op::DeconvolutionIE::DeconvolutionIE(const Output<Node>& data,
|
||||
, m_pads_begin(pads_begin)
|
||||
, m_pads_end(pads_end)
|
||||
, m_auto_pad(auto_pad)
|
||||
, m_group(group)
|
||||
, m_output_shape(output_shape) {
|
||||
, m_output_shape(output_shape)
|
||||
, m_group(group) {
|
||||
constructor_validate_and_infer_types();
|
||||
}
|
||||
|
||||
@ -85,28 +85,3 @@ shared_ptr<Node> op::DeconvolutionIE::copy_with_new_args(const NodeVector& new_a
|
||||
m_auto_pad);
|
||||
}
|
||||
}
|
||||
|
||||
shared_ptr<Node> op::DeconvolutionIE::copy(const OutputVector& new_args) const {
|
||||
if (new_args.size() == 2) {
|
||||
return make_shared<DeconvolutionIE>(new_args.at(0),
|
||||
new_args.at(1),
|
||||
m_strides,
|
||||
m_pads_begin,
|
||||
m_pads_end,
|
||||
m_dilations,
|
||||
m_output_shape,
|
||||
m_group,
|
||||
m_auto_pad);
|
||||
} else {
|
||||
return make_shared<DeconvolutionIE>(new_args.at(0),
|
||||
new_args.at(1),
|
||||
new_args.at(2),
|
||||
m_strides,
|
||||
m_pads_begin,
|
||||
m_pads_end,
|
||||
m_dilations,
|
||||
m_output_shape,
|
||||
m_group,
|
||||
m_auto_pad);
|
||||
}
|
||||
}
|
@ -17,8 +17,7 @@ using namespace ngraph;
|
||||
constexpr NodeTypeInfo op::FullyConnected::type_info;
|
||||
|
||||
op::FullyConnected::FullyConnected(const Output<Node>& A, const Output<Node>& B, const Output<Node>& C, const Shape & output_shape)
|
||||
: m_output_shape(output_shape),
|
||||
Op({A, B, C}) {
|
||||
: Op({A, B, C}), m_output_shape(output_shape) {
|
||||
constructor_validate_and_infer_types();
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ op::NonMaxSuppressionIE::NonMaxSuppressionIE(const Output<Node> &boxes,
|
||||
int center_point_box,
|
||||
bool sort_result_descending)
|
||||
: Op({boxes, scores, max_output_boxes_per_class, iou_threshold, score_threshold}),
|
||||
m_output_shape{output_shape}, m_center_point_box{center_point_box}, m_sort_result_descending{sort_result_descending} {
|
||||
m_center_point_box{center_point_box}, m_sort_result_descending{sort_result_descending}, m_output_shape{output_shape} {
|
||||
constructor_validate_and_infer_types();
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ using namespace ngraph;
|
||||
constexpr NodeTypeInfo op::OneHotIE::type_info;
|
||||
|
||||
op::OneHotIE::OneHotIE(const Output<ngraph::Node>& input, int axis, int depth, float on_value, float off_value, element::Type type)
|
||||
: Op({input}), m_axis(axis), m_depth(depth), m_on_value(on_value), m_off_value(off_value), m_type(type) {
|
||||
: Op({input}), m_type(type), m_axis(axis), m_depth(depth), m_off_value(off_value), m_on_value(on_value) {
|
||||
constructor_validate_and_infer_types();
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ using namespace ngraph;
|
||||
constexpr NodeTypeInfo op::PowerIE::type_info;
|
||||
|
||||
op::PowerIE::PowerIE(const Output<ngraph::Node>& data_batch, const float power, const float scale, const float shift)
|
||||
: Op({data_batch}), power(power), scale(scale), shift(shift) {
|
||||
: Op({data_batch}), scale(scale), power(power), shift(shift) {
|
||||
constructor_validate_and_infer_types();
|
||||
}
|
||||
|
||||
|
@ -57,11 +57,11 @@ void ngraph::pass::ConvertLRNToLRNIE::convert_lrn() {
|
||||
region);
|
||||
|
||||
lrn_ie->set_friendly_name(lrn->get_friendly_name());
|
||||
ngraph:copy_runtime_info(lrn, lrn_ie);
|
||||
ngraph::copy_runtime_info(lrn, lrn_ie);
|
||||
ngraph::replace_node(lrn, lrn_ie);
|
||||
return true;
|
||||
};
|
||||
|
||||
auto m = std::make_shared<ngraph::pattern::Matcher>(lrn, "ConvertLRNToLRNIE");
|
||||
this->add_matcher(m, callback, PassProperty::CHANGE_DYNAMIC_STATE);
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ void ngraph::pass::ConvertMatMulToFCorGemm::convert_matmul() {
|
||||
auto input_1 = std::make_shared<pattern::op::Label>(element::f32, Shape {1, 1});
|
||||
auto matmul = std::make_shared<ngraph::opset1::MatMul>(input_0, input_1);
|
||||
|
||||
ngraph::graph_rewrite_callback callback = [this](pattern::Matcher& m) {
|
||||
ngraph::graph_rewrite_callback callback = [](pattern::Matcher& m) {
|
||||
auto matmul = std::dynamic_pointer_cast<ngraph::opset1::MatMul>(m.get_match_root());
|
||||
if (!matmul) {
|
||||
return false;
|
||||
@ -200,4 +200,4 @@ void ngraph::pass::ConvertMatMulToFCorGemm::convert_matmul() {
|
||||
|
||||
auto m = std::make_shared<ngraph::pattern::Matcher>(matmul, "ConvertMatMulToFCorGemm");
|
||||
this->add_matcher(m, callback, PassProperty::CHANGE_DYNAMIC_STATE);
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,6 @@ void getConvOutShape(const std::vector<size_t> &inShape,
|
||||
outShape.resize(inShape.size(), 1lu);
|
||||
outShape[0] = inShape[0];
|
||||
outShape[1] = params.out_c;
|
||||
size_t in_size = inShape.size();
|
||||
for (int i = 0; i < params.kernel.size() && i + 2 < outShape.size(); i++) {
|
||||
outShape[i + 2] =
|
||||
(inShape[i + 2] + params.pads_begin[i] + params.pads_end[i] -
|
||||
@ -58,7 +57,6 @@ void getPoolOutShape(const std::vector<size_t> &inShape,
|
||||
outShape.resize(inShape.size(), 1lu);
|
||||
outShape[0] = inShape[0];
|
||||
outShape[1] = inShape[1];
|
||||
size_t in_size = inShape.size();
|
||||
for (int i = 0; i < params.kernel.size() && i + 2 < outShape.size(); i++) {
|
||||
outShape[i + 2] =
|
||||
(inShape[i + 2] + params.pads_begin[i] + params.pads_end[i] - params.kernel[i]) / params.stride[i] +
|
||||
|
@ -75,9 +75,9 @@ protected:
|
||||
private:
|
||||
Port(std::weak_ptr<Layer> parent, size_t id, const std::vector<size_t> &shape,
|
||||
std::map<std::string, std::string> common_attributes = {})
|
||||
: m_parent(std::move(parent)),
|
||||
m_id(id),
|
||||
: m_id(id),
|
||||
m_shape(shape),
|
||||
m_parent(std::move(parent)),
|
||||
m_common_attributes(std::move(common_attributes)) {}
|
||||
};
|
||||
|
||||
@ -235,9 +235,9 @@ private:
|
||||
std::weak_ptr<IRNet> m_parent;
|
||||
|
||||
Layer(std::weak_ptr<IRNet> parent, size_t id, std::map<std::string, std::string> common_attributes = {})
|
||||
: m_parent(std::move(parent)),
|
||||
m_id(id),
|
||||
m_common_attributes(std::move(common_attributes)) {
|
||||
: m_id(id),
|
||||
m_common_attributes(std::move(common_attributes)),
|
||||
m_parent(std::move(parent)) {
|
||||
}
|
||||
};
|
||||
|
||||
@ -303,7 +303,7 @@ public:
|
||||
// convert to string
|
||||
std::stringstream ss;
|
||||
doc.print(ss, " ");
|
||||
return std::move(ss.str());
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
protected:
|
||||
@ -482,4 +482,4 @@ private:
|
||||
std::shared_ptr<IRNet> m_ir_net;
|
||||
};
|
||||
|
||||
} // namespace CommonTestUtils
|
||||
} // namespace CommonTestUtils
|
||||
|
@ -7,7 +7,6 @@ set(TARGET_NAME unitTestUtils)
|
||||
list(APPEND EXPORT_DEPENDENCIES
|
||||
commonTestUtils_s
|
||||
inference_engine_s
|
||||
inference_engine_preproc_s
|
||||
inference_engine_lp_transformations
|
||||
inference_engine_ir_readers
|
||||
gmock)
|
||||
|
Loading…
Reference in New Issue
Block a user