Home
last modified time | relevance | path

Searched refs:TensorType (Results 1 – 25 of 82) sorted by relevance

1234

/llvm-project/llvm/lib/Analysis/
H A DTensorSpec.cpp33 template <> TensorType TensorSpec::getDataType<T>() { return TensorType::E; }
39 static std::array<std::string, static_cast<size_t>(TensorType::Total)> in SUPPORTED_TENSOR_TYPES()
46 StringRef toString(TensorType TT) { in toString()
62 TensorSpec::TensorSpec(const std::string &Name, int Port, TensorType Type, in TensorSpec()
87 std::string TensorType; in getTensorSpecFromJSON() local
92 if (!Mapper.map<std::string>("type", TensorType)) in getTensorSpecFromJSON()
100 if (TensorType == #T) \ in getTensorSpecFromJSON()
110 case TensorType::N: { \ in tensorValueToString()
118 case TensorType::Total: in tensorValueToString()
119 case TensorType::Invalid: in tensorValueToString()
/llvm-project/llvm/include/llvm/Analysis/
H A DTensorSpec.h54 enum class TensorType { enum
73 TensorType type() const { return Type; } in type()
101 TensorSpec(const std::string &Name, int Port, TensorType Type,
104 template <typename T> static TensorType getDataType();
108 TensorType Type = TensorType::Invalid;
128 template <> TensorType TensorSpec::getDataType<T>();
/llvm-project/mlir/lib/Conversion/TosaToTensor/
H A DTosaToTensor.cpp31 TensorType inferReshapeInputType(TypedValue<TensorType> input, in inferReshapeInputType()
48 TensorType inferReshapeExpandedType(TensorType inputType, in inferReshapeExpandedType()
103 TensorType inferReshapeCollapsedType(TensorType lhsType, TensorType rhsType) { in inferReshapeCollapsedType()
153 auto srcShape = cast<TensorType>(srcType).getShape(); in createReassociationMapForCollapse()
154 auto dstShape = cast<TensorType>(dstType).getShape(); in createReassociationMapForCollapse()
201 Value createCollapse(OpBuilder &builder, Location loc, TensorType resultTyp
[all...]
/llvm-project/mlir/lib/Dialect/Bufferization/IR/
H A DBufferizableOpInterface.cpp216 if (!llvm::isa<TensorType>(operandType)) in resolveTensorOpOperandConflicts()
316 defaultFunctionArgTypeConverter(TensorType type, Attribute memorySpace, in defaultFunctionArgTypeConverter()
326 llvm::cast<TensorType>(value.getType()), memorySpace); in defaultUnknownTypeConverter()
363 functionArgTypeConverterFn = [=](TensorType tensorType, Attribute memorySpace, in setFunctionBoundaryTypeConversion()
460 assert(llvm::isa<TensorType>(value.getType()) && "expected TensorType"); in isValueRead()
650 auto tensorType = llvm::dyn_cast<TensorType>(value.getType()); in getBuffer()
681 assert(llvm::isa<TensorType>(value.getType()) && in getBufferType()
695 options.defaultMemorySpaceFn(cast<TensorType>(value.getType())); in hasTensorSemantics()
719 if (llvm::isa<TensorType>(opResul in replaceOpWithBufferizedValues()
[all...]
H A DBufferizationOps.cpp275 TensorType type, ValueRange dynamicSizes, Value copy, in build()
387 TensorType type; in parse()
419 if (auto validType = llvm::dyn_cast<::mlir::TensorType>(type)) in print()
555 assert(isa<TensorType>(getDest().getType()) && "expected tensor type"); in bufferizesToMemoryWrite()
573 assert(isa<TensorType>(getDest().getType()) && "expected tensor type"); in getAliasingValues()
582 bool tensorDest = isa<TensorType>(getDest().getType()); in bufferize()
613 assert(isa<TensorType>(getDest().getType()) && "expected tensor type"); in reifyResultShapes()
624 if (isa<TensorType>(getDest().getType())) { in buildSubsetExtraction()
672 if (!isa<TensorType, BaseMemRefType>(getDest().getType())) in verify()
674 if (auto destType = dyn_cast<TensorType>(getDes in verify()
[all...]
/llvm-project/mlir/lib/Dialect/SCF/Transforms/
H A DBufferizableOpInterfaceImpl.cpp105 if (isa<TensorType>(value.getType())) { in bufferize()
204 if (isa<TensorType>(it.value())) { in bufferize()
247 if (!isa<TensorType>(result.getType())) { in bufferize()
317 cast<TensorType>(opResult.getType()), thenBufferType.getMemorySpace()); in getBufferType()
357 if (!isa<TensorType>(result.getType())) { in bufferize()
430 cast<TensorType>(value.getType()), bufferType.getMemorySpace()); in getBufferType()
442 if (isa<TensorType>(it.value().getType())) in getTensorIndices()
455 if (!isa<TensorType>(bbArgs[i].getType()) || in getEquivalentBuffers()
456 !isa<TensorType>(yieldedValues[i].getType())) in getEquivalentBuffers()
471 if (isa<TensorType>(opOperan in getBuffers()
[all...]
/llvm-project/mlir/lib/Dialect/Bufferization/Transforms/
H A DOneShotAnalysis.cpp71 static bool isaTensor(Type t) { return isa<TensorType>(t); } in isaTensor()
99 if (isa<TensorType>(opOperand.get().getType())) in setInPlaceOpOperand()
117 if (isa<TensorType>(v.getType())) in OneShotAnalysisState()
122 if (isa<TensorType>(bbArg.getType())) in OneShotAnalysisState()
131 if (isa<TensorType>(opOperand.get().getType())) in OneShotAnalysisState()
194 if (!isa<TensorType>(opResult.getType())) in gatherUndefinedTensorUses()
1014 if (isa<TensorType>(opOperand.get().getType())) in bufferizableInPlaceAnalysisImpl()
1026 if (!isa<TensorType>(opResult.getType())) in analyzeSingleOp()
1098 if (!isa<TensorType>(v.getType()))
1115 if (!isa<TensorType>( in bottomUpFromTerminatorsHeuristic()
[all...]
H A DFuncBufferizableOpInterfaceImpl.cpp60 dyn_cast<TensorType>(funcOp.getFunctionType().getInput(index));
61 assert(tensorType && "expected TensorType");
214 auto tensorType = cast<TensorType>(resultType); in getBufferType()
229 if (!isa<TensorType>(returnType)) { in bufferize()
252 if (!isa<TensorType>(opOperand.get().getType())) { in bufferize()
347 auto isaTensor = llvm::IsaPred<TensorType>; in hasTensorSemantics()
405 if (isa<TensorType>(argType)) { in bufferize()
416 if (auto tensorType = dyn_cast<TensorType>(resultType)) { in bufferize()
448 auto tensorType = dyn_cast<TensorType>(returnVal.getType()); in bufferize()
H A DBufferize.cpp102 [](TensorType t) -> std::optional<Attribute> {
109 [](TensorType t) -> std::optional<Attribute> { in matchAndRewrite()
134 auto tensorType = cast<TensorType>(value.getType()); in populateEliminateBufferizeMaterializationsPatterns()
433 auto tensorType = dyn_cast<TensorType>(bbArg.getType()); in bufferizeOp()
H A DOneShotModuleBufferize.cpp122 if (!isa<TensorType>(inputIt.value())) in annotateEquivalentReturnBbArg()
125 if (!isa<TensorType>(resultIt.value()))
166 if (!isa<TensorType>(v.getType())) in aliasingFuncOpBBArgsAnalysis()
239 if (!isa<TensorType>(funcOp.getFunctionType().getInput(idx)))
324 llvm::IsaPred<TensorType>) || in getFuncOpsOrderedByCalls()
326 llvm::IsaPred<TensorType>); in getFuncOpsOrderedByCalls()
/llvm-project/mlir/include/mlir/Dialect/Tosa/IR/
H A DTosaTypesBase.td148 def Tosa_Tensor1D : AnyTypeOf<[Tosa_UnrankedTensor, TosaTensorRankOf<[Tosa_AnyNumber], [1]>], "1-d tosa-conformant tensor", "::mlir::TensorType">;
149 def Tosa_Tensor2D : AnyTypeOf<[Tosa_UnrankedTensor, TosaTensorRankOf<[Tosa_AnyNumber], [2]>], "2-d tosa-conformant tensor", "::mlir::TensorType">;
150 def Tosa_Tensor3D : AnyTypeOf<[Tosa_UnrankedTensor, TosaTensorRankOf<[Tosa_AnyNumber], [3]>], "3-d tosa-conformant tensor", "::mlir::TensorType">;
151 def Tosa_Tensor4D : AnyTypeOf<[Tosa_UnrankedTensor, TosaTensorRankOf<[Tosa_AnyNumber], [4]>], "4-d tosa-conformant tensor", "::mlir::TensorType">;
152 def Tosa_Tensor5D : AnyTypeOf<[Tosa_UnrankedTensor, TosaTensorRankOf<[Tosa_AnyNumber], [5]>], "5-d tosa-conformant tensor", "::mlir::TensorType">;
222 def Tosa_TensorTypeAttr : TypeAttrBase<"TensorType", "Tensor type attribute">;
/llvm-project/mlir/lib/Dialect/MLProgram/Transforms/
H A DBufferizableOpInterfaceImpl.cpp60 auto tensorType = cast<TensorType>(globalOp.getType()); in bufferize()
97 auto tensorType = cast<TensorType>(globalLoadOp.getType()); in bufferize()
127 auto tensorType = cast<TensorType>(globalStoreOp.getValue().getType()); in bufferize()
/llvm-project/mlir/lib/Interfaces/
H A DDestinationStyleOpInterface.cpp21 if (isa<TensorType>(t)) { in getNumTensorResults()
36 if (isa<TensorType>(type)) { in verifyDestinationStyleOpInterface()
/llvm-project/mlir/include/mlir/IR/
H A DBuiltinTypes.h47 // TensorType
55 class TensorType : public Type, public ShapedType::Trait<TensorType> {
70 TensorType cloneWith(std::optional<ArrayRef<int64_t>> shape,
74 using ShapedType::Trait<TensorType>::clone;
404 inline bool TensorType::classof(Type type) { in isValidElementType()
/llvm-project/mlir/include/mlir/Dialect/Bufferization/IR/
H A DBufferizableOpInterface.h265 std::function<BaseMemRefType(TensorType, Attribute memorySpace,
273 std::function<std::optional<Attribute>(TensorType t)>;
373 [](TensorType t) -> std::optional<Attribute> { return Attribute(); };
660 getMemRefTypeWithFullyDynamicLayout(TensorType tensorType,
666 getMemRefTypeWithStaticIdentityLayout(TensorType tensorType,
/llvm-project/mlir/examples/toy/Ch7/mlir/
H A DDialect.cpp200 if (llvm::isa<mlir::TensorType>(type)) { in verifyConstantForType()
204 return op->emitError("constant of TensorType must be initialized by " in verifyConstantForType()
265 getResult().setType(cast<TensorType>(getValue().getType())); in inferShapes()
304 TensorType input = llvm::dyn_cast<TensorType>(inputs.front()); in areCastCompatible()
305 TensorType output = llvm::dyn_cast<TensorType>(outputs.front()); in areCastCompatible()
603 // Check that the type is either a TensorType or another StructType. in parseType()
604 if (!llvm::isa<mlir::TensorType, StructType>(elementType)) { in parseType()
606 "be a TensorType o in parseType()
[all...]
/llvm-project/mlir/lib/IR/
H A DBuiltinTypes.cpp256 // TensorType in scaleElementBitwidth()
259 Type TensorType::getElementType() const {
260 return llvm::TypeSwitch<TensorType, Type>(*this) in cloneWith()
265 bool TensorType::hasRank() const {
269 ArrayRef<int64_t> TensorType::getShape() const {
273 TensorType TensorType::cloneWith(std::optional<ArrayRef<int64_t>> shape, in getElementType()
289 RankedTensorType TensorType::clone(::llvm::ArrayRef<int64_t> shape, in cloneWith()
294 RankedTensorType TensorType::clone(::llvm::ArrayRef<int64_t> shape) const { in cloneWith()
302 if (!TensorType in clone()
[all...]
/llvm-project/mlir/lib/Dialect/Vector/Transforms/
H A DBufferizableOpInterfaceImpl.cpp53 assert(isa<TensorType>(readOp.getShapedType()) && in bufferize()
108 assert(isa<TensorType>(writeOp.getShapedType()) && in bufferize()
153 assert(isa<TensorType>(gatherOp.getBaseType()) && in bufferize()
299 if (isa<TensorType>(value.getType())) { in bufferize()
/llvm-project/mlir/test/mlir-tblgen/
H A Dop-operand.td43 // DECL-LABEL: ::mlir::TypedValue<::mlir::TensorType> getInput2
44 // DECL-NEXT: return ::llvm::cast<::mlir::TypedValue<::mlir::TensorType>>(*getODSOperands(1).begin(…
/llvm-project/mlir/examples/toy/Ch4/mlir/
H A DDialect.cpp270 TensorType input = llvm::dyn_cast<TensorType>(inputs.front()); in areCastCompatible()
271 TensorType output = llvm::dyn_cast<TensorType>(outputs.front()); in areCastCompatible()
/llvm-project/mlir/examples/toy/Ch6/mlir/
H A DDialect.cpp270 TensorType input = llvm::dyn_cast<TensorType>(inputs.front()); in areCastCompatible()
271 TensorType output = llvm::dyn_cast<TensorType>(outputs.front()); in areCastCompatible()
/llvm-project/mlir/examples/toy/Ch5/mlir/
H A DDialect.cpp270 TensorType input = llvm::dyn_cast<TensorType>(inputs.front()); in areCastCompatible()
271 TensorType output = llvm::dyn_cast<TensorType>(outputs.front()); in areCastCompatible()
/llvm-project/mlir/lib/Dialect/Shape/Transforms/
H A DBufferizableOpInterfaceImpl.cpp67 if (isa<TensorType>(it.value())) { in bufferize()
119 if (isa<TensorType>(value.getType())) { in bufferize()
/llvm-project/mlir/lib/Dialect/SparseTensor/Transforms/
H A DSparsificationAndBufferizationPass.cpp43 if (isa<TensorType>(t) && getSparseTensorEncoding(t)) in containsSparseTensor()
224 cast<TensorType>(value.getType()), memorySpace); in getBufferizationOptionsForSparsification()
/llvm-project/mlir/lib/Dialect/Tosa/Transforms/
H A DTosaFolders.cpp66 LogicalResult notifyIfNotFloat(TypedValue<TensorType> toCheck, TosaOp location, in notifyIfNotFloat()
77 LogicalResult notifyIfNoTosaDenseConstantTensor(TypedValue<TensorType> toCheck, in notifyIfNoTosaDenseConstantTensor()
102 LogicalResult notifyIfNotConstantFloatTosaTensor(TypedValue<TensorType> toCheck, in notifyIfNotConstantFloatTosaTensor()

1234