tvm
Loading...
Searching...
No Matches
reduction.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
23#ifndef TVM_TE_REDUCTION_H_
24#define TVM_TE_REDUCTION_H_
25
26#include <tvm/s_tir/iter_var.h>
27
28namespace tvm::prim {
37TVM_DLL PrimExpr sum(PrimExpr source, ffi::Array<s_tir::IterVar> axis,
38 ffi::Array<PrimExpr> init = {}, Location loc = UnknownLoc());
39
47TVM_DLL PrimExpr all(PrimExpr source, ffi::Array<s_tir::IterVar> axis,
48 ffi::Array<PrimExpr> init = {}, Location loc = UnknownLoc());
49
58TVM_DLL PrimExpr any(PrimExpr source, ffi::Array<s_tir::IterVar> axis,
59 ffi::Array<PrimExpr> init = {}, Location loc = UnknownLoc());
60
69TVM_DLL PrimExpr prod(PrimExpr source, ffi::Array<s_tir::IterVar> axis,
70 ffi::Array<PrimExpr> init = {}, Location loc = UnknownLoc());
71
72} // namespace tvm::prim
73
74namespace tvm {
83TVM_DLL PrimExpr max(PrimExpr source, ffi::Array<s_tir::IterVar> axis,
84 ffi::Array<PrimExpr> init = {}, Location loc = UnknownLoc());
85
94TVM_DLL PrimExpr min(PrimExpr source, ffi::Array<s_tir::IterVar> axis,
95 ffi::Array<PrimExpr> init = {}, Location loc = UnknownLoc());
96
97} // namespace tvm
98#endif // TVM_TE_REDUCTION_H_
Non-nullable source-location metadata.
Definition location.h:91
Typed reference/view over any Expr whose ExprNode::ty is PrimType.
Definition base_expr.h:447
Reference to the shared immutable unknown location.
Definition location.h:105
Axis metadata for schedulable tensor computations.
Definition expr.h:47
PrimExpr all(PrimExpr source, ffi::Array< s_tir::IterVar > axis, ffi::Array< PrimExpr > init={}, Location loc=UnknownLoc())
logical And of source expression over axis
PrimExpr prod(PrimExpr source, ffi::Array< s_tir::IterVar > axis, ffi::Array< PrimExpr > init={}, Location loc=UnknownLoc())
product of source expression over axis
PrimExpr sum(PrimExpr source, ffi::Array< s_tir::IterVar > axis, ffi::Array< PrimExpr > init={}, Location loc=UnknownLoc())
sum of source expression over axis
PrimExpr any(PrimExpr source, ffi::Array< s_tir::IterVar > axis, ffi::Array< PrimExpr > init={}, Location loc=UnknownLoc())
logical Or of source expression over axis
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition attr.h:23
TVM_TIRX_DLL PrimExpr max(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
take maximum of two values
TVM_TIRX_DLL PrimExpr min(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
take minimum of two values