okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
ad33b8074
main
1//==---- numeric.h --------------------------------*- C++ -*----------------==// 2// 3// Copyright (C) Intel Corporation 4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 5// See https://llvm.org/LICENSE.txt for license information. 6// 7//===----------------------------------------------------------------------===// 8 9#ifndef __DPCT_NUMERIC_H__ 10#define __DPCT_NUMERIC_H__ 11 12namespace dpct { 13 14template < typename Policy ,typename InputIt1 ,typename InputIt2 ,typename T > 15T inner_product (Policy && policy ,InputIt1 first1 ,InputIt1 last1 , 16InputIt2 first2 ,T init ) { 17return std ::transform_reduce (std ::forward < Policy > (policy ),first1 ,last1 , 18first2 ,init ); 19} 20 21template < typename Policy ,typename InputIt1 ,typename InputIt2 ,typename T , 22typename BinaryOperation1 ,typename BinaryOperation2 > 23T inner_product (Policy && policy ,InputIt1 first1 ,InputIt1 last1 , 24InputIt2 first2 ,T init ,BinaryOperation1 op1 , 25BinaryOperation2 op2 ) { 26return std ::transform_reduce (std ::forward < Policy > (policy ),first1 ,last1 , 27first2 ,init ,op1 ,op2 ); 28} 29 30}// end namespace dpct 31 32#endif