Skip to content

Commit 66a3da3

Browse files
Weiming Zhaoweimingzha0
Weiming Zhao
authored andcommitted
[ODLA/TRT] Add reduction_prod support
1 parent 050a80f commit 66a3da3

9 files changed

+17
-9
lines changed

ODLA/platforms/tensorrt/odla_tensorrt.cc

+8
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,14 @@ odla_value odla_ReduceSumSquare(odla_value input, odla_size_t num_of_axes,
13431343
output_dims, id);
13441344
}
13451345

1346+
odla_value odla_ReduceProd(odla_value input, odla_size_t num_of_axes,
1347+
const odla_uint32* axes, odla_bool keep_dims,
1348+
odla_value_shape output_dims,
1349+
const odla_value_id id) {
1350+
return reduce(input, nvinfer1::ReduceOperation::kPROD, num_of_axes, axes,
1351+
keep_dims, output_dims, id);
1352+
}
1353+
13461354
odla_value odla_LRN(odla_value input, odla_memory_layout input_layout,
13471355
odla_int32 window_size, odla_float32 alpha,
13481356
odla_float32 beta, odla_float32 bias,

tests/unittests/lit_cases/test_tensorrt/test_reduce_prod_default_axes_keepdims_example_tensorrt.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_prod_default_axes_keepdims_example | FileCheck %s
2626
// CHECK: Result Pass
2727
// clang-format on
28-
// XFAIL: *
28+
2929
#include "test_reduce_prod_default_axes_keepdims_example_tensorrt.cc.tmp.main.cc.in"

tests/unittests/lit_cases/test_tensorrt/test_reduce_prod_default_axes_keepdims_random_tensorrt.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_reduce_prod_default_axes_keepdims_random/model.onnx -o %t.cc
2323
// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include
2424
// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_reduce_prod_default_axes_keepdims_random/test_data_set_0 %odla_link %device_link -lodla_tensorrt -o %t_tensorrt.exe -Wno-deprecated-declarations
25-
// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_prod_default_axes_keepdims_random | FileCheck %s
25+
// RUN: %t_tensorrt.exe 0.002 0 tensorrt %data_path/test_reduce_prod_default_axes_keepdims_random | FileCheck %s
2626
// CHECK: Result Pass
2727
// clang-format on
28-
// XFAIL: *
28+
2929
#include "test_reduce_prod_default_axes_keepdims_random_tensorrt.cc.tmp.main.cc.in"

tests/unittests/lit_cases/test_tensorrt/test_reduce_prod_do_not_keepdims_example_tensorrt.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_prod_do_not_keepdims_example | FileCheck %s
2626
// CHECK: Result Pass
2727
// clang-format on
28-
// XFAIL: *
28+
2929
#include "test_reduce_prod_do_not_keepdims_example_tensorrt.cc.tmp.main.cc.in"

tests/unittests/lit_cases/test_tensorrt/test_reduce_prod_do_not_keepdims_random_tensorrt.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_prod_do_not_keepdims_random | FileCheck %s
2626
// CHECK: Result Pass
2727
// clang-format on
28-
// XFAIL: *
28+
2929
#include "test_reduce_prod_do_not_keepdims_random_tensorrt.cc.tmp.main.cc.in"

tests/unittests/lit_cases/test_tensorrt/test_reduce_prod_keepdims_example_tensorrt.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_prod_keepdims_example | FileCheck %s
2626
// CHECK: Result Pass
2727
// clang-format on
28-
// XFAIL: *
28+
2929
#include "test_reduce_prod_keepdims_example_tensorrt.cc.tmp.main.cc.in"

tests/unittests/lit_cases/test_tensorrt/test_reduce_prod_keepdims_random_tensorrt.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_prod_keepdims_random | FileCheck %s
2626
// CHECK: Result Pass
2727
// clang-format on
28-
// XFAIL: *
28+
2929
#include "test_reduce_prod_keepdims_random_tensorrt.cc.tmp.main.cc.in"

tests/unittests/lit_cases/test_tensorrt/test_reduce_prod_negative_axes_keepdims_example_tensorrt.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_prod_negative_axes_keepdims_example | FileCheck %s
2626
// CHECK: Result Pass
2727
// clang-format on
28-
// XFAIL: *
28+
2929
#include "test_reduce_prod_negative_axes_keepdims_example_tensorrt.cc.tmp.main.cc.in"

tests/unittests/lit_cases/test_tensorrt/test_reduce_prod_negative_axes_keepdims_random_tensorrt.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
// RUN: %t_tensorrt.exe 0.0001 0 tensorrt %data_path/test_reduce_prod_negative_axes_keepdims_random | FileCheck %s
2626
// CHECK: Result Pass
2727
// clang-format on
28-
// XFAIL: *
28+
2929
#include "test_reduce_prod_negative_axes_keepdims_random_tensorrt.cc.tmp.main.cc.in"

0 commit comments

Comments
 (0)