MLIR 22.0.0git
ParallelLoopMapper.h
Go to the documentation of this file.
1//===- ParallelLoopMapper.h - Utilities for mapping parallel loops to GPU ====//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This header file declares the utilities to generate mappings for parallel
10// loops to GPU devices.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef MLIR_DIALECT_GPU_TRANSFORMS_PARALLELLOOPMAPPER_H
15#define MLIR_DIALECT_GPU_TRANSFORMS_PARALLELLOOPMAPPER_H
16
18#include "mlir/Support/LLVM.h"
19#include "llvm/ADT/StringRef.h"
20
21namespace mlir {
22
23class AffineMap;
24class Operation;
25class Region;
26
27} // namespace mlir
28
29namespace mlir {
30namespace scf {
31class ParallelOp;
32} // namespace scf
33
34namespace gpu {
35
36/// Name of the mapping attribute produced by loop mappers.
37StringRef getMappingAttrName();
38
39/// Sets the mapping attribute of a scf.parallel operation. Verifies that the
40/// mapping passed is valid.
41/// - the number of DimMapperAttr provided is same as the number of loops of
42/// the `ploopOp`.
43/// - the mapping does not map multiple loops to the same processor.
44LogicalResult setMappingAttr(scf::ParallelOp ploopOp,
46} // namespace gpu
47} // namespace mlir
48#endif // MLIR_DIALECT_GPU_TRANSFORMS_PARALLELLOOPMAPPER_H
A multi-dimensional affine map Affine map's are immutable like Type's, and they are uniqued.
Definition AffineMap.h:46
Operation is the basic unit of execution within MLIR.
Definition Operation.h:88
This class contains a list of basic blocks and a link to the parent operation it is attached to.
Definition Region.h:26
LogicalResult setMappingAttr(scf::ParallelOp ploopOp, ArrayRef< ParallelLoopDimMappingAttr > mapping)
Sets the mapping attribute of a scf.parallel operation.
StringRef getMappingAttrName()
Name of the mapping attribute produced by loop mappers.
Include the generated interface declarations.