AUTO_CAUSES_COPY in c bindings (#17391)

* change auto in for() to auto const &

* fix code style

* fix code style

* const&
This commit is contained in:
Haiqi Pan authored and GitHub committed 2023-05-15 14:03:52 +04:00
1 parent 5df0a006df
commit 49b0c7248a
2 files changed
+12 -12

No files matched your search

+10 -10
View File
@@ -871,7 +871,7 @@ IEStatusCode ie_network_set_input_precision(ie_network_t* network, const char* i
status = IEStatusCode::NOT_FOUND;
} else {
IE::Precision precision;
for (auto it : precision_map) {
for (auto const& it : precision_map) {
if (it.second == p) {
precision = it.first;
break;
@@ -921,7 +921,7 @@ IEStatusCode ie_network_set_input_layout(ie_network_t* network, const char* inpu
status = IEStatusCode::NOT_FOUND;
} else {
IE::Layout layout = IE::Layout::NCHW;
for (auto it : layout_map) {
for (auto const& it : layout_map) {
if (it.second == l) {
layout = it.first;
break;
@@ -1000,7 +1000,7 @@ IEStatusCode ie_network_set_input_resize_algorithm(ie_network_t* network,
status = IEStatusCode::NOT_FOUND;
} else {
IE::ResizeAlgorithm resize = IE::ResizeAlgorithm::NO_RESIZE;
for (auto it : resize_alg_map) {
for (auto const& it : resize_alg_map) {
if (it.second == resize_algo) {
resize = it.first;
break;
@@ -1054,7 +1054,7 @@ IEStatusCode ie_network_set_color_format(ie_network_t* network,
status = IEStatusCode::NOT_FOUND;
} else {
IE::ColorFormat color = IE::ColorFormat::RGB;
for (auto it : colorformat_map) {
for (auto const& it : colorformat_map) {
if (it.second == color_format) {
color = it.first;
break;
@@ -1214,7 +1214,7 @@ IEStatusCode ie_network_set_output_precision(ie_network_t* network, const char*
status = IEStatusCode::NOT_FOUND;
} else {
IE::Precision precision;
for (auto it : precision_map) {
for (auto const& it : precision_map) {
if (it.second == p) {
precision = it.first;
break;
@@ -1266,7 +1266,7 @@ IEStatusCode ie_network_set_output_layout(ie_network_t* network, const char* out
status = IEStatusCode::NOT_FOUND;
} else {
IE::Layout layout = IE::Layout::NCHW;
for (auto it : layout_map) {
for (auto const& it : layout_map) {
if (it.second == l) {
layout = it.first;
break;
@@ -1457,7 +1457,7 @@ IEStatusCode ie_blob_make_memory(const tensor_desc_t* tensorDesc, ie_blob_t** bl
}
IE::Precision prec;
for (auto it : precision_map) {
for (auto const& it : precision_map) {
if (it.second == tensorDesc->precision) {
prec = it.first;
break;
@@ -1465,7 +1465,7 @@ IEStatusCode ie_blob_make_memory(const tensor_desc_t* tensorDesc, ie_blob_t** bl
}
IE::Layout l = IE::Layout::NCHW;
for (auto it : layout_map) {
for (auto const& it : layout_map) {
if (it.second == tensorDesc->layout) {
l = it.first;
break;
@@ -1524,7 +1524,7 @@ IEStatusCode ie_blob_make_memory_from_preallocated(const tensor_desc_t* tensorDe
}
IE::Precision prec;
for (auto it : precision_map) {
for (auto const& it : precision_map) {
if (it.second == tensorDesc->precision) {
prec = it.first;
break;
@@ -1532,7 +1532,7 @@ IEStatusCode ie_blob_make_memory_from_preallocated(const tensor_desc_t* tensorDe
}
IE::Layout l = IE::Layout::NCHW;
for (auto it : layout_map) {
for (auto const& it : layout_map) {
if (it.second == tensorDesc->layout) {
l = it.first;
break;
@@ -44,11 +44,11 @@ protected:
std::vector<cl_platform_id> platform_ids(n);
err = clGetPlatformIDs(n, platform_ids.data(), NULL);
for (auto& id : platform_ids) {
for (auto const& id : platform_ids) {
cl::Platform platform = cl::Platform(id);
std::vector<cl::Device> devices;
platform.getDevices(CL_DEVICE_TYPE_GPU, &devices);
for (auto& d : devices) {
for (auto const& d : devices) {
if (refVendorID == d.getInfo<CL_DEVICE_VENDOR_ID>()) {
cl_device = d;
cl_context = cl::Context(cl_device);