From 49913fa48bd52509a3010d75a124f41f970559d2 Mon Sep 17 00:00:00 2001 From: GaoWei8 Date: Fri, 14 Feb 2020 09:16:30 +0000 Subject: [PATCH] add define function test=develop --- lite/kernels/x86/reduce_compute.h | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/lite/kernels/x86/reduce_compute.h b/lite/kernels/x86/reduce_compute.h index d3aeee05b1..5192484fbc 100644 --- a/lite/kernels/x86/reduce_compute.h +++ b/lite/kernels/x86/reduce_compute.h @@ -25,11 +25,6 @@ namespace kernels { namespace x86 { struct SumFunctor { - template - void operator()(X* x, Y* y, const Dim& dim) { - y->device(lite::fluid::EigenDeviceType()) = x->sum(dim); - } - template void operator()(X* x, Y* y, const Dim& dim, size_t d, size_t r_d) { for (int i = 0; i < dim[0]; i++) { @@ -43,8 +38,23 @@ struct SumFunctor { } } } + + template + void operator()(X* x, Y* y, const Dim& dim) { + y->device(lite::fluid::EigenDeviceType()) = x->sum(dim); + } }; +#define HANDLE_DIMT(NDIM, RDIM) \ + if (ndim == NDIM && rdim == RDIM) { \ + paddle::lite::kernels::x86::ReduceFunctorTensor( \ + *input, output, dims, keep_dim); \ + } + #define HANDLE_DIM(NDIM, RDIM) \ if (ndim == NDIM && rdim == RDIM) { \ paddle::lite::kernels::x86:: \ -- GitLab