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