Commit e67c9c60 authored by Diego Caballero's avatar Diego Caballero Committed by Robert Kimball

[Warnings] Silence more warnings (#2699)

* [Warnings] Silence more warnings

Unused variables and missing switch case.

* Move static global var to the host_tensor translation unit

- Remove non-portable 'unused' attribute.

* Fix style
parent 0f04d5ff
...@@ -3556,12 +3556,13 @@ namespace ngraph ...@@ -3556,12 +3556,13 @@ namespace ngraph
func_block += "d_" + out_denom + " = 1;\n"; func_block += "d_" + out_denom + " = 1;\n";
} }
break; break;
} default:
if (func_block.empty())
{
throw ngraph_error( throw ngraph_error(
"generate_sigmoid_mul_func input function type not supported"); "generate_sigmoid_mul_func input function type not supported");
} }
NGRAPH_ASSERT(!func_block.empty()) << "'func_block' must not be empty";
return func_block; return func_block;
} }
template <> template <>
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
using namespace ngraph; using namespace ngraph;
using namespace std; using namespace std;
static const size_t alignment = 64;
runtime::HostTensor::HostTensor(const ngraph::element::Type& element_type, runtime::HostTensor::HostTensor(const ngraph::element::Type& element_type,
const Shape& shape, const Shape& shape,
void* memory_pointer, void* memory_pointer,
...@@ -46,7 +48,7 @@ runtime::HostTensor::HostTensor(const ngraph::element::Type& element_type, ...@@ -46,7 +48,7 @@ runtime::HostTensor::HostTensor(const ngraph::element::Type& element_type,
} }
else if (m_buffer_size > 0) else if (m_buffer_size > 0)
{ {
size_t allocation_size = m_buffer_size + runtime::alignment; size_t allocation_size = m_buffer_size + alignment;
m_allocated_buffer_pool = static_cast<char*>(ngraph_malloc(allocation_size)); m_allocated_buffer_pool = static_cast<char*>(ngraph_malloc(allocation_size));
m_aligned_buffer_pool = m_allocated_buffer_pool; m_aligned_buffer_pool = m_allocated_buffer_pool;
size_t mod = size_t(m_aligned_buffer_pool) % alignment; size_t mod = size_t(m_aligned_buffer_pool) % alignment;
......
...@@ -26,8 +26,6 @@ namespace ngraph ...@@ -26,8 +26,6 @@ namespace ngraph
{ {
namespace runtime namespace runtime
{ {
static size_t alignment = 64;
class HostTensor; class HostTensor;
} }
} }
......
...@@ -82,8 +82,7 @@ TEST(partial_shape, dim_conversion_dynamic) ...@@ -82,8 +82,7 @@ TEST(partial_shape, dim_conversion_dynamic)
{ {
EXPECT_ANY_THROW({ EXPECT_ANY_THROW({
size_t s{Dimension::dynamic()}; size_t s{Dimension::dynamic()};
(void)s; // Silence compiler warning about unused s
s = 0; // Silence compiler warning about unused s
}); });
} }
......
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