Commit 2a41d7b3 authored by Sergey Shalnov's avatar Sergey Shalnov Committed by Scott Cyphers

IntelGPU backend: Slice operation datatypes fix (#2414)

* IntelGPU backend: Slice operation datatypes fix

* e correct type for int64_t
parent 2d9a974c
......@@ -872,7 +872,12 @@ void runtime::intelgpu::do_slice_operation(cldnn::topology& topology,
codegen::CodeWriter writer;
vector<size_t> gws;
gen_func_def(writer, entry_point_name, {"float"}, {input_shape}, "float", output_shape);
gen_func_def(writer,
entry_point_name,
{get_opencl_type_name(output_type)},
{input_shape},
get_opencl_type_name(output_type),
output_shape);
writer.block_begin();
{
......
......@@ -14,7 +14,6 @@
// limitations under the License.
//*****************************************************************************
#include <algorithm>
#include <algorithm>
#include <cinttypes>
#include <cmath>
......@@ -1714,6 +1713,32 @@ NGRAPH_TEST(${BACKEND_NAME}, slice_3d_strided_different_strides)
EXPECT_EQ((vector<float>{0, 3, 8, 11, 32, 35, 40, 43}), read_vector<float>(result));
}
NGRAPH_TEST(${BACKEND_NAME}, slice_3d_strided_different_strides_int64)
{
Shape shape_a{4, 4, 4};
auto A = make_shared<op::Parameter>(element::i64, shape_a);
Shape shape_r{2, 2, 2};
auto r = make_shared<op::Slice>(A, Coordinate{0, 0, 0}, Coordinate{4, 4, 4}, Strides{2, 2, 3});
auto f = make_shared<Function>(r, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
// Create some tensors for input/output
auto a = backend->create_tensor(element::i64, shape_a);
copy_data(a, vector<int64_t>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63});
auto result = backend->create_tensor(element::i64, shape_r);
auto handle = backend->compile(f);
backend->call_with_validate(handle, {result}, {a});
EXPECT_EQ((vector<int64_t>{0, 3, 8, 11, 32, 35, 40, 43}), read_vector<int64_t>(result));
}
NGRAPH_TEST(${BACKEND_NAME}, slice_3d_start_just_oob)
{
Shape shape_a{20, 10, 5};
......
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