Commit c671a2b7 authored by shssf's avatar shssf Committed by Robert Kimball

IntelGPU backend. Fix bug in Concat and small refactoring (#1668)

parent 015435d8
......@@ -73,6 +73,8 @@
using namespace std;
using namespace ngraph;
using intelgpu_space = runtime::intelgpu::IntelGPULayout;
// This expands the op list in op_tbl.hpp into a list of enumerations that look like this:
// Abs,
// Acos,
......@@ -176,14 +178,10 @@ static void do_pooling_operation(cldnn::topology& topology,
{
arguments_check(op, 1, 1);
const cldnn::tensor output_size =
runtime::intelgpu::IntelGPULayout::create_cldnn_tensor(get_output_shape(op));
const cldnn::tensor input_offset =
runtime::intelgpu::IntelGPULayout::create_cldnn_offset(pad_below);
const cldnn::tensor size = runtime::intelgpu::IntelGPULayout::create_cldnn_tensor(pool_shape);
const cldnn::tensor stride =
runtime::intelgpu::IntelGPULayout::create_cldnn_tensor(pool_strides);
const cldnn::tensor output_size = intelgpu_space::create_cldnn_tensor(get_output_shape(op));
const cldnn::tensor input_offset = intelgpu_space::create_cldnn_offset(pad_below);
const cldnn::tensor size = intelgpu_space::create_cldnn_tensor(pool_shape);
const cldnn::tensor stride = intelgpu_space::create_cldnn_tensor(pool_strides);
const cldnn::pooling cldnn_pooling(
get_output_name(op), get_input_name(op), mode, size, stride, input_offset, output_size);
......@@ -409,14 +407,17 @@ bool runtime::intelgpu::IntelGPUBackend::compile(shared_ptr<Function> func)
{
arguments_check(op, 1, 1);
}
const size_t ngraph_tensor_dims = get_input_shape(op, 0).size();
// All input shapes must be the same
// if shape is empty (means Shape{}) in this case treat its size as 1
const size_t ngraph_tensor_dims =
get_input_shape(op).empty() ? 1 : get_input_shape(op).size();
const shared_ptr<op::Concat> concat_op = static_pointer_cast<op::Concat>(op);
const size_t ngraph_concat_axis = concat_op->get_concatenation_axis();
vector<cldnn::primitive_id> inputs;
cldnn::concatenation::concatenation_axis cldnn_axis =
runtime::intelgpu::IntelGPULayout::get_cldnn_axis(ngraph_tensor_dims,
ngraph_concat_axis);
intelgpu_space::get_cldnn_axis(ngraph_tensor_dims, ngraph_concat_axis);
for (auto const& input : op->get_inputs())
{
......@@ -612,7 +613,7 @@ bool runtime::intelgpu::IntelGPUBackend::compile(shared_ptr<Function> func)
(get_input_shape(op).size() == 1 && get_input_shape(op).at(0) == 1))
{
const cldnn::tensor output_tensor_size =
runtime::intelgpu::IntelGPULayout::create_cldnn_tensor(get_output_shape(op));
intelgpu_space::create_cldnn_tensor(get_output_shape(op));
const cldnn::broadcast cldnn_broadcast(
get_output_name(op), get_input_name(op), output_tensor_size);
topology.add(cldnn_broadcast);
......
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